CAI is a modular framework combining:
- Vector database (LanceDB, 768-dim
nomic-embed-textembeddings) - Filesystem archive (Mycelium graph, branching 0.85/mutation 0.15)
- MCP server ecosystem (5 servers: memory, filesystem, orchestration, messaging)
- Batch consolidation (scheduled pattern extraction and tool generation)
- 4-layer storage hierarchy (global > vector > filesystem > workspace)
The system provides persistent cross-session storage, automatic context loading on workspace open, and scheduled pattern analysis.
┌─────────────────────────────────────────────────────────────┐
│ CAI System │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Storage Hierarchy │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────┐ │ │
│ │ │ GLOBAL │ │ VECTOR │ │ FILESYSTEM│ WORKSPACE│ │ │
│ │ │ config │ │ LanceDB │ │ Mycelium │ │ .clin. │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ MCP Servers │ │
│ │ ┌────────────┐ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ NeuralMem │ │ MyceliumHuman│ │ Orchestrator │ │ │
│ │ │ (LanceDB) │ │ (Markdown FS)│ │ (Watchdog) │ │ │
│ │ └────────────┘ └──────────────┘ └──────────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Batch Consolidation Pipeline │ │
│ │ ┌────────┐ ┌────────┐ ┌──────────┐ ┌────────────┐ │ │
│ │ │ Ingest │→│Analyze │→│ Generate │→│ Deploy │ │ │
│ │ │ (100 │ │(Pattern│ │ (FastMCP │ │ (Dynamic │ │ │
│ │ │entries)│ │Detect) │ │ Tool) │ │ Skills) │ │ │
│ │ └────────┘ └────────┘ └──────────┘ └────────────┘ │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
| Component | Stack | Description |
|---|---|---|
| Vector Store | LanceDB + nomic-embed-text |
768-dim persistent storage with semantic search |
| File Archive | Mycelium graph | Branching filesystem (factor 0.85) with mutation (factor 0.15) |
| Bridge | memory_bridge.py |
Unified read/write across all storage layers |
| Auto-Load | recall() on init |
Hydrates context from vector store on workspace open |
| Hierarchy | 4 layers | Config > Vector > Filesystem > Workspace |
| Server | Function |
|---|---|
NeuralMemory |
Vector database CRUD, semantic search |
MyceliumHumanized |
Markdown-format filesystem operations |
Orchestrator |
Server lifecycle management, hot-reload watchdog |
ThreemaGateway |
Message relay via Threema API |
| Stage | Details |
|---|---|
| Schedule | Daily via Windows Task Scheduler |
| Input | Last 100 LanceDB entries |
| Analysis | Pattern detection via qwen2.5-coder:32b |
| Output | FastMCP tool for repetitive workflows |
| Deploy | %LOCALAPPDATA%\mcp-dynamic-skills hot-reload |
python --version # 3.10+
ollama pull nomic-embed-text # embeddings model
ollama pull qwen2.5-coder:32b # analysis modelgit clone https://github.com/piot5/CAI.git
cd CAI
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
pip install -r requirements.txtCAI/
├── .clinerules # Global configuration (4-layer hierarchy)
├── mcp.json # MCP server registration
├── memory/ # Core storage and MCP servers
│ ├── mcp_neural_memory.py # LanceDB vector store server
│ ├── mcp_mycelium.py # Mycelium filesystem server
│ ├── mcp_categorizer.py # Auto-categorization MCP
│ ├── mycelium_engine.py # Mycelium filesystem engine
│ ├── memory_bridge.py # Unified 4-layer memory bridge
│ ├── orchestrator.py # MCP server lifecycle manager
│ ├── dream_cycle.py # Batch consolidation pipeline
│ ├── path_config.py # Path resolution
│ ├── validation.py # Input validation
│ ├── categorizer.py # Category engine
│ ├── mcp_status_check.py # Health check utility
│ ├── cai_server.py # Development server
│ ├── global_mcp_manager.py # Global MCP activation
│ ├── autostart/ # Windows autostart components
│ │ └── autostart_orchestrator.py
│ ├── demos/ # Integration demos
│ │ ├── tool_integration_demo.py
│ │ ├── complete_mcp_integration_demo.py
│ │ ├── practical_mcp_usage.py
│ │ └── mcp_learning_demonstration.py
│ ├── tests/ # Test suite (36 tests)
│ │ └── test_mcps_comprehensive.py
│ └── docs/ # Reports and summaries
├── requirements.txt
└── README.md
python -m memory.cai_server # Start all MCP servers
python -m memory.memory_bridge # Storage layer only
python -m memory.orchestrator # MCP server manager
python -m memory.mcp_status_check # Health check
python -m memory.dream_cycle --dry-run # Consolidation dry-runPre-configured in .vscode/:
| File | Contents |
|---|---|
settings.json |
Python (Black, Ruff, isort), Markdown, Git |
extensions.json |
10 recommended extensions |
launch.json |
10 launch configs + 1 compound |
black --line-length=100 memory/
isort --profile black --line-length=100 memory/
ruff check --line-length=100 memory/
mypy memory/python -m memory.tests.test_mcps_comprehensive.py # Full suite (36 tests)
python -m memory.mcp_status_check # Live system check| Component | Tests | Status |
|---|---|---|
| Neural Memory Server | 8 | ✅ |
| Mycelium Server | 4 | ✅ |
| Mycelium Humanized | 6 | ✅ |
| Memory Bridge | 8 | ✅ |
| Dynamic Skills | 4 | ✅ |
| Threema Gateway | 2 | ✅ |
| Orchestrator | 4 | ✅ |
| Total | 36 | ✅ |
Global path (IDE-managed):
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\mcp.json
Local reference: c:\Software\CAI\mcp.json
File: .clinerules (JSON at project root)
- Defines server paths, model names, consolidation schedule
- Scanned on workspace open
- Supports workspace-specific overrides
MIT License - see LICENSE for details.
v1.1.0 · github.com/piot5/CAI