Lorekeeper
Agent Long-Term Memory Bank using SQLite and FTS5.
Lorekeeper is a Rust MCP (Model Context Protocol) server that provides structured long-term memory for AI coding agents (operating under the TARS protocol or similar workflows). It replaces flat-file history with a queryable SQLite database, enabling agents to store, search, and retrieve typed memory entries via MCP tools over stdio.
Key Features
- Context Window Management: Reduces per-session token load by allowing selective retrieval.
- Typed Entries: 11 semantic entry types (e.g.,
DECISION,COMMIT,PLAN,LESSON,SESSION_SUMMARY). - Role Enforcement: Mechanically prevents unauthorized writes (e.g., Builder agents cannot assert architectural constraints).
- Full-Text Search: Backed by SQLite FTS5 across titles, bodies, and tags.
- Rich Interaction: 11 MCP tools covering CRUD, search, and memory analytics.
- Isolated Storage: Automatically manages a project-local SQLite database (
.lorekeeper/memory.db).
Installation
From Source
Requires Rust 1.94.0+ (Edition 2024).
# Clone the repository
# Alternatively, if just is installed:
MCP Configuration
To use Lorekeeper with MCP-compatible clients, add the server to your configuration.
Since cargo install places the binary in ~/.cargo/bin/, which should be on your PATH, you can usually use the bare command. If it fails to spawn, use the absolute path to lorekeeper.exe.
Note: Set
LOREKEEPER_ROOTto the project directory if the server isn't launched from within a project that contains a.git/or.lorekeeper/directory.
Antigravity (mcp_config.json):
"lorekeeper":
Claude Desktop (claude_desktop_config.json):
Usage for Agents
Lorekeeper provides the following MCP tools for agentic workflows:
- Write:
lorekeeper_store,lorekeeper_update,lorekeeper_delete - Read:
lorekeeper_get,lorekeeper_search,lorekeeper_recent,lorekeeper_by_type,lorekeeper_render - Health:
lorekeeper_reflect(detects duplicates/staleness) - Meta:
lorekeeper_stats,lorekeeper_help
Agents can self-discover capabilities by calling lorekeeper_help.
Development
The project uses just for automation.
# Run the verification pipeline (fmt, clippy, test)
# Run tests only
# Build the project
The database resides locally at <PROJECT_ROOT>/.lorekeeper/memory.db.