Version: 2.0 Date: December 4, 2025 Status: Ready for Implementation
This architecture transforms OmniMemory from a Claude-specific MCP server into a universal memory layer for all AI coding tools (Claude, Cursor, Copilot, VS Code).
Problem: AI tool users lose context when switching tools Solution: Memory Passport - portable session export/import with <2s migration
Example:
User in Claude → Export session → Switch to Cursor → Import session → Continue work with full context
All requested deliverables have been created:
Located in: MCP_INTEGRATION_ARCHITECTURE.md (Section: Core MCP Server Architecture)
4-Layer Architecture:
- MCP Protocol Layer: Tools (25+), Resources (5), Prompts (8)
- Memory Management Layer: Session, Context, Compression
- Service Integration Layer: 13 microservices
- Storage Layer: PostgreSQL, SQLite, Qdrant
Two formats provided:
a) OpenAPI Spec: mcp_server/MCP_TOOLS_OPENAPI.yaml
- Machine-readable specification
- Compatible with Swagger/Redoc
- Includes request/response schemas
- Authentication specification
b) Detailed Specs: MCP_INTEGRATION_ARCHITECTURE.md (Section: Tools Specification)
- 25+ tools across 5 categories
- TypeScript interfaces
- Python implementation samples
- Usage examples
Tool Categories:
- Memory Operations (8 tools)
- Search Operations (5 tools)
- Session Operations (6 tools)
- Workflow Operations (4 tools)
- Utility Operations (3 tools)
Located in: MCP_INTEGRATION_ARCHITECTURE.md (Section: Data Flow Architecture)
Three detailed flows:
a) Read Operation Flow
- L1 Hot Cache → L2 Response Cache → L3 File Hash Cache
- Compression decision tree
- Metrics tracking
b) Search Operation Flow (Tri-Index)
- Dense (Vector) + Sparse (BM25) + Structural (Facts)
- RRF fusion
- Witness reranking
- 98.5% API prevention
c) Session Creation/Restoration Flow
- New session initialization
- Same-tool restoration
- Cross-tool migration (Memory Passport)
Located in: MCP_INTEGRATION_ARCHITECTURE.md (Section: Security & Authentication)
Multi-layer security:
a) Authentication:
- API Key (omn_{key_id}_{secret})
- OAuth 2.0 (future)
- mTLS (future)
b) Authorization:
- Scope-based access (private, shared, public)
- User-level isolation
- Team-level sharing
c) Security Features:
- HMAC-SHA256 signatures for Memory Passports
- Rate limiting (100 req/min)
- Audit logging
- Encrypted data at rest
Sample API Key Generation:
import secrets
api_key = f"omn_{secrets.token_urlsafe(32)}"Located in: MCP_INTEGRATION_ARCHITECTURE.md (Section: Database Schema Extensions)
New Tables (6):
api_keys- API key managementmemories- Universal memory storagememory_tags- Tag indexingsession_migrations- Cross-tool migration loguser_preferences- User settingsresource_access_log- Audit trail
Modified Tables:
sessions- Added multi-tool columns
Total Schema Changes: 6 new tables, 1 modified table, 15+ indexes
Located in: MCP_INTEGRATION_ARCHITECTURE.md (Section: Implementation Plan)
6-Week Roadmap:
-
Week 1-2: Core MCP Server Refactoring
- Tool adapters (Claude, Cursor, Copilot)
- Standardized tool names
- MCP resources (5 types)
- MCP prompts (8 templates)
-
Week 3: Memory Operations
- Database schema
- 8 memory tools
- Semantic indexing
-
Week 4: Session Portability
- Memory Passport export/import
- Cross-tool testing
- Migration logging
-
Week 5: Authentication & Security
- API key system
- Scope enforcement
- Rate limiting
- Audit logging
-
Week 6: Integration Guides
- Claude Desktop
- Cursor
- VS Code (Copilot/Continue)
- API documentation
File Structure:
mcp_server/
├── omnimemory_universal_mcp.py # Main server
├── tool_adapters/
│ ├── claude_adapter.py
│ ├── cursor_adapter.py
│ └── copilot_adapter.py
├── resources/
│ ├── user_preferences.py
│ ├── session_context.py
│ └── ... (5 resources)
├── prompts/
│ └── templates/ (8 prompts)
└── tests/
├── test_tools.py
├── test_resources.py
└── test_migration.py
Located in: mcp_server/omnimemory_universal_mcp_sample.py
~800 lines of reference implementation including:
a) Tool Adapters:
class ClaudeAdapter(ToolAdapter):
def detect_workspace_path(self) -> str:
return os.getcwd()b) Memory Passport:
class MemoryPassport:
async def export_session(self, session: Dict, generate_qr: bool = False) -> Dict:
# Sign with HMAC
# Optional QR code
return passport_datac) Memory Tools:
@mcp.tool()
async def omn_store_memory(content: str, key: str, metadata: Optional[Dict] = None) -> str:
# Compress if needed
# Store in database
# Index for semantic search
return json.dumps({"memory_id": memory_id, ...})d) Search Tools:
@mcp.tool()
async def omn_semantic_search(query: str, limit: int = 10) -> str:
# Generate embeddings
# Tri-index search
# Track API prevention
return json.dumps({"results": filtered, ...})Located in: MCP_INTEGRATION_ARCHITECTURE.md (Section: Integration Guides)
Three comprehensive guides:
a) Claude Desktop:
- Installation steps
- Config.json setup
- Tool verification
- Test commands
b) Cursor:
- MCP configuration
- Session migration from Claude
- Test workflow
c) VS Code (Copilot/Continue):
- Extension installation
- Continue configuration
- Usage examples
Quick Start: IMPLEMENTATION_QUICK_START.md
- Day-by-day implementation guide
- 30-day roadmap
- Quick commands
- Troubleshooting
Baseline (without OmniMemory):
- 50 files sent to API
- 1,200 tokens per file
- Total: 60,000 tokens
- Cost: $0.90 per query
With OmniMemory:
- Semantic search finds 3 relevant files (local, free)
- Cache skips 2 already sent (local, free)
- Compress 1 file (optional)
- Total: 900 tokens
- Cost: $0.014 per query
Savings: 98.5% tokens, $0.886 per query
| Metric | Target | How Measured |
|---|---|---|
| API Cost Reduction | 85%+ | (baseline_tokens - actual_tokens) / baseline_tokens |
| Session Restoration | <2s | Time from import to context ready |
| Cache Hit Rate (L1) | >60% | Hits / (Hits + Misses) |
| Cache Hit Rate (L2) | >30% | Hits / (Hits + Misses) |
| Search Accuracy | >90% | Relevant results / Total results |
| Tool Adoption | 3+ tools | Number of integrated AI tools |
- Tool-agnostic server
- MCP resources & prompts
- Test coverage 80%+
- Database schema v2
- 8 memory tools
- Semantic indexing
- Memory Passport export/import
- Cross-tool migration
- Migration <2s
- API keys
- Scope enforcement
- Rate limiting
- 3 integration guides
- API documentation
- Example projects
Total: 6 weeks to production
| Risk | Severity | Mitigation |
|---|---|---|
| Breaking changes to existing users | High | Maintain backwards compatibility, versioned API |
| Session migration failures | Medium | Validate signatures, fallback to JSON format |
| Performance degradation | Low | Benchmark each phase, optimize hot paths |
| Security vulnerabilities | High | Penetration testing, scope validation, audit logs |
| Tool-specific edge cases | Medium | Extensive testing per tool, community feedback |
Implementation is successful when:
-
✅ Functionality:
- 25+ tools working across 3+ AI tools
- 5 resources accessible
- 8 prompts available
- Memory Passport migration <2s
-
✅ Performance:
- 85%+ API cost reduction maintained
- >60% L1 cache hit rate
- >90% search accuracy
- <500ms search latency
-
✅ Quality:
- 80%+ test coverage
- Zero critical security issues
- All integration guides tested
- Documentation complete
-
✅ Adoption:
- 3+ AI tools integrated
- 10+ active users
- Positive community feedback
-
Review Architecture
- Team review of
MCP_INTEGRATION_ARCHITECTURE.md - Validate against requirements
- Approve implementation plan
- Team review of
-
Set Up Development
- Create feature branch
feature/universal-mcp - Set up test environment
- Configure CI/CD
- Create feature branch
-
Start Phase 1
- Implement tool adapters
- Create test suite
- Daily standups
-
Complete Core Refactoring
- Tool adapters working
- Resources implemented
- Prompts implemented
- Tests passing
-
Begin Memory Operations
- Database migrations
- Memory tools
- Semantic indexing
-
Complete All Phases
- Full implementation
- Security hardening
- Integration guides
-
Beta Testing
- Internal testing
- Community beta
- Bug fixes
-
Production Release
- Version 2.0 launch
- Documentation site
- Community announcement
All architecture documents in this repository:
-
MCP_INTEGRATION_ARCHITECTURE.md(Main)- Comprehensive 15-section specification
- ~50 pages
- Complete technical design
-
IMPLEMENTATION_QUICK_START.md- Day-by-day implementation guide
- 30-day roadmap
- Quick commands
-
mcp_server/omnimemory_universal_mcp_sample.py- Reference implementation (~800 lines)
- Key patterns and examples
- Production-ready code samples
-
mcp_server/MCP_TOOLS_OPENAPI.yaml- OpenAPI 3.1 specification
- Machine-readable API spec
- Request/response schemas
-
MCP_ARCHITECTURE_SUMMARY.md(This Document)- Executive summary
- Deliverables checklist
- Quick reference
- Architecture: Review
MCP_INTEGRATION_ARCHITECTURE.md - Implementation: Review
IMPLEMENTATION_QUICK_START.md - API Spec: Review
MCP_TOOLS_OPENAPI.yaml - Code Examples: Review
omnimemory_universal_mcp_sample.py
- GitHub Issues: Technical issues and bugs
- GitHub Discussions: Design questions and proposals
- Team Chat: Daily development questions
This architecture provides a complete, production-ready design for transforming OmniMemory into a universal memory layer for AI tools.
Key Achievements:
- ✅ All 8 deliverables completed
- ✅ 6-week implementation roadmap
- ✅ Cross-tool compatibility (Claude, Cursor, Copilot, VS Code)
- ✅ Memory Passport for session portability
- ✅ 85-98% API cost savings maintained
- ✅ Production-ready security model
- ✅ Comprehensive test strategy
Ready for Implementation: Yes Estimated Timeline: 6 weeks Team Size Recommended: 2-3 developers
Document Version: 1.0 Last Updated: December 4, 2025 Status: ✅ Complete and Ready for Review Maintainers: OmniMemory Core Team