recallkeep
Provides an MCP server and hook configuration for Google Antigravity CLI, enabling session-start context, per-turn recall via PreInvocation, and the memory tools.
Provides an MCP server and Codex CLI hook/config integration so OpenAI Codex CLI can inject RecallKeep context at session start, recall relevant memory before prompts, and use the memory tools.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Every time you start a new session, your coding agent has forgotten what you decided yesterday. You explain the same rules again, and it reopens questions you already settled. RecallKeep fixes this. It keeps your decisions, facts and past conversations in a Postgres database on your machine. It gives the relevant ones back to the agent at the start of each session and with each prompt you send.
It works with any agent that supports MCP (Model Context Protocol, the standard way agents connect to tools). It has ready-made hooks for pi, Claude Code, OpenAI Codex CLI and Google Antigravity CLI. Several agents can share one memory, so a decision made in Claude Code is known in Codex too.
Status: early (v0.1.0), and in daily use by its author since April 2026. Install it from this repo. It is not published to npm.
Why
Related MCP server: apex-memory
Features
Context at session start. The agent gets your standing rules (for every project), the locked decisions for this project, and its newest facts.
Recall for each prompt. Before the agent reads your prompt, RecallKeep adds the stored facts that best match it.
Agent tools.
memory_search,memory_save,memory_context,memory_listandmemory_forgetwork in any MCP client.Hybrid search. Full-text search and semantic (vector) search are combined. Results are ranked by relevance, recency, tier and confidence.
Projects without setup. The project comes from the folder you work in.
~/Projects/my-app/srcismy-app.Conversation capture. Each turn is logged. pi sessions are captured in full, including tool calls.
Secrets removed. Captured conversations go through betterleaks or gitleaks plus a pattern check before they are stored.
Decisions layer. An LLM pass picks out settled decisions from pi transcripts, so they are not reopened later.
Maintenance. Session summaries, lesson extraction, promotion from short-term to long-term, conflict detection, export and backup.
Your choice of model. OpenAI, Gemini, a local server such as Ollama, or no LLM at all.
Safe defaults. The API listens on 127.0.0.1 only, rejects browser requests, and takes an optional bearer token.
Before you start
You need:
Bun 1.2 or newer.
Postgres 16 or newer with the
vectorandpg_trgmextensions. The quickstart runs it with Docker. To use your own Postgres instead, see Without Docker.Optional: an OpenAI or Gemini API key, or Ollama, for semantic search and summaries. Without one, RecallKeep still works, and search uses full text and project tags.
Quickstart
This setup uses no API key and makes no external calls. It takes about five minutes.
git clone https://github.com/theBlackEndDev/recallkeep.git
cd recallkeep
bun install
cp .env.example .env
echo 'RECALLKEEP_LLM_PROVIDER="none"' >> .env # no LLM; change this later, see below
docker compose up -d # Postgres + pgvector on 127.0.0.1:5433
bunx prisma migrate deploy # create the tables
bun run memory-api # the API on http://127.0.0.1:7775Leave that running, and open a second terminal to check that it works:
curl -s http://127.0.0.1:7775/health
# {"status":"ok","backend":"recallkeep","port":7775}
curl -s -X POST http://127.0.0.1:7775/memory \
-H 'Content-Type: application/json' \
-d '{"content":"We deploy with blue-green releases.","project":"my-app","tags":["decision"]}'
bun run src/cli.ts recall --query "how do we deploy"Next, connect your agent. To start RecallKeep at login, see Run it in the background.
Choose an LLM provider
The LLM computes embeddings for semantic search, and it writes summaries. Set RECALLKEEP_LLM_PROVIDER in .env:
Provider | What you need | What leaves your machine |
| Nothing | Nothing. Search uses full text and project tags |
| Ollama or LM Studio on | Nothing |
|
| Text sent for embeddings and summaries |
|
| Text sent for embeddings and summaries |
Choose the embedding model before you store much data. Vectors from different models cannot be compared.
To fill in embeddings later, run bun run src/cli.ts backfill. Details:
docs/configuration.md.
Connect your agent
Each agent gets two things:
The MCP server for the tools. The agent starts it with
bun /PATH/TO/recallkeep/src/cli.ts mcp. The server talks to the API you started above.Hooks for automatic memory: context at session start, recall on each prompt, and turn logging. Hooks fail open. If RecallKeep is down, the agent runs as normal.
In the commands below, replace /PATH/TO/recallkeep with the full path to your clone (run pwd inside it).
The MCP tools are the same in every agent:
Tool | What it does |
| Searches facts and past conversations. Defaults to the current project. |
| Saves a fact. Tag it |
| Returns the session-start block on request, for clients without hooks. |
| Lists a project's newest facts with their ids. |
| Archives a fact by id. Archived facts are kept but no longer recalled. |
Claude Code
Verified with Claude Code 2.1.327.
claude mcp add recallkeep -s user -- bun /PATH/TO/recallkeep/src/cli.ts mcpCopy the hooks block from integrations/claude-code/settings.json
into ~/.claude/settings.json for all projects, or into .claude/settings.json for one project.
OpenAI Codex CLI
Verified with Codex CLI 0.167.1.
Add integrations/codex/config.toml to ~/.codex/config.toml. Codex asks you
to trust new hooks: open /hooks in Codex and approve the three RecallKeep hooks. In testing, Codex did not
load hooks from a project's .codex/hooks.json, but it did load the inline [hooks] tables in
config.toml.
Google Antigravity CLI
Verified with agy 1.5.13. Antigravity CLI replaced Gemini CLI.
agy mcp add recallkeep bun /PATH/TO/recallkeep/src/cli.ts mcpCopy integrations/antigravity/hooks.json to .agents/hooks.json in your
workspace, or to ~/.gemini/config/hooks.json for all workspaces. agy has no prompt-submit event, so the
recall hook runs on PreInvocation. RecallKeep looks up memory once per turn and reuses the result for the
other model calls in that turn.
pi
pi gets a full extension. It injects context at session start, syncs the complete transcript (including tool
calls) after each turn, writes a handoff note when you quit, and adds the memory_search and memory_save
tools plus the /memory and /handoff commands.
mkdir -p ~/.pi/agent/extensions
cp -R /PATH/TO/recallkeep/integrations/pi ~/.pi/agent/extensions/memorySee integrations/pi/README.md. For the tools only, use
pi mcp add recallkeep -- bun /PATH/TO/recallkeep/src/cli.ts mcp instead.
Any other MCP client
Cursor, Windsurf, Cline, VS Code and others can start the same server. Use command bun with arguments
/PATH/TO/recallkeep/src/cli.ts mcp. They get the tools but no hooks, so paste
integrations/AGENTS.md into your agent instructions. It tells the agent to call
memory_context at the start and to save decisions.
Run it in the background
scripts/start.sh starts Postgres with Docker (or, without Docker, waits for your own
Postgres), applies migrations and runs the API. Service templates call it:
Each file explains in its header how to install it. To update later, run bun run update. It pulls,
installs, migrates and restarts the service.
Without Docker
RecallKeep only needs a Postgres it can reach through RECALLKEEP_DATABASE_URL. A native install, a
server on your network or a managed database all work. The database must be Postgres 16 or newer with the
pgvector extension installed. pg_trgm ships with Postgres.
Create a user and a database, then create the two extensions as a superuser.
vectoris not a trusted extension, so the migrations can't create it with an ordinary user:CREATE ROLE recallkeep LOGIN PASSWORD 'choose-a-password'; CREATE DATABASE recallkeep OWNER recallkeep; \c recallkeep CREATE EXTENSION vector; CREATE EXTENSION pg_trgm;Point
.envat it. Percent-encode special characters in the password (@is%40,:is%3A,/is%2F):RECALLKEEP_DATABASE_URL="postgresql://recallkeep:choose-a-password@localhost:5432/recallkeep"Skip
docker compose up -din the quickstart. Run the rest as written.
scripts/start.sh decides whether to use Docker from the URL. It uses Docker only when the URL points at
this machine on the port docker-compose.yml publishes (RECALLKEEP_DB_PORT, default 5433). Otherwise it
waits until your database accepts connections. Set RECALLKEEP_USE_DOCKER=0 or 1 to decide it yourself.
backup and restore then run pg_dump and psql on this machine, so install the PostgreSQL client
tools (macOS: brew install libpq, Debian and Ubuntu: apt install postgresql-client). Their version must
be the same as the server's or newer. If they aren't on PATH, set RECALLKEEP_PG_DUMP and
RECALLKEEP_PSQL to their full paths.
How it works
your agent ──hooks──▶ bun src/cli.ts hook ─┐
│ ├──HTTP──▶ API server :7775 ──▶ Postgres + pgvector
└──MCP────────▶ bun src/cli.ts mcp ────┘ │
└──▶ LLM provider (optional): embeddings, summariesFacts are short, curated statements: a decision, a rule, a finding. You or the agent save them.
Messages are conversation turns captured by hooks. Long ones are split into chunks for search.
Recall runs full-text and vector search, then ranks the results by relevance (60%), recency (15%), tier (15%) and confidence (10%). Facts from the current project get a boost.
Maintenance (
bun run src/cli.ts maintain, orscripts/cron-maintain.sh) moves short-term facts that were saved on purpose or have high confidence up toDAILYand thenLONG_TERM. It archives the low-confidence short-term ones after 48 hours.
Full details: docs/how-it-works.md.
Words you'll see
Word | Meaning |
Fact | One saved piece of knowledge, such as "We deploy with blue-green releases." |
Decision | A fact tagged |
Standing rule | A fact saved under the project |
Project slug | The project name, taken from your folder. |
Recall | Finding the facts most relevant to a question and ranking them. |
Embedding | A list of numbers that represents the meaning of a text. Texts with similar meanings get similar numbers. |
pgvector | The Postgres extension that stores embeddings and finds similar ones. |
MCP | Model Context Protocol, the standard way agents connect to tools. RecallKeep runs as an MCP server over stdio. |
Hook | A command your agent runs at set moments, such as session start or prompt submit. |
Tier | How long a fact lives: |
Security and privacy
The API listens on
127.0.0.1only. To expose it on another address you must setRECALLKEEP_API_TOKEN, and clients then sendAuthorization: Bearer <token>.Browser requests are rejected, so a web page you visit cannot read your memory. To allow a specific origin, set
RECALLKEEP_CORS_ORIGINS.Postgres is published on
127.0.0.1only. ChangeRECALLKEEP_DB_PASSWORDbefore the firstdocker compose upif other people use your machine.Logged turns and pi transcripts are redacted before they are stored. Facts saved with
memory_saveare not redacted, so do not save secrets.
More: docs/privacy.md.
Docs
Document | Covers |
Providers, embeddings, every environment variable | |
Every command: | |
Every endpoint, with parameters and headers | |
How Claude Code, Codex, Antigravity and pi sessions are recorded | |
Architecture, ranking, projects, decisions, summaries, tiers | |
What is stored, what is redacted, what leaves the machine | |
Importing file-based memory, updating, backup and restore | |
Repo layout, programmatic API, tests, CI |
Working on RecallKeep
bun install
bun run typecheck
bun test # unit tests; database tests are skippedTo run the database tests and the API contract smoke test, create a throwaway database. Never use the one that holds your memory.
docker compose exec db createdb -U recallkeep recallkeep_test
export RECALLKEEP_TEST_DATABASE_URL="postgresql://recallkeep:<password>@localhost:5433/recallkeep_test"
RECALLKEEP_DATABASE_URL="$RECALLKEEP_TEST_DATABASE_URL" bunx prisma migrate deploy
bun test
SMOKE_DATABASE_URL="$RECALLKEEP_TEST_DATABASE_URL" bun run smokeCI runs the same steps on every pull request. See docs/development.md.
License
Apache-2.0. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP memory server. One memory your agents share — across models, devices and apps.
Hosted memory for AI agents over MCP. One memory shared by all your agents.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Persistent personal memory for AI assistants — save, search, and recall across every MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA self-hosted MCP server that provides AI assistants with a shared, persistent SQLite-backed memory for storing and retrieving project context, decisions, and discoveries. It enables cross-session continuity and team-wide knowledge sharing to keep AI coding tools aligned and informed.3MIT
- AlicenseNot gradedqualityDmaintenancePersistent memory for AI coding agents. Enables agents to save and recall decisions, patterns, bugs, and context across sessions via an MCP server with local SQLite storage.9 npm2MIT
- AlicenseAqualityBmaintenanceA local-first MCP server that provides a shared Markdown-based memory for AI coding agents, enabling cross-agent context persistence via tools like memory_search and memory_capture.161MIT
- AlicenseNot gradedqualityCmaintenanceMCP memory server for AI coding agents to remember decisions, patterns, and bugs between sessions. Provides persistent memory with 37 MCP tools, multi-session coordination, and token-efficient recall.95 npm12MIT