neuronlayer
v0.3.1
Published
Turn any AI coding assistant into an intelligent one - MCP server with code intelligence, semantic search, and persistent memory
Maintainers
Readme
NeuronLayer
Turn any AI coding assistant into an intelligent one.
The Problem
AI coding assistants are powerful but forgetful:
| Problem | Stat | |---------|------| | Productivity paradox | 19% SLOWER with AI | | "Almost right" frustration | 66% of developers | | Trust issues | Only 29% trust AI code | | Context collapse | AI forgets mid-session | | Technical debt | 1.64x higher errors | | Code duplication | 4x more cloning |
The Solution
NeuronLayer gives AI assistants persistent, intelligent memory:
- Never forget context - Decisions, patterns, and history persist across sessions
- Self-documenting codebase - Architecture docs generate automatically
- Context rot prevention - AI stays sharp even in long sessions
- Pattern enforcement - Stops code duplication before it happens
- Test-aware suggestions - AI respects your tests
Compatibility
| Tool | Supported | Auto-Configure |
|------|-----------|----------------|
| memcode (Built-in agent) | Yes | N/A (Native) |
| Claude Desktop | Yes | neuronlayer init |
| Claude Code (CLI) | Yes | neuronlayer init |
| OpenCode | Yes | neuronlayer init |
| VS Code + Continue | Yes | Manual config |
| Cursor | Not yet | No MCP support |
| Any MCP Client | Yes | Manual config |
Quick Start
Installation
npm install -g neuronlayerOne-Command Setup
cd your-project
neuronlayer initThat's it! This automatically:
- Registers your project
- Configures Claude Desktop
- Configures OpenCode
- Configures Claude Code
Just restart your AI tool and NeuronLayer is active.
Output
NeuronLayer initialized!
Project: my-project
Path: /home/user/my-project
Data: ~/.neuronlayer/projects/my-project-abc123
Configured MCP Clients:
✓ Claude Desktop: ~/.config/claude/claude_desktop_config.json
✓ OpenCode: ~/.opencode/config.json
✓ Claude Code: ~/.claude.json
Restart your AI tools to activate.Manual Configuration
If you prefer manual setup or use a different MCP client:
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"neuronlayer": {
"command": "npx",
"args": ["-y", "neuronlayer", "--project", "/path/to/your/project"]
}
}
}Config locations:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
OpenCode
Add to ~/.opencode/config.json:
{
"mcpServers": {
"neuronlayer": {
"command": "npx",
"args": ["-y", "neuronlayer", "--project", "/path/to/your/project"]
}
}
}Features
Core Features
| Feature | Description | |---------|-------------| | Semantic Search | Find code by meaning, not just keywords | | Decision Recording | Log architectural decisions with context | | Pattern Library | Learn and enforce coding patterns | | File Indexing | Symbol extraction for TS/JS/Python |
Advanced Features
| Feature | Description | |---------|-------------| | Living Documentation | Auto-generated architecture docs | | Context Rot Prevention | Smart compaction keeps AI focused | | Confidence Scoring | Know when AI is guessing vs confident | | Change Intelligence | "What changed?" and "Why did it break?" | | Architecture Enforcement | Suggest existing functions, prevent duplication | | Test-Aware Suggestions | Predict test failures before they happen | | Super Intelligent Brain (Ghost Mode) | Proactively checks for conflicts, déjà vu, and session context | | Pre-commit Quality Gate | Validates AI-generated code against hallucination and patterns BEFORE commit |
How It Works
+-------------------------------------------------------------+
| NEURONLAYER |
+-------------------------------------------------------------+
| |
| +--------------+ +--------------+ +--------------+ |
| | AI Tool |--->| MCP Server |--->| Memory | |
| | Claude/Open | | (stdio) | | Engine | |
| +--------------+ +--------------+ +--------------+ |
| | |
| +--------------------+--+----+ |
| | v | |
| +--------------+ +-----+----+ +------------------+| |
| | Your Code |--->| Indexer |--->| SQLite + Vec DB || |
| | (watched) | | (Regex) | | (embeddings) || |
| +--------------+ +----------+ +------------------+| |
| | |
+-------------------------------------------------------------+Memory Tiers
- Tier 1 - Hot cache for active files (instant)
- Tier 2 - SQLite for decisions, patterns, history (fast)
- Tier 3 - Vector embeddings for semantic search (smart)
MCP Tools (The Gateway Architecture)
NeuronLayer elegantly compresses 51+ granular internal functions into 12 optimized Gateway Tools, dramatically saving prompt tokens and improving LLM routing reliability (proven 759x faster than standard grep).
6 Core Gateways
memory_query- Semantic search, symbol lookup, and focused context retrieval.memory_record- Save architectural decisions, patterns, and feedback.memory_review- Pre-flight check before code changes vs patterns & decisions.memory_status- Project overview, architecture diagrams, and health checks.memory_ghost- The "Super Intelligent Brain": flags conflicts, déjà vu, and session resurrection.memory_verify- Pre-commit quality gate for AI-generated code (hallucinations, imports, security, tests).
6 Standalone Commands
switch_project- Hot-swap active project context.switch_feature_context- Resume tracking an ongoing feature.trigger_compaction- Smart compression of context tree.update_decision_status- Mark architectural choices as deprecated/superseded.export_decisions_to_adr- Generate markdown Architecture Decision Records (ADRs).discover_projects- Find eligible Git repositories on disk.
🤖 memcode - The First-Party AI Coding Assistant
NeuronLayer powers its own fully-featured terminal coding agent: memcode. It natively understands NeuronLayer's context graph and avoids context rot.
Quick Start
# Set your preferred API key
export ANTHROPIC_API_KEY=your-key
# Run memcode inside your project
npx neuronlayer memcodememcode Features
- Multi-LLM Support: Claude (Anthropic), all GPT/o1 (OpenAI), 200+ models via OpenRouter, and Local LLMs (Ollama).
- Persistent Memory: Decisions and patterns automatically persist across your chat sessions.
- Full Shell & Git access: Runs commands, tests, and edits files directly in your sandbox.
- Session Lifecycles: Save and resume conversations exactly where you left them.
Interactive Commands
Inside a memcode session, use:
/model [name]- Hot-swap LLMs./feature [name]- Track a specific feature area./cost- Track precise token usage and cost./save&/continue- Session management.
CLI Commands
# Quick setup (auto-configures Claude Desktop, OpenCode)
neuronlayer init
# Run the native AI Coding Assistant
neuronlayer memcode
# List all registered projects
neuronlayer projects list
# Add a new project
neuronlayer projects add /path/to/my-project
# Switch active project
neuronlayer projects switch <id>
# Export decisions to ADR files
neuronlayer export --format madr
# Discover projects in common locations
neuronlayer projects discover
# Show help
neuronlayer helpData Storage
NeuronLayer stores project data separately for each project:
~/.neuronlayer/
├── projects/
│ ├── project-a-abc123/
│ │ ├── neuronlayer.db # SQLite database
│ │ └── embeddings/ # Vector index
│ └── project-b-def456/
│ ├── neuronlayer.db
│ └── embeddings/
└── registry.json # Project registryEach project is isolated - no data mixing between projects.
Privacy
NeuronLayer is 100% local by default:
- All data stored on your machine
- No cloud services required
- No telemetry or tracking
- Works completely offline
Development
Prerequisites
- Node.js 18+
- npm or yarn
Setup
# Clone the repository
git clone https://github.com/abhisavakar/neuronlayer.git
cd neuronlayer
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Type check
npm run typecheckContributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Areas We Need Help
- Additional language support (Go, Rust, Java)
- IDE extensions (VS Code, JetBrains)
- Cursor integration (when they add MCP support)
- Documentation improvements
- Performance optimizations
Roadmap
- [x] Core MCP server
- [x] Living Documentation
- [x] Context Rot Prevention
- [x] Confidence Scoring
- [x] Change Intelligence
- [x] Architecture Enforcement
- [x] Test-Aware Suggestions
- [x] Auto-setup for Claude Desktop
- [x] Auto-setup for OpenCode
- [ ] VS Code extension
- [ ] Cursor support (pending MCP)
- [ ] Team features (shared memory)
License
MIT License - see LICENSE for details.
Author
Abhishek Arun Savakar - savakar.com
Acknowledgments
Built with:
- Model Context Protocol by Anthropic
- better-sqlite3
- Xenova/transformers for embeddings
Made with determination over a weekend.
Code intelligence that transforms AI assistants into intelligent coding partners.
