
Cozo Memory
io.github.tobs-code由 GitHub 帳號 tobs-code 發布v1.0.3更新於 Oct 24, 2026
Local-first memory system for AI agents with hybrid search and graph reasoning
發布方自己的服務:Memory.fit
概覽
本地優先的記憶伺服器,為 AI 助理提供以 CozoDB 為基礎的持久記憶,支援向量、全文與圖形混合檢索及歷史回溯。
- 可以做什麼
- 寫入與管理記憶:建立、更新、刪除實體、觀察、關係、工作階段和任務,支援標籤與批次操作,並可編輯全域使用者偏好設定。讀取與檢索:混合搜尋、進階搜尋、脈絡查詢、Graph-RAG 與圖形走訪、自適應與智慧檢索,以及列出實體和工作階段。分析知識圖形:探索、社群、PageRank、中介性、HITS、最短路徑和語意走訪。維護系統:健康檢查、指標、統計、匯出、匯入、清理、重組、反思和快照。選用的 Ollama 操作提供 LLM 清理、反思、社群摘要、壓縮和查詢意圖路由。
- 適用情境
- 適合需要助理跨工作階段記住過往對話與事實,並依據其間關係進行推理,而非只做一般文件 RAG 的情境。也適合希望記憶完全保存在本機、具版本歷史與矛盾處理的使用者。
- 執行需求
- 以 npm 套件 cozo-memory 透過 npx 或全域安裝,在本機以 stdio 執行;建議 Node.js 20 以上。預設嵌入模型約需 1.7 GB 記憶體,首次啟動下載約 600 MB;可透過 EMBEDDING_MODEL 變數選擇更輕量的模型。進階操作需要本機 Ollama 服務,核心新增、讀取、更新、刪除、搜尋和圖形操作不需要。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Cozo Memory,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
CozoDB Memory MCP Server
[npm] [Node] [License] [MCP Badge]
Why Cozo Memory?
LLMs have short-term memory limits. Standard RAG retrieves documents but can't connect facts across time. Cozo Memory gives your AI agent persistent, structured memory – it remembers past conversations, infers relationships, detects contradictions, and explores its knowledge graph – fully on your machine, with optional local LLM integration via Ollama for intelligent actions (cleanup, reflection, summarization, agentic routing).Most memory stacks combine separate databases: SQLite for facts, Chroma for vector search, NetworkX for graphs. CozoDB replaces all of that with one embedded engine: relational, graph, vector, and full-text search in a single query language, one file, zero sync lag.
Local-first memory for Claude & AI agents with hybrid search, Graph-RAG, and time-travel – runs entirely on your machine. Optional Ollama integration enables LLM-powered actions (cleanup, reflect, summarize, agentic retrieval).
Table of Contents
- Quick Start
- Key Features
- Positioning & Comparison
- Installation
- Integration
- Documentation
- Troubleshooting
Quick Start
Option 1: Install via npm (Recommended)
Option 2: Build from Source
Now add the server to your MCP client (e.g. Claude Desktop) – see Integration below.
Key Features
🔍 Hybrid Search - Combines semantic (HNSW), full-text (FTS), and graph signals via Reciprocal Rank Fusion for intelligent retrieval
🧠 Agentic Retrieval - Auto-routing engine analyzes query intent via local LLM to select optimal search strategy (Vector, Graph, or Community)
⏱️ Time-Travel Queries - Version all changes via CozoDB Validity; query any point in history with full audit trails
🎯 GraphRAG-R1-Inspired Adaptive Retrieval - Intelligent system with Progressive Retrieval Attenuation (PRA) and Cost-Aware F1 (CAF) scoring, conceptually inspired by GraphRAG-R1 (Yu et al., WWW 2026) and adapted for CozoDB, that learns from usage
⏳ Temporal Conflict Resolution - Automatic detection and resolution of contradictory observations with semantic analysis and audit preservation
🏠 100% Local - Embeddings via ONNX/Transformers; data stays on your machine. Some advanced features (cleanup, reflect, summarize, agentic search) require an optional Ollama service for local LLM inference — but the core search, CRUD, and graph operations work without any LLM.
🧠 Multi-Hop Reasoning - Logic-aware graph traversal with vector pivots for deep relational reasoning
🗂️ Hierarchical Memory - Multi-level architecture (L0-L3) with intelligent compression and LLM-backed summarization
Positioning & Comparison
Why CozoDB instead of SQLite + Chroma + NetworkX?
A common first question is: "Why not just combine existing tools?"
The core insight: Most memory stacks bolt vector search onto a graph DB, or graph search onto a vector DB. CozoDB is different: it is a single engine that natively combines relational, graph, vector, and full-text search. That means:
- One query language (Datalog) reaches every dimension.
- No sync lag between separate indexes.
- No ETL bridge between "vector results" and "graph expansion."
- Smaller operational surface: one database file, one process, one dependency chain.
Comparison with other memory solutions
Most "Memory" MCP servers fall into two categories:
- Simple Knowledge Graphs: CRUD operations on triples, often only text search
- Pure Vector Stores: Semantic search (RAG), but little understanding of complex relationships
This server fills the gap in between ("Sweet Spot"): A local, database-backed memory engine combining vector, graph, and keyword signals — powered by CozoDB's unified engine rather than a patchwork of separate databases.
The core advantage is Intelligence and Traceability: By combining an Agentic Retrieval Layer with Hierarchical GraphRAG, the system can answer both specific factual questions and broad thematic queries with much higher accuracy than pure vector stores.
Installation
Prerequisites
- Node.js 20+ (recommended)
- RAM: 1.7 GB minimum (for default bge-m3 model)
- Model download: ~600 MB
- Runtime memory: ~1.1 GB
- ⚡ Too heavy? Use
EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2– only ~400 MB RAM needed (see Embedding Model Options)
- CozoDB native dependency is installed via
cozo-node
Optional: Ollama for LLM-powered actions
Some advanced actions use a local LLM via Ollama for intelligent processing. The core server works without Ollama (CRUD, search, graph operations), but the following actions require it:
Setup (if you need these features):
If Ollama is not running, the affected actions gracefully fall back to non-LLM behavior (where possible) or return a clear error message.
Via npm (Easiest)
From Source
Windows Quickstart
Notes:
- On first start,
@xenova/transformersdownloads the embedding model (may take time) - Embeddings are processed on the CPU
Embedding Model Options
CozoDB Memory supports multiple embedding models via the EMBEDDING_MODEL environment variable:
Configuration Options:
Option 1: Using .env file (Easiest for beginners)
Option 2: MCP Server Config (For Claude Desktop / Kiro)
Option 3: Command Line
Download Model First (Recommended):
Note: Changing models requires re-embedding existing data. The model is downloaded once on first use.
Integration
Claude Desktop
Using npx (Recommended)
Using global installation
Using local build
Framework Adapters
Official adapters for seamless integration with popular AI frameworks:
🦜 LangChain Adapter
🦙 LlamaIndex Adapter
Documentation: See adapters/README.md for complete examples and API reference.
CLI & TUI
CLI Tool
Full-featured CLI for all operations:
See CLI help for complete command reference:
cozo-memory --help
TUI (Terminal User Interface)
Interactive TUI with mouse support powered by Python Textual:
TUI Features:
- 🖱️ Full mouse support (click buttons, scroll, select inputs)
- ⌨️ Keyboard shortcuts (q=quit, h=help, r=refresh)
- 📊 Interactive menus for all operations
- 🎨 Rich terminal UI with colors and animations
Architecture Overview
See docs/ARCHITECTURE.md for detailed architecture documentation
MCP Tools Overview
The interface is reduced to 5 consolidated tools:
See docs/API.md for complete API reference with all parameters and examples
Troubleshooting
Common Issues
First Start Takes Long
- The embedding model download takes 30-90 seconds on first start (Transformers loads ~500MB of artifacts)
- This is normal and only happens once
- Subsequent starts are fast (< 2 seconds)
LLM-powered actions require Ollama
- The following actions use a local LLM for intelligent processing:
cleanup,reflect,summarize_communities,compact,agentic_search - Install Ollama from https://ollama.ai
- Pull the desired model:
ollama pull demyagent-4b-i1:Q6_K(or your preferred model) - Without Ollama, these actions fall back to non-LLM behavior or return a clear error
- Core features (CRUD, search, graph, infer) work without any LLM
Windows-Specific
- Embeddings are processed on CPU for maximum compatibility
- RocksDB backend requires Visual C++ Redistributable if using that option
Performance Issues
- First query after restart is slower (cold cache)
- Use
healthaction to check cache hit rates - Consider RocksDB backend for datasets > 100k entities
See docs/BENCHMARKS.md for performance optimization tips
Documentation
- docs/API.md - Complete MCP tools reference with all parameters and examples
- docs/ARCHITECTURE.md - System architecture, data model, and technical details
- docs/BENCHMARKS.md - Performance metrics, evaluation results, and optimization tips
- docs/FEATURES.md - Detailed feature documentation with usage examples
- docs/USER-PROFILING.md - User preference profiling and personalization
- CHANGELOG.md - Version history and release notes
- CONTRIBUTING.md - Development guidelines
Development
Structure
src/index.ts: MCP Server + Tool Registrationsrc/memory-service.ts: Core business logicsrc/db-service.ts: Database operationssrc/embedding-service.ts: Embedding Pipeline + Cachesrc/hybrid-search.ts: Search Strategies + RRFsrc/inference-engine.ts: Inference Strategiessrc/api_bridge.ts: Express API Bridge (optional)
Scripts
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
Apache 2.0 - See LICENSE for details.
Acknowledgments
Built with:
- CozoDB - Embedded graph database
- ONNX Runtime - Local embedding generation
- Transformers.js - Xenova/bge-m3 model
- FastMCP - MCP server framework
Research foundations:
- GraphRAG-R1 (Yu et al., WWW 2026) - conceptual inspiration for adaptive retrieval
- HopRAG (ACL 2025) - conceptual inspiration for multi-hop reasoning
- T-GRAG (Li et al., 2025) - conceptual inspiration for temporal conflict resolution
- FEEG Framework (Samuel et al., 2026) - conceptual inspiration for query intent classification
- Allan-Poe (arXiv:2511.00855) - conceptual inspiration for dynamic fusion
來源:README.md,提交 341cd38
工具
0版本歷史
1- v1.0.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Memory 整合

Memory.fit
fit.memory官方發布者
託管式 Memory.fit 伺服器,讓 AI 讀取你的訓練、睡眠、恢復與飲食資料,並寫回每週計畫、每日目標和飲食計畫。
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pg官方發布者
pg.ddx.io: the PostgreSQL community's memory 的託管 MCP 服務,由 pg.ddx.io 發布;無需登入;Streamable HTTP;29 個工具。
var.gg Naming Memory
gg.var官方發布者
遠端 MCP 伺服器,可依領域概念推薦並檢索韓、日、中、越、英多語言的程式識別字名稱,並提供 ERD 結構查詢。

Counterparts
ai.counterparts
為 Claude Code 與 Claude Desktop 提供的本地優先長期記憶:助理自行寫下關於你與專案的筆記,並在之後的對話中回想起來。

LAHZE - Persian AI Memory Platform
由 GitHub 帳號 pedramgholizadeh 發布
以波斯語為先的地理記憶平臺:發現地點,起草併發布僅限波斯語的記憶。AI 翻譯