# cozo-memory [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/tobs-code/cozo-memory  
**GitHub Stars:** 1  
**npm Downloads (last month):** 206  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/cozo-memory

## Description
Local-first memory system for AI agents with hybrid search and graph reasoning

## Tools
Capabilities this server exposes over MCP:

- **mutate_memory** — Write operations
- **query_memory** — Read operations
- **analyze_graph** — Graph analysis
- **manage_system** — Maintenance
- **edit_user_profile** — User preferences

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "cozo-memory": {
    "command": "npx",
    "args": ["-y","cozo-memory"],
    "env": {
      "EMBEDDING_MODEL": ""
    }
  }
}
```

**Requires environment variables:** `EMBEDDING_MODEL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the cozo-memory MCP server does

The cozo-memory MCP server gives MCP-compatible agents a local memory layer built on CozoDB. It is designed to retain information across conversations rather than treating each interaction as isolated context. CozoDB provides relational storage, graph traversal, vector search, and full-text search in one embedded database file.

The system supports hybrid retrieval using semantic, keyword, and graph signals. It also stores validity information so applications can inspect memory as it existed at an earlier point in time. Graph-oriented functions support relationship exploration, multi-hop reasoning, and analysis such as PageRank. The project also describes hierarchical memory levels and community summaries for organizing larger collections of observations.

## How it works

The cozo-memory MCP server runs locally as a Node.js process and communicates with an MCP client over its standard server interface. CozoDB acts as the single persistence and query layer instead of combining separate vector, graph, and relational services. Embeddings are generated locally with ONNX and Transformers models, and processing occurs on the CPU.

Retrieval can combine HNSW vector search, full-text search, and graph results through reciprocal rank fusion. An agentic retrieval mode can classify query intent and select among vector, graph, or community-oriented strategies, but that mode depends on a local LLM. Time-aware records use CozoDB validity data to preserve change history and support historical queries.

## Setup and configuration

Install the package globally with `npm install -g cozo-memory`, or run it without a global installation using `npx cozo-memory`. Building from source requires cloning the repository, running `npm install`, then `npm run build` and `npm run start`. Node.js 20 or newer is recommended.

On first launch, the default embedding model may download approximately 600 MB and the default configuration needs about 1.7 GB of RAM. Set `EMBEDDING_MODEL=Xenova/all-MiniLM-L6-v2` for a lower-memory option, listed at roughly 400 MB of RAM. `Xenova/bge-small-en-v1.5` is another supported option.

Ollama is optional. Install it and pull a model such as `demyagent-4b-i1:Q6_K` when you need LLM-assisted cleanup, reflection, community summarization, compaction, or agentic search. Without Ollama, core storage, search, and graph functions remain available; affected advanced actions either fall back where possible or report an error.

## Tools and capabilities

The MCP tool groups expose these operations:

- `mutate_memory` for write operations.
- `query_memory` for read and retrieval operations.
- `analyze_graph` for graph analysis.
- `manage_system` for maintenance tasks.
- `edit_user_profile` for user preference updates.

Together, these tools cover persistent observations, hybrid retrieval, graph exploration, profile data, maintenance, and historical inspection. The cozo-memory MCP server also supports contradiction handling, LLM-backed reflection, hierarchical compression, and community summarization when the relevant features and local model services are available.

## Limitations and notes

Embedding models are downloaded on demand and can require substantial memory, especially the default `Xenova/bge-m3` configuration. Embeddings run on the CPU according to the setup notes. Ollama-dependent actions are not part of the server’s offline core and require a separately installed local service.

Data is intended to remain on the local machine, with CozoDB and the embedding model running locally.

_Full upstream README: https://allmcps.com/mcp/cozo-memory/readme_

