The first code editor with a hierarchical cognitive architecture that thinks like a developer
CodeMind is a revolutionary AI-powered IDE built on a VSCode fork that uses hierarchical multi-agent cognition to understand and improve your code. Unlike traditional AI code assistants that use a single LLM, CodeMind employs six specialized cognitive agents that analyze your code from different perspectives, then synthesize their insights through a meta-cognitive layer with built-in N2 self-correction.
Current AI code editors (Cursor, Copilot, etc.) suffer from:
- Single-perspective analysis - One AI model making all decisions
- No quality verification - Generated code accepted without validation
- Shallow reasoning - Quick answers without deep analysis
- Inconsistent outputs - Same query produces wildly different results
- Black-box thinking - No visibility into the reasoning process
CodeMind solves this through its unique cognitive architecture.
┌─────────────────────────────────────────────────────────────┐
│ Meta-Cognitive Layer (N2) │
│ Self-evaluation and quality control │
│ • Scores output quality (0-10) │
│ • Triggers refinement if score < 9 │
│ • Ensures consistency and correctness │
└────────────────────────┬────────────────────────────────────┘
│
┌────────────────────────┴────────────────────────────────────┐
│ Synthesis Layer (Central) │
│ ODAI Cycle: Observe -> Distill -> Adapt -> Integrate │
│ • Combines multiple agent perspectives │
│ • Resolves conflicts and contradictions │
│ • Produces unified implementation │
└────────────────────────┬────────────────────────────────────┘
│
┌────────────────────────┴────────────────────────────────────┐
│ Specialist Agent Layer (Six Agents) │
│ │
│ Architect Engineer Security │
│ Performance Testing Documentation │
│ │
│ Each agent analyzes code from their specialized lens │
└───────────────────────────────────────────────────────────────┘
| Agent | Focus | What They Check |
|---|---|---|
| Architect | Design & Structure | Clean architecture, SOLID principles, design patterns, maintainability |
| Engineer | Implementation | Correctness, edge cases, error handling, best practices |
| Security | Safety & Privacy | Vulnerabilities, injection risks, data exposure, auth issues |
| Performance | Optimization | Complexity, memory usage, bottlenecks, scaling concerns |
| Testing | Quality Assurance | Testability, test coverage, test cases, QA considerations |
| Documentation | Clarity & Communication | Code clarity, naming, comments, documentation needs |
The system assigns quality scores to its own outputs:
- Score >=9: Accept and present to user
- Score <9: Issue repair directive and regenerate (up to 4 iterations)
This creates near-zero hallucination rates and ensures consistent quality.
- Multi-perspective analysis - Six specialized agents review every code change
- Self-correcting generation - Code that fails quality checks is automatically refined
- Context-aware suggestions - Full codebase understanding via semantic indexing
- Symbol-level awareness - Understands functions, classes, imports, dependencies
- Inline editing - Edit code in place with AI assistance (Ctrl+L)
- Tab autocomplete - Intelligent ghost text completions
- Multi-file operations - AI can modify multiple files atomically
- Diff view - Review AI changes before accepting
- Command palette integration - Access AI features from anywhere
- Local-first option - Run entirely offline with local models (Ollama, llama.cpp)
- No telemetry - Your code never leaves your machine (if configured)
- Multi-provider support - OpenAI, Anthropic, local models, custom endpoints
- Fast execution - Parallel agent processing for speed
- Full VSCode compatibility - All extensions, themes, and settings work
- LSP integration - Leverages Language Server Protocol for deep code understanding
- Terminal integration - AI can suggest and run terminal commands
- Git integration - AI-assisted commit messages, PR descriptions
Comprehensive documentation is available in the docs/ directory:
- Quick Start Guide - Get up and running in 5 minutes
- Implementation Guide - Full setup and build instructions
- Agent System Architecture - Deep dive into the multi-agent system
- Orchestrator Design - Multi-file operation system (Phase 3)
- Implementation Plan - Current progress and roadmap
- UI Design Principles - UI/UX guidelines
See the docs README for the complete documentation index.
# Clone repository
git clone https://github.com/vincitamore/codemind.git
cd codemind/vscode
# Install Node.js 22+ (required)
nvm install 22
nvm use 22
# Install dependencies
npm install
# Build and watch for changes
npm run watch
# In another terminal, run CodeMind
npm run start- Get your API key from OpenRouter
- Open VSCode Settings (Ctrl+,)
- Search for "OpenRouter"
- Add your API key:
// settings.json
{
"codemind.openrouter.apiKey": "sk-or-v1-...",
"codemind.openrouter.model": "x-ai/grok-4.1-fast"
}- Use
Ctrl+Lto activate inline code editing
See QUICK_START.md for detailed setup instructions.
| Metric | CodeMind Target |
|---|---|
| Code Quality Score | 9.2/10 |
| Bug Detection Rate | 94% |
| Security Vulnerability Detection | 96% |
| False Positive Rate | 3% |
| Hallucination Rate | <2% |
| Response Time (P95) | 4.2s |
Metrics based on internal testing goals
User: "Add error handling to this function"
Architect: Wrap in try-catch, add error types
Engineer: Validate inputs, handle edge cases
Security: Sanitize error messages, no data leaks
Performance: Avoid expensive error tracking in hot path
Testing: Add test cases for error scenarios
Documentation: Document error types and recovery
Synthesis Layer:
• Observes all agent recommendations
• Distills core requirements
• Resolves any conflicts
• Assigns quality score: 8.7/10
Repair Directive: "Add input validation, improve error types"
-> Agents re-analyze with directive
-> New synthesis: 9.4/10 Accept
function processData(data) {
+ if (!data || typeof data !== 'object') {
+ throw new ValidationError('Invalid data object');
+ }
+
+ try {
// existing logic
+ } catch (error) {
+ logger.error('Data processing failed', {
+ error: sanitizeError(error)
+ });
+ throw new ProcessingError('Data processing failed');
+ }
}- Base: VSCode fork (TypeScript, Electron)
- Agent System: Custom TypeScript framework
- LLM Integration: OpenAI, Anthropic, Ollama
- Code Intelligence: Tree-sitter parsers, LSP
- State: SQLite for local state
- Vector DB: Embedded vector store for semantic search
codemind/
├── core/ # VSCode fork
├── extensions/
│ └── codemind-agent/ # AI agent extension
├── agents/ # Agent implementations
│ ├── architect/
│ ├── engineer/
│ ├── security/
│ ├── performance/
│ ├── testing/
│ ├── documentation/
│ └── orchestrator/ # Synthesis & N2 loop
├── providers/ # LLM provider adapters
├── indexer/ # Code intelligence
└── ui/ # Custom UI components
Ask for complex features and get production-ready code that's been reviewed by six specialists.
Automated multi-perspective code review catching bugs, security issues, and performance problems.
Intelligent refactoring suggestions that consider architecture, performance, and maintainability.
AI that understands the root cause, considers edge cases, and provides tested solutions.
Automatic generation of clear, comprehensive documentation based on code analysis.
Understand why code is written a certain way through multi-perspective explanations.
- ✅ VSCode fork setup and build system
- ✅ Basic agent framework
- ✅ ODAI synthesis cycle
- ✅ N2 self-correction loop with early stopping
- ✅ OpenRouter integration (Grok, Claude, Llama, Gemini)
- ✅ Inline editing (Ctrl+L)
- ✅ All six specialist agents implemented
- ✅ Task-aware agents with relevance scoring
- ✅ Weighted quality scoring (relevance × confidence)
- ✅ Full file context + diagnostic integration
- ✅ Robust JSON parsing with multiple fallbacks
- ✅ Beautiful custom UI (progress, results, analysis panels)
- ✅ Inline diff viewer with GitHub-style decorations
- ✅ Retry logic with exponential backoff
- ✅ Empty document detection for comprehensive generation
- Orchestrator agent (task decomposition, multi-file planning)
- Chat/Composer interface (primary interaction point)
- Git worktree integration (instant rollback to any message)
- Session management (save/load conversations)
- Multi-file atomic operations with conflict detection
- Workspace context manager (intelligent file gathering)
- Verification system (compilation, linting, tests)
- Terminal integration (run commands, tests, builds)
See ORCHESTRATOR_TODO.md for the complete 10-phase roadmap (5-6 weeks).
- Semantic code search with vector embeddings
- Cross-file refactoring
- Advanced debugging assistance
- Test generation with coverage analysis
- Security scanning with vulnerability database
- Performance optimization (caching, parallelization)
- Extension marketplace integration
- Cloud sync (optional, privacy-respecting)
- Collaboration features
- Public beta release
We welcome contributions! See CONTRIBUTING.md for guidelines.
# Fork and clone
git clone https://github.com/yourusername/codemind.git
# Install dependencies
npm install
# Run in development mode
npm run watch
# Run tests
npm testMIT License - see LICENSE for details.
- Built on Visual Studio Code
- Inspired by cognitive psychology and hierarchical processing theories
- Agent architecture adapted from advanced hierarchical multi-agent research
- Documentation: docs.codemind.dev
- Discord: discord.gg/codemind
- Twitter: @codemind_ai
- Issues: GitHub Issues
Built with for developers who care about code quality
"True code intelligence emerges not from a single AI, but from the synthesis of many specialized perspectives, continuously refined through self-correction."