ctxmem
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ctxmemrecall the decision about the database schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ctxmem
Git-native, shareable project memory for AI coding agents — fully local, no cloud.
ctxmem gives your project a permanent, searchable memory that lives inside the
repo. AI agents (and you) store decisions and recall relevant context on demand,
so nothing is forgotten when a chat exceeds the model's context window.
🧠 Remembers — decisions, notes, sessions + your code, in a searchable index.
🔎 Self-checking —
ctxmem asktells the agent whether memory already knows (HIT/WEAK/MISS) before it answers.♻️ Self-correcting — supersede an outdated decision (
--supersedes); recall demotes and flags it (⚠ SUPERSEDED/⚠ STALE).🤝 Shareable — the memory is a text file committed to git. Commit, your colleague pulls, they get your exact context. Branch-aware for free.
📦 Works as a git package —
pip install git+https://…, zero required deps.🔒 Fully local — SQLite files in your repo. No cloud, no API keys, no servers.
🔍 Search modes —
keyword(built-in, default) plussemantic/hybrid(local embeddings, no cloud).
How it works, in one line: a committed, human-readable
memory.jsonlis the source of truth; a local, gitignored SQLite index makes it (and your code) instantly searchable. For the full design, see docs/ARCHITECTURE.md.
Install
pip install "git+https://github.com/DoppiaG93/ctxmem.git" # as a git package
# or, from a clone: pip install -e .
# optional extras
pip install "ctxmem[mcp]" # AI-agent server (MCP)
pip install "ctxmem[semantic]" # semantic search (needs Ollama too)
pip install "ctxmem[all]" # everythingRequires Python 3.8+ with FTS5 (bundled in virtually every sqlite3 build).
The base install has zero third-party dependencies.
Related MCP server: LumenCore
Quick start
cd your-project
ctxmem init # creates .ctxmem/
ctxmem hook install # auto-sync the index on every commit
ctxmem remember --type decision \
--title "Auth via JWT" --tags auth,security \
"We chose stateless JWT over server sessions for horizontal scaling."
ctxmem sync # index memory + your code
ctxmem ask "how do we handle authentication" # verdict: HIT / WEAK / MISS
ctxmem recall "how do we handle authentication" # ask in plain language
ctxmem recall "cart" --type symbol # search only code symbolsThen commit the memory so it's shared:
git add .ctxmem/memory.jsonl .ctxmem/config.json
git commit -m "chore: seed project memory"Your colleague just git pulls and runs ctxmem recall — the index rebuilds
itself from memory.jsonl. For the full onboarding story (agent wiring, handing
memory to a teammate), see docs/GUIDE.md.
Commands
Command | What it does |
| Create |
| Store a memory (→ |
| Search memory + code. Superseded records are demoted + flagged |
| Recall plus a ranked verdict: |
| Rebuild |
| Save a structure + Python import map into memory ( |
| Show, or switch to, |
| List recent memories. |
| Branch/commit, mode, and counts of indexed items. |
| Check the semantic (Ollama) backend end to end, with fix-it hints. |
| Add/remove a git post-commit auto-sync hook. |
| Wire up agents: write the memory protocol into instruction files (+ |
| Refresh the managed instruction block(s) after upgrading ctxmem. |
| Measure token and premium-request savings. Add |
| Run against a repo other than the current directory. |
Use it from an AI agent
Wire an agent (Codex, GitHub Copilot) to the memory in one command:
ctxmem agent-init --agent all # write the memory protocol into AGENTS.md + copilot-instructions.md
ctxmem agent-init --agent all --mcp # also drop a .vscode/mcp.json (MCP server)This injects a Project Memory Protocol that tells the agent to recall before
a task, remember decisions, and sync after changing code — so the memory grows
by itself. Full details (CLI vs MCP, requirements, tips) in
docs/GUIDE.md → Use it from an AI agent.
Semantic search (Ollama)
Keyword mode is the stable, zero-setup default. Optional semantic and hybrid modes match by meaning using a fully-local embedding model:
pip install "ctxmem[semantic]"
# Option A: install Ollama on the host, then:
ollama pull nomic-embed-text
ctxmem mode semantic
ctxmem doctor # verify the whole chain end to end
# Option B: run Ollama in an isolated Lima VM:
cd ollama && task enable # brings the VM up + switches to semanticIf the backend isn't available, ctxmem automatically falls back to keyword.
Setup options, the Lima VM, and ctxmem doctor output are documented in
docs/GUIDE.md → Semantic backend.
Why it saves tokens
Instead of pasting whole files into the model, you inject only the relevant
recall snippets. Measured on the Django source tree:
Metric | Without ctxmem | With ctxmem | Improvement |
Context tokens (13 questions) | 272,354 | 14,028 | 19.4× smaller |
Premium requests (round-trips) | 49 | 13 | 3.8× fewer |
Full methodology and reproducible steps: docs/ARCHITECTURE.md → Benchmark.
Documentation
docs/ARCHITECTURE.md — the problem, the data model, the retrieval pipeline, project structure, search-mode internals, and the benchmark.
docs/GUIDE.md — full walkthrough, team sharing, the git hook, AI-agent integration (CLI + MCP), and the semantic/Ollama backend.
FAQ
Is my data sent anywhere? No. Everything is local: SQLite files in your repo and, if you enable semantic mode, a local Ollama.
Do I have to use embeddings? No. keyword mode needs nothing and is the
default. Semantic is opt-in.
Should I commit index.db? No — it's derived and gitignored. Commit
memory.jsonl and config.json.
What if a teammate doesn't have Ollama? ctxmem falls back to keyword automatically; the shared memory still works.
Does it scale to a big repo? Yes. The keyword index is fine for large repos,
and semantic mode is incremental — embeddings are cached by content hash
(.ctxmem/emb_cache.db), so a sync only re-embeds new or changed text.
Is MCP proprietary? No. MCP is an open protocol with MIT-licensed SDKs; the server runs locally and reads only your repo.
Contributing
Contributions are currently invite-only. The project is developed by a small set of invited collaborators, so unsolicited pull requests are not accepted right now — but bug reports and feature requests are always welcome via GitHub issues. To contribute code, reach out to @DoppiaG93 to be added as a collaborator.
Invited collaborators follow the Git Flow branching model; see the Contributing guide for branch naming, commit conventions, and the release process. Please also review our Code of Conduct. To report a security issue, follow the Security Policy.
License
Released under the MIT License.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-quality-maintenanceProvides AI coding agents with persistent, long-term memory through local semantic search and SQLite storage. It enables agents to save and retrieve architectural decisions or project context across different conversation sessions without requiring cloud services.Last updated
- Alicense-qualityCmaintenanceProvides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.Last updated19Apache 2.0
- AlicenseAqualityCmaintenanceProvides persistent cross-session memory and full-text search for AI coding assistants, storing project context, decisions, and preferences while enabling searchable access to conversation history via local SQLite.Last updated8MIT
- Alicense-qualityBmaintenanceProvides a persistent, local-first memory for coding agents over MCP, enabling automatic recall and recording of past work, failures, and decisions to reduce repetition and token usage.Last updatedMIT
Related MCP Connectors
User-owned memory for AI agents, Copilot, Claude, IDEs, CLIs, and chat apps over remote MCP.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
The project brain for AI coding agents — memory, decisions, sprints, knowledge base via MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/DoppiaG93/ctxmem'
If you have feedback or need assistance with the MCP directory API, please join our Discord server