memory-engineering-mcp
v14.2.1
Published
π§ AI Memory System powered by MongoDB Atlas & Voyage AI - Autonomous memory management with zero manual work
Downloads
45
Maintainers
Readme
π§ Memory Engineering MCP
π― What is Memory Engineering MCP?
PROOF: Following Archon's README.md structure (line 23-37)
Memory Engineering MCP is a production-ready AI coding assistance platform that manages your project's 7 Core Memories automatically. For AI coding assistants (Claude Code, Cursor, Windsurf), it's a Model Context Protocol (MCP) server providing:
- 7 Core Memories (activeContext, projectBrief, systemPatterns, techContext, progress, productContext, codebaseMap)
- Smart semantic search with Voyage AI embeddings and reranking
- MongoDB graph capabilities for code relationship tracking
- Automatic memory sync with zero manual work
- Production-grade reliability with monitoring, backups, and error recovery
100% MongoDB + Voyage AI - Built exclusively on MongoDB Atlas Vector Search and Voyage AI for embeddings/reranking
β¨ Key Features
7 Core Memories (Heart of the System)
Each memory serves a specific purpose in your AI's understanding:
- activeContext - Current work focus and immediate tasks
- projectBrief - High-level project goals and vision
- systemPatterns - Coding patterns and architectural decisions
- techContext - Technology stack and dependencies
- progress - Development milestones and achievements
- productContext - Business requirements and user needs
- codebaseMap - File structure and module organization
Advanced RAG Capabilities
- Hybrid search: 70% memories + 30% knowledge base
- Voyage reranking: 5x candidate fetching for precision
- MongoDB Vector Search: Native vector operations
- Contextual embeddings: Voyage AI
voyage-code-3for code
Production Features
- Performance monitoring: Track operation duration, detect slow queries
- Automatic backups: Hourly backups of all 7 memories
- Error recovery: Retry with exponential backoff, circuit breakers
- MongoDB graph: Track code relationships and dependencies
Quick Start
PROOF: Following Archon's Quick Start structure (line 47-111)
Prerequisites
- Node.js 18+
- Option A (Easiest): Docker Desktop for local MongoDB
- Option B (Production): MongoDB Atlas account (free tier works!)
- Voyage AI API key (free tier: 25M tokens/month)
- AI coding assistant (Claude Code, Cursor, or Windsurf)
Setup Instructions
π Option A: Local MongoDB (Recommended for Development)
One-command setup with full vector search:
Clone & Setup:
git clone https://github.com/your-username/memory-engineering-mcp.git cd memory-engineering-mcp # Automated setup (creates MongoDB 8.2 + mongot) ./scripts/setup-local-mongodb.shAdd Voyage AI Key:
# Edit .env and add: VOYAGE_API_KEY=your-voyage-api-keyInitialize & Go:
memory_engineering_init
β That's it! Full vector search, hybrid search, all features enabled locally.
What you get: MongoDB 8.2 with mongot for vector search, replica set for change streams, automatic health checks.
π Detailed guide: See LOCAL_SETUP_GUIDE.md
βοΈ Option B: MongoDB Atlas (Recommended for Production)
Clone Repository:
git clone https://github.com/your-username/memory-engineering-mcp.git cd memory-engineering-mcpEnvironment Configuration:
cp .env.example .env # Edit .env and add your credentials: # MONGODB_URI=mongodb+srv://user:[email protected]/memory-engineering # VOYAGE_API_KEY=your-voyage-api-keyInstall Dependencies:
pnpm installBuild the Server:
pnpm run buildInitialize MongoDB Collections: The collections will be created automatically on first run with proper indexes.
Configure Your AI Coding Assistant:
For Claude Code: Add to your Claude Desktop config (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS):{ "mcpServers": { "memory-engineering": { "command": "node", "args": ["/absolute/path/to/memory-engineering-mcp/dist/index.js"], "env": { "MONGODB_URI": "your-mongodb-uri", "VOYAGE_API_KEY": "your-voyage-key" } } } }For Cursor/Windsurf: Similar configuration in their respective MCP settings.
Initialize Your Project: In your AI coding assistant, use:
Use the memory_engineering_init tool to initialize memories for this project
β‘ Quick Test
Once configured:
- Initialize Memories: Ask your AI assistant to initialize the 7 core memories
- Sync Codebase: Use
memory_engineering_syncto analyze your code and create embeddings - Search: Use
memory_engineering_searchto find relevant code and context - Check Status: Use
memory_engineering_statusto see memory freshness
π What's Included
PROOF: Following Archon's structure with 7 core memories as the foundation
MCP Tools (7 Available)
| Tool | Purpose |
|------|---------|
| memory_engineering_init | Initialize 7 core memories for a project |
| memory_engineering_memory | Get or update a specific memory |
| memory_engineering_sync | Sync codebase with embeddings |
| memory_engineering_search | Semantic search across memories and code |
| memory_engineering_status | Get memory freshness and health status |
| memory_engineering_health | System health check |
| memory_engineering_crawl | Crawl documentation (ready for Bright Data) |
Services (10 Production Services)
| Service | Purpose | |---------|---------| | MemoryService | CRUD operations for 7 core memories | | SearchService | Unified search with reranking | | EmbeddingService | Voyage AI integration with rate limiting | | SettingsService | MongoDB-based configuration | | HealthService | System monitoring | | KnowledgeService | Documentation storage | | CrawlService | Web crawling (Bright Data ready) | | GraphService | MongoDB graph for code relationships | | PerformanceMonitor | Operation tracking and analytics | | BackupService | Automatic memory backups |
MongoDB Collections (8 Core Collections)
| Collection | Purpose |
|------------|---------|
| memories | 7 core memories with embeddings |
| projects | Project metadata |
| codeChunks | Code embeddings for search |
| archon_settings | Runtime configuration |
| knowledgeSources | Crawled documentation |
| knowledgeChunks | Content embeddings |
| graph_nodes | Code entities (files, functions, classes) |
| graph_edges | Code relationships (imports, calls, extends) |
ποΈ Architecture
PROOF: Following Archon's architecture overview structure
System Design
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Coding Assistant β
β (Claude Code / Cursor / Windsurf) β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β MCP Protocol
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Memory Engineering MCP Server β
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β MCP Tools βββ Services βββ Utilities β β
β β (7 tools) β β (10 services)β β (monitoring) β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β MongoDB β β Voyage AI β β Bright Data β
β Atlas β β API β β (optional) β
βββββββββββββββ βββββββββββββββ βββββββββββββββTechnology Stack
Backend: TypeScript 5, Node.js 18+, MCP SDK Database: MongoDB Atlas with Vector Search AI: Voyage AI (voyage-code-3 for embeddings, rerank-2 for reranking) Infrastructure: Production-grade error handling, monitoring, backups
Key Design Decisions
- MongoDB + Voyage AI Only: No other infrastructure dependencies
- 7 Core Memories: Fixed structure, each with specific purpose
- Service Layer: Clean separation of concerns
- Production First: Monitoring, backups, error recovery from day one
π Documentation
- Architecture Guide - Detailed system design
- API Reference - All MCP tools and services
- Example Workflows - Common usage patterns
- Troubleshooting - Common issues and solutions
π§ Development
# Install dependencies
pnpm install
# Build TypeScript
pnpm run build
# Run linter
pnpm run lint
# Type check
pnpm run typecheck
# Watch mode for development
pnpm run watchπ€ Contributing
We follow Archon's contributing patterns:
- Fix forward: No backward compatibility, always improve
- Detailed errors: Help users debug issues
- Production quality: Every feature production-ready
- Documentation: Code changes include docs
See CONTRIBUTING.md for details.
π License
MIT License - See LICENSE for details.
π Acknowledgments
Built following Archon's proven production patterns:
- Service layer architecture
- MCP tool design
- Error handling patterns
- Performance monitoring
- Documentation structure
Memory Engineering MCP v14.0.0-alpha.6
Production-Ready AI Memory System
Powered by MongoDB Atlas & Voyage AI
