CML v3
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CML v3 — Cognitive Memory Layer for LLM Agents
A production-ready MCP memory server that productionizes the mathematical foundations introduced in SLM-V3 (Bhardwaj, 2026), delivering them with a novel Memory Feed presentation format and comprehensive benchmark evaluation.
CML v3 builds on three mathematical frameworks from SLM-V3:
Fisher-Rao geodesic distance for embedding similarity (replacing cosine similarity)
Sheaf cohomology for topical coherence detection
Langevin dynamics on Poincare ball for memory lifecycle (natural reinforcement and forgetting)
Features
4-channel retrieval: Semantic + BM25 + Entity Graph + Temporal, fused with Reciprocal Rank Fusion
Memory Feed: SNS-inspired presentation with trajectory tracking, causal chains, and retrieval reasons
Bayesian trust scoring: Beta distribution (alpha/beta) for memory reliability
Fully local: SQLite storage, no cloud dependencies required
MCP protocol: Works with Claude Code, Claude Desktop, and any MCP-compatible client
Related MCP server: OwnMemory
Quick Start
Install
pip install cml-v3
# For Gemini embeddings (recommended, requires API key):
pip install cml-v3[gemini]
# For fully offline operation (sentence-transformers):
pip install cml-v3[local]
# Everything:
pip install cml-v3[all]Run the MCP Server
# With Gemini embeddings (set API key first):
export GEMINI_API_KEY="your-key-here"
cml-v3-server
# With local embeddings (no API key needed):
CML_V3_EMBEDDING_PROVIDER=local cml-v3-serverConfigure in Claude Code
Add to ~/.claude/settings.json:
{
"mcpServers": {
"cml-v3-memory": {
"command": "cml-v3-server",
"env": {
"GEMINI_API_KEY": "your-key-here"
}
}
}
}Configure in Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"cml-v3-memory": {
"command": "python",
"args": ["-m", "cml_v3.server"],
"env": {
"GEMINI_API_KEY": "your-key-here"
}
}
}
}MCP Tools
CML v3 provides 4 consolidated tools (optimized for minimal context token usage):
memory_search
Search long-term memory with multi-channel retrieval.
Action | Description |
| Multi-channel search with Memory Feed format |
| Session-start briefing (formatted context) |
| Deep search with entity graph expansion |
| Chronological memory listing |
memory_store
Write to long-term memory with contradiction detection.
Action | Description |
| Save new fact (auto-embeds, checks contradictions) |
| Strengthen existing memory (trust alpha += 1) |
| Archive a memory (move to ARCHIVED zone) |
memory_manage
Memory system administration.
Action | Description |
| Zone/project statistics |
| List detected contradictions |
| Explore entity knowledge graph |
memory_system
Infrastructure health and configuration.
Action | Description |
| Component status check |
| Run Langevin dynamics evolution step |
| View/update configuration |
Memory Feed Format
Search results are returned as enriched feeds (not flat lists):
{
"id": "sm-abc123",
"content": "The project deadline was moved to April.",
"trajectory": "strengthening",
"confidence_rank": "high",
"trust_score": 0.85,
"shared_entities": ["Project X", "April deadline"],
"related_to": ["sm-def456", "sm-ghi789"],
"thread": [{"from": "sm-def456", "type": "led_to"}],
"retrieval_reason": "semantic similarity + entity(Project X)",
"contradictions": []
}Mathematical Foundations
The following mathematical modules are ported from SLM-V3 (MIT License).
Fisher-Rao Geodesic Distance
Instead of cosine similarity, CML v3 uses the Fisher-Rao geodesic distance on diagonal Gaussian manifolds, respecting per-dimension confidence:
$$d_{FR}(\mathbf{u}, \mathbf{v}) = \sqrt{\sum_i \frac{(u_i - v_i)^2}{\frac{1}{2}(\sigma_{u,i}^2 + \sigma_{v,i}^2)}}$$
Sheaf Cohomology for Topical Coherence
Memories connected by shared entities form a cellular sheaf. The coboundary operator detects topical anomalies with mathematical guarantees (note: effective for topical coherence, not factual contradiction — see our paper for details):
$$(\delta_0 \mathbf{x})(e_{uv}) = \mathcal{F}_{u \trianglelefteq e}(\mathbf{x}u) - \mathcal{F}{v \trianglelefteq e}(\mathbf{x}_v)$$
Langevin Dynamics on Poincare Ball
Memory lifecycle is modeled as a stochastic process on the Poincare ball, where the origin represents high importance and the boundary represents forgetting:
Zone | Radius | Semantics |
ACTIVE | [0, 0.3) | Core memories |
WARM | [0.3, 0.55) | Recently relevant |
COLD | [0.55, 0.8) | Fading |
ARCHIVED | [0.8, 1.0) | Effectively forgotten |
Data Storage
All data is stored locally in ~/.cml-v3/memory.db (SQLite). Override with:
export CML_V3_DATA_DIR=/path/to/custom/dirDevelopment
git clone https://github.com/Haratakeshi/cml-v3.git
cd cml-v3
pip install -e ".[dev,all]"
pytest tests/Citation
If you use CML v3 in your research, please cite:
@article{fujiwara2026cmlv3,
title={Memory Feed: Productionizing Mathematical Memory Foundations
for LLM Agents via MCP},
author={Fujiwara, Takeshi},
journal={arXiv preprint},
year={2026}
}License
MIT License. See LICENSE.
Acknowledgments
The mathematical foundations (Fisher-Rao distance, sheaf cohomology, Langevin dynamics on Poincare ball) are ported from SLM-V3 by Varun Pratap Bhardwaj under the MIT license. We thank the author for releasing these foundational models.
CML v3 was co-developed with Claude (Anthropic).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Persistent memory and knowledge graphs for AI agents. Hybrid search, context checkpoints, and more.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to persist facts with tags, sources, and importance in a local SQLite database, retrieve them through hybrid BM25 plus embedding search weighted by retention decay, link or supersede related entries, and review everything in a read-only visual dashboard showing the memory graph and timeline.6MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to save, recall, and forget persistent memories stored entirely on the local machine in SQLite, using hybrid semantic and keyword search with on-device embeddings, plus spaces and profile context injection.MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to retain atomic facts, decisions, and episodic lessons in a persistent shared SQLite graph memory, then recall them through hybrid BM25 plus dense-vector search with spreading activation and progressively packed context. Also supports reflection-based belief revision so stale or contradictory memories are superseded rather than returned alongside current ones.418 PyPIMIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to persist, search, and consolidate durable cross-session memory through a dual-vault SQLite/FTS5 store with hybrid reranking, retrieval gating, temporal relations, and Markdown wiki projection.MIT