ContextKeep solves the "AI with amnesia" problem by giving Claude, Cursor, and other MCP clients a persistent local memory layer. It exposes eight tools over stdio or SSE: list_all_memories, retrieve_memory, store_memory, search_memories, and newer additions like delete_memory and export_memories. The two-step retrieval pattern (list keys first, then fetch by exact key) prevents the common failure mode where agents hallucinate memory IDs. You get a web dashboard on port 5000 for visual management, Docker Compose support for homelab deployments, and everything stores locally as JSON. Reach for this when you're tired of re-explaining project context every conversation or want to slash token costs by pulling only relevant memories into each request.

ContextKeep gives AI agents a persistent, searchable memory they can use across sessions. V2.1 adds SQLite, full-text search, user-editable categories, safer Docker defaults, and verified backup-first upgrades.
What's New | Safe Upgrade | Install | MCP Tools | Configuration | Docs
/mcp, with SSE fallback for older clients.get_contextkeep_info.
V2.1 is the first category-first ContextKeep release.
list_all_memories has been removed.list_categories and list_memories before retrieve_memory.tags are replaced by user-editable categories.legacy_tags migration metadata.get_contextkeep_info reports version, storage path, database ID, tool list, and migration status.Older releases remain available through GitHub releases and tags. V2.1 is the recommended version for new installs and upgrades.
Before replacing an existing install, use the safe upgrade wrapper. It creates a backup, verifies the archive, checks SQLite/JSON integrity, and stops if anything looks wrong.
Bare-metal:
python scripts/upgrade_to_v2_1.py baremetal
Docker:
python scripts/upgrade_to_v2_1.py docker
V1 JSON migration:
python scripts/upgrade_to_v2_1.py baremetal --v1-source /path/to/old/data/memories
See docs/SAFE_UPGRADE.md for backup, restore, Docker volume, and rollback details.
git clone https://github.com/mordang7/ContextKeep.git
cd ContextKeep
python -m venv .venv
Linux/macOS:
source .venv/bin/activate
pip install -r requirements.txt
Windows PowerShell:
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
You can also run the installer:
python install.py
git clone https://github.com/mordang7/ContextKeep.git
cd ContextKeep
docker compose up -d --build
Default ports:
| Service | URL |
|---|---|
| WebUI | http://localhost:5000 |
| MCP HTTP | http://localhost:5100/mcp |
Local MCP over stdio:
python server.py
Remote MCP over HTTP:
python server.py --transport http --host 0.0.0.0 --port 5100
WebUI:
python webui.py --host 0.0.0.0 --port 5000
Then open:
http://localhost:5000
ContextKeep V2.1 exposes 16 tools:
| Tool | Purpose |
|---|---|
get_contextkeep_info | Confirm version, storage path, database ID, schema, tools, and migration status |
list_categories | List live user-editable categories |
create_category | Create a category when no existing category fits |
update_category | Rename or edit category metadata |
delete_category | Delete an empty category or reassign memories |
merge_categories | Merge one category into another |
list_memories | List memory keys/titles, optionally filtered by category |
retrieve_memory | Retrieve a memory by exact key |
search_memories | Full-text search memory content |
list_recent_memories | List recently updated memories |
store_memory | Store or update a memory with categories |
update_categories | Reassign one memory to one or more categories |
get_edit_history | View edit history for a memory |
delete_memory | Delete a memory permanently |
get_memory_stats | Show memory/category counts and storage path |
export_memories | Export all memories as JSON |
Recommended retrieval flow:
list_categories -> list_memories -> retrieve_memory
Use search_memories for topic discovery, then retrieve the exact matching memory before relying on it.
Most clients that support streamable HTTP:
{
"mcpServers": {
"context-keep": {
"url": "http://localhost:5100/mcp"
}
}
}
Antigravity IDE uses serverURL:
{
"mcpServers": {
"context-keep": {
"serverURL": "http://localhost:5100/mcp"
}
}
}
SSE fallback:
{
"mcpServers": {
"context-keep": {
"url": "http://localhost:5100/sse"
}
}
}
For a remote machine, replace localhost with the hostname or address of the machine running ContextKeep.
Do not keep an old SSH/stdin config active for the same context-keep server name. It may launch an older server that writes to a different database than the WebUI.
After connecting a client, call get_contextkeep_info.
Expected V2.1 values:
version: 2.1.0schema_version: 2storage_backend: sqlitestorage_path: /app/data/contextkeep.db in Docker, or your configured local pathlist_memories, list_categories, update_categories, and get_edit_historyIf an agent stores a memory but the WebUI cannot see it, compare WebUI /api/info with MCP get_contextkeep_info. The database_id, storage_path, and memory count should match.
Create a verified bare-metal backup:
python scripts/backup_contextkeep.py baremetal --install-dir /path/to/contextkeep
Create a verified Docker backup:
python scripts/backup_contextkeep.py docker --volume <docker-volume-name>
Restore commands are written into every backup folder. The full guide is in docs/SAFE_UPGRADE.md.
If you use container auto-update software, keep an external backup routine. The safe upgrade scripts can verify backups before an upgrade, but unattended image replacement cannot ask you to confirm backup health.
get_contextkeep_info identity checks.delete_memory, get_memory_stats, export_memories.Issues, feature ideas, and pull requests are welcome. If you build a client guide, migration recipe, or workflow pattern around ContextKeep, please share it.
Thank you to everyone who contributed to the Harbor release:
pyproject.toml, uv support, and packaging fixes.If ContextKeep saves you time, tokens, or context-window pain, support is appreciated.
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent