cogito-mem (Cogi)
Local long-term memory for Claude Code that keeps every message word for word
- Pricing
- Free
- Platforms
- macOS, Linux, CLI
- Runs
- Locally
- Version
- 0.3.0
- Listing updated
- 3 days ago
About cogito-mem (Cogi)
cogito-mem (Cogi) is a free MCP server for knowledge and memory. It runs locally on your machine and is started by your AI client.
Cogi, a squirrel mascot, runs alongside Claude Code and stores each exchange in a single SQLite file under ~/.cogito-mem/. Nothing is summarised by an AI: you get back the original wording and the date it was said, which is what lets Claude recover a decision from last month or a detail lost when a long session compacts.
The plugin installs four Claude Code hooks and one MCP server. The hooks save new messages after each reply and add roughly 400 tokens of relevant memories at the start of a session and with each prompt. The MCP server gives Claude three tools for searching, opening and appending memories, served by a small service that listens only on 127.0.0.1:7327. It also records commands run, files touched, sub-agent reports and up to 800 characters of each command's output, with common API key and password formats replaced by [redacted] before saving.
The project reports its own LongMemEval results: on the long test (about 480 sessions, 1.2 million tokens per question) the right session is among the first five results for 93% of 500 questions, with 99% on the short test. The first start downloads a 310 MB embedding model; after that it makes no network calls.
Install
Run in a terminal
claude mcp add cogito-mem -- uvx cogito-memAdd to claude_desktop_config.json
{
"mcpServers": {
"cogito-mem": {
"command": "uvx",
"args": [
"cogito-mem"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"cogito-mem": {
"command": "uvx",
"args": [
"cogito-mem"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"cogito-mem": {
"type": "stdio",
"command": "uvx",
"args": [
"cogito-mem"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"cogito-mem": {
"command": "uvx",
"args": [
"cogito-mem"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"cogito-mem": {
"command": "uvx",
"args": [
"cogito-mem"
]
}
}
}Configuration
COGITO_MEM_NAMESPACEThe memory's name (default: <your username>-hollow).
Tools this server provides (3)
Taken from the project documentation; the running server may differ.
- memory_query
- Searches stored messages and returns the few that matter.
- memory_open
- Opens a stored memory by its id.
- memory_append
- Adds a note to the memory.
What it does
- Word-for-word storage
- Keeps every message and reply with its date instead of an AI summary.
- Automatic saving
- Hooks collect new messages after each answer without any action from you.
- Memory injected per prompt
- Adds about 400 tokens of the most relevant memories to each prompt, each with an id Claude can open.
- Tool activity recall
- Remembers commands run, files touched, sub-agent reports and the key lines of command output.
- Secret redaction
- Replaces common forms of API keys, tokens, private keys and passwords with [redacted] before saving.
- Fully local
- Stores everything in one SQLite file on your machine and needs no account or API key.
Good for
- Recover an exact decision or name from an earlier session after /clear
- Keep context across long sessions that compact
- Look up which commands failed in a past run
- Give Claude Code a private memory with no cloud service
Pricing
Free
Free; no account or API key
Prices change. Check meridian21lab.github.io before you buy.
cogito-mem (Cogi) FAQ
Does my history leave my computer?
No. Messages are stored in ~/.cogito-mem/ on your machine, and after the one-time downloads Cogi makes no network calls.
What does it download on first start?
The cogito-mem package and numpy from PyPI, llama.cpp's llama-server from its GitHub releases (skipped if present) and the 310 MB EmbeddingGemma 2 model from Hugging Face.
Which apps does it work with?
Claude Code in a terminal or IDE gets everything. Codex saves every turn and searches when asked. Claude Desktop chat gets save and search tools without automatic saving. Cloud sessions on claude.ai are not supported yet.
Which operating systems are supported?
macOS and Linux; Windows is described as experimental.
Which MCP tools does it expose?
memory_query, memory_open and memory_append.
Is cogito-mem (Cogi) free?
Yes. cogito-mem (Cogi) is free to use.
How do I add cogito-mem (Cogi) to Claude Code?
Run this command in your terminal: claude mcp add cogito-mem -- uvx cogito-mem
What are the best alternatives to cogito-mem (Cogi)?
The closest alternatives to cogito-mem (Cogi) are Codebase Memory, XERJ, Claude Code Ultimate Guide, Nautilus Compass Memory and note1.
Alternatives to cogito-mem (Cogi)

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Claude Code Ultimate Guide
MCP serverMCP server for searching the Claude Code Ultimate Guide from any MCP client
Runs locally- Open source
- 6.5K GitHub stars
- AI models and LLM tooling

Nautilus Compass Memory
MCP serverLocal-first long-term memory layer for AI agents, served over MCP
Not checked yet- 5 tools
- Remote
- Open source
- 1.3K GitHub stars
- Knowledge and memory

note1
MCP serverMCP server giving AI assistants search and summaries across your note1 meetings
- 4 tools
- Remote
- Free trial
- 1 GitHub star
- Productivity
MedXpert 图书馆连接器(通用版)
MCP serverLocal MCP server that searches and answers questions over your own Markdown wiki
Runs locally- 4 tools
- Open source
- Knowledge and memory