Skip to content

Mnemoverse 0.1Architecture Documentation

Build persistent memory systems that remember, learn, and coordinate like experienced developers.

Agent‑ready documentation ​

We design these docs to be useful for both humans and machines. Pages carry predictable metadata (frontmatter), stable IDs, and consistent section ordering. This enables automated indexing, MCP doc servers, and agent navigation.

πŸš€ Start here ​

🧭 How this doc set is organized ​

Top‑level directories under /architecture:

  • adapters/ β€” HTTP & MCP adapters, examples, compatibility matrix
  • contracts/ β€” canonical contracts and schemas across layers
  • evaluation/ β€” benchmarks and metrics
  • experience-layer/ β€” L4 specifications and guides
  • memory-layer/ β€” L5 policies, errors/timeouts, assembler
  • noosphere-layer/ β€” L1 architecture (vector/graph search, KG, MCP integration)
  • orchestration/ β€” ACS/CEO/HCS specs, API, implementation notes
  • project-library/ β€” L2 models, indexing and operations
  • workshop/ β€” L3 interfaces, tool registry, validation pipelines

Each directory has its own README.md acting as a local index when present.

🧩 Layers & components ​

πŸ”Œ Machine interface (MCP) ​

This documentation is served by our @mcp-x/mcp-docs-server which provides these tools:

  • list_documents β€” List all available docs, optionally filtered by section
  • get_document β€” Get full content of a specific document by path
  • search_docs β€” Full-text search through all documentation

Real MCP configuration:

json
{
  "name": "@mcp-x/mcp-docs-server",
  "version": "1.0.0", 
  "description": "Universal MCP Server Demo - Template for documentation-based MCP servers",
  "tools": ["list_documents", "get_document", "search_docs"],
  "sections": ["guides", "api", "tutorials", "reference", "examples"],
  "capabilities": {
    "search": {
      "maxResults": 50,
      "fuzzyThreshold": 0.6
    }
  }
}

Configure MCP access to this documentation ​

πŸ“– Principles (human + machine) ​

  • Stable IDs and links: each key doc has an id and predictable path
  • Consistent frontmatter: docType, version, status, audience, tags
  • Canonical anchors: Overview (concepts), Contracts Registry (interfaces)
  • Deterministic navigation: auto‑generated sidebar mirrors filesystem
  • Clear degradation: drafts labeled; missing pages tolerated in soft link checks

Conventions ​

  • Version: this set documents the 0.1 line; drafts are clearly marked
  • Ordering: pages may use order: in frontmatter or numeric filename prefixes
  • Acronyms: normalized (API, ACS, CEO, HCS, MCP, SLO/SLA, L1–L8, KV, ADR)
  • Privacy: never include raw sensitive text; secure fields must be bypassed

πŸ—οΈ System Architecture ​

Core Components & Technology Stack ​

Layer Technologies:

  • L1 (Noosphere): Vector databases (Pinecone/Weaviate), Graph databases (Neo4j), Python/TypeScript
  • L2 (Project Library): Document indexing (Elasticsearch), Git integration, Node.js
  • L3 (Workshop): Tool orchestration, Docker containers, Kubernetes
  • L4 (Experience): Time-series databases (InfluxDB), Event streaming (Kafka)
  • L5 (Memory): Redis caching, Memory-optimized instances, Smart eviction
  • L8 (Evaluation): Metrics collection (Prometheus), Jupyter notebooks, Python

Infrastructure Requirements:

  • Compute: 16+ vCPUs, 64+ GB RAM per layer for production
  • Storage: 1TB+ SSD for L1/L2, 100GB+ for other layers
  • Network: 10Gbps+ for inter-layer communication, CDN for static content

Data Flow Architecture ​

Request Lifecycle:

  1. Query Ingestion (L7) β†’ MCP protocol normalization
  2. Intent Processing (L6) β†’ Budget allocation, risk assessment
  3. Context Assembly (L5) β†’ Multi-layer content aggregation
  4. Knowledge Retrieval (L1/L2/L4) β†’ Parallel provider execution
  5. Response Generation (L5β†’L6β†’L7) β†’ Budget-constrained assembly
  6. Quality Monitoring (L8) β†’ Continuous feedback loops

πŸ§ͺ Testing & Validation ​

Testing Strategy ​

Unit Testing Guidelines:

  • Coverage Target: 90%+ for core algorithms, 80%+ for integration layers
  • Frameworks: Jest (TypeScript), pytest (Python), Go test (Go services)
  • Focus Areas: Context assembly logic, budget enforcement, provider selection

Integration Testing:

  • Inter-layer Communication: Test L1↔L2↔L5 data flows end-to-end
  • Provider Integration: Mock external services, validate contract compliance
  • Performance Testing: Load testing with realistic query patterns
  • Error Scenarios: Network partitions, service degradation, timeout handling

End-to-End Testing:

  • Critical User Journeys: Debug session walkthrough, research query flow
  • Cross-platform: VS Code extension, CLI tools, web interface
  • Performance Benchmarks: P95 < 800ms end-to-end, throughput > 100 QPS

Quality Gates ​

Pre-deployment Validation:

bash
# Performance benchmarks
npm run test:performance -- --target-p95=800ms

# Security scanning
npm run test:security -- --mode=privacy-compliance

# Integration validation
npm run test:integration -- --layers=L1,L2,L5,L8

# Documentation coverage
npm run docs:validate -- --coverage-min=95%

Acceptance Criteria:

  • Quality metrics: NDCG@10 β‰₯ 0.60, Precision@5 β‰₯ 0.50
  • Performance: P95 ≀ 800ms, error rate < 1%
  • Privacy: Zero leakage in block mode, effective redaction

πŸ”§ Development & Operations ​

Development Environment Setup ​

Prerequisites:

bash
# Required tools
node >= 18.0.0
python >= 3.9
docker >= 24.0
kubernetes >= 1.28

# Development dependencies
npm install -g @mnemoverse/cli
pip install mnemoverse-dev-tools

Local Development Stack:

yaml
# docker-compose.dev.yml
version: '3.8'
services:
  redis:
    image: redis:7-alpine
    ports: ["6379:6379"]
  
  postgres:
    image: postgres:15
    environment:
      POSTGRES_DB: mnemoverse_dev
      POSTGRES_PASSWORD: dev_password
    ports: ["5432:5432"]
  
  vector-db:
    image: pinecone/pinecone-local:latest
    ports: ["8080:8080"]

Deployment Architecture ​

Production Environment:

  • Staging: Feature validation, integration testing
  • Production: Blue-green deployment, gradual rollout
  • DR Environment: Cross-region backup, RTO < 1 hour

CI/CD Pipeline:

yaml
# .github/workflows/deploy.yml
stages:
  - test: [unit, integration, e2e]
  - security: [dependency-scan, secret-scan, privacy-validation]
  - build: [docker-build, artifact-registry]
  - deploy: [staging, production-canary, production-full]

Operational Scenarios ​

Scaling Procedures:

  1. Horizontal Scaling: Add provider instances behind load balancer
  2. Vertical Scaling: Increase memory/CPU for memory-intensive L5 operations
  3. Data Scaling: Shard knowledge base by domain/project boundaries

Maintenance Windows:

  • Weekly: Dependency updates, security patches (30min maintenance window)
  • Monthly: Performance optimization, capacity planning (2hr maintenance window)
  • Quarterly: Major version upgrades, architectural improvements (4hr maintenance window)

Disaster Recovery:

  • Backup Strategy: Daily snapshots, cross-region replication
  • Recovery Procedures: Automated failover, manual validation steps
  • RTO Target: < 1 hour for critical services, < 4 hours for full restoration

πŸ“Š Performance & Monitoring ​

Key Metrics ​

System Performance:

  • Latency: P50/P95/P99 response times per layer
  • Throughput: Queries per second, concurrent user capacity
  • Availability: 99.9% uptime target, planned maintenance exclusions

Quality Metrics:

  • Search Quality: NDCG@K scores, user satisfaction ratings
  • Context Relevance: Fragment usefulness, contradiction rates
  • Learning Effectiveness: Experience pattern accuracy, improvement trends

Resource Utilization:

txt
# Example monitoring queries
mnemoverse_memory_usage_ratio{layer="L5"} > 0.85
mnemoverse_query_latency_p95{layer="orchestration"} > 800
mnemoverse_error_rate{service="context-assembly"} > 0.01

Alerting & Escalation ​

Critical Alerts (PagerDuty integration):

  • Service unavailability > 5 minutes
  • Error rate > 5% for > 2 minutes
  • P95 latency > 1.5s for > 5 minutes

Warning Alerts (Slack integration):

  • Memory usage > 85%
  • Quality metrics below baseline
  • Unusual traffic patterns

Status ​

Work in progress. Some deep‑dive drafts live under /architecture/orchestration and may reference upcoming pages. The Overview and Contracts Registry are the canonical sources to align on first.

🀝 Contribute ​

  • Keep frontmatter flat where possible (simple key: value) for robust tooling
  • Prefer stable slugs; avoid renames without adding redirects
  • Add order: to control sibling ordering when needed
  • Use short, descriptive titles; keep acronyms normalized