<!-- Keep by TulipFarm: open-source memory for AI agents -->
# Keep

One shared memory for all your AI assistants, built on systems, security, and evaluation fundamentals — not another prompt wrapper over a vector database.

Keep is a research preview. Built in Rust with honest benchmarks and no cherry-picked numbers.

Source: https://github.com/TulipFarm/keep

## Install

Tell your coding agent: `Read https://keep.tulipfarm.ai/install.md and install Keep for me.`

Or run `curl -fsSL https://keep.tulipfarm.ai/install.sh | sh`. Runs on macOS and Linux.

## How it works

- **Work like you already do.** Write notes and chat with your AI as usual.
- **Keep saves every version.** Every edit becomes a new revision.
- **Keep extracts the facts.** Each fact keeps its dates and exact source.
- **Your AI starts informed.** Every new chat loads your notes and searches history.

## Runs where you want

On your laptop or your own server. No hosted service.

- **In memory.** Zero setup. Memory clears on restart. `keep --user me serve &`
- **With Postgres.** Survives restarts. Uses pgvector or Qdrant. `docker compose --profile postgres-vector up -d`
- **Docker Compose.** Full stack using the prebuilt ghcr.io/tulipfarm/keep image. `deploy/compose.yaml`

## Curated notes, not vector soup

Deterministic, plain Markdown notes loaded at the start of every chat — separate from raw history.

- **No silent overwrites.** Compare-and-swap rejects stale edits; non-overlapping changes merge safely.
- **Lossless history & safe undo.** Up to 100 revisions per file, saved byte for byte with stable entry IDs.
- **Prompt-injection hardened.** Rendered as untrusted single-line JSON; exports block AGENTS.md and CLAUDE.md by default.
- **Real forgetting.** Erases across revisions, trash, and receipts with a backup-replayable erasure journal.

[How Memory works](https://github.com/TulipFarm/keep/blob/main/docs/memory.md)

## Bi-temporal facts with receipts

Append-only episodes and facts that track when something was true, when Keep learned it, and the exact source span.

- **Two kinds of time.** Query valid time (what was true then) or known time (what Keep knew then).
- **Deterministic contradictions.** Explicit active, superseded, and disputed states — never silent LLM deletes.
- **Permission-safe retrieval.** Partition checks run before ranking, and source allowlists replay supersession.
- **Exact citations.** Every fact links back to its source episode and character span.

[How Knowledge works](https://github.com/TulipFarm/keep/blob/main/docs/knowledge.md)

## One local hub, built for real ops

Share one memory across Claude, Codex, Copilot, and Cursor with production-minded controls.

- **Local MCP + HTTP.** Works with any local MCP client, HTTP scripts, and the keep-rs Rust SDK.
- **Scoped auth & TLS.** Constant-time scoped tokens, private to 127.0.0.1 by default, TLS for remote DBs.
- **Bounded local embeddings.** Configurable ONNX CPU/thread caps and content-addressed vector reuse.

[Setup for each agent](https://github.com/TulipFarm/keep/blob/main/docs/server.md)

## Scientifically honest status

Evaluation fundamentals first — no cherry-picked benchmark numbers before beating simpler baselines.

- **Preregistered manifests.** SHA-256-pinned runs, sealed holdouts, and equal-budget baselines (bm25-6k, dense-6k).
- **Calibrated & explicit.** Length-only fit masks, calibrated judges, and failed answers never dropped from denominators.
- **No claims yet.** Works today, but our runs haven't passed our own gate yet.

[Read the methodology](https://github.com/TulipFarm/keep/blob/main/docs/benchmarks/methodology.md)

## Open source, Apache-2.0

Written in Rust with #![forbid(unsafe_code)]. One public repo for server, memory, knowledge, and benchmarks.

- **Conformance-tested.** Shared storage suites run across in-memory, Postgres + pgvector, and Postgres + Qdrant.
- **Audit everything.** Datasets keep their own licences; you download and verify them yourself.

[View the repository](https://github.com/TulipFarm/keep)

## Questions

### What is Keep?

Keep is a shared memory for your AI assistants. It stores short notes your AI reads in every chat, plus a record of facts with their sources and dates, so you can see what changed and when. It is open source, written in Rust, connects to AI apps over MCP, and is a research preview.

### Do I need to be a developer to use Keep?

Not to use it, but setup happens on the command line today. The easiest way is to paste the setup prompt into an AI coding assistant such as Claude Code and let it install Keep for you. After that, your connected AI apps use Keep on their own.

### What is MCP?

MCP (Model Context Protocol) is an open standard that lets AI apps such as Claude, Codex and Cursor connect to tools and data. Keep is one of those tools, so any MCP app that can run a local server on your computer can use it.

### How is Keep different from RAG or a vector database?

Most memory tools flatten everything into one vector store and overwrite facts in place. Keep separates curated, versioned Markdown standing state (Memory) from append-only episodic history (Knowledge). Facts are bi-temporal (valid time and known time), resolve contradictions deterministically into active, superseded, or disputed states, and carry exact character-span citations back to their source.

### How does Keep handle prompt injection and security?

Memory context is wrapped as untrusted data in labelled single-line JSON blocks so stored notes cannot pose as prompt instructions, and exports refuse instruction filenames like AGENTS.md and CLAUDE.md by default. Retrieval and the book index enforce partition permissions before ranking, tokens are verified in constant time, and remote Postgres or Qdrant connections require TLS by default.

### Which agents and models does Keep work with?

Claude Code, Claude Desktop, Codex, Copilot CLI, OpenCode, Cursor, and any MCP client that can start a stdio server. The agentic installer detects your apps, connects the ones you want, and offers to import existing memories. Keep sets no chat model for you. Your agent keeps its own.

### Can I run Keep myself?

Yes. Paste the install.md prompt into your coding agent, or run install.sh yourself. Both set up Keep locally or connect to a remote server, pick free ports automatically, and install a background service (launchd / systemd). Remove it anytime with uninstall.md or uninstall.sh.

### Is Keep open source?

Yes. Keep is Apache-2.0 and the code is public on GitHub.

### How much does Keep cost?

Keep is open source and you run it yourself. The repo states no hosted service and no price.

### Is Keep ready for production?

No. Keep is a research preview and the server is an alpha. The benchmark that decides whether Keep is worth using is not finished. Use it where losing a note is acceptable.

### Does Keep send my data to a model provider?

Not by default. Out of the box, Keep extracts facts with local rules and embeds Knowledge with a local model downloaded once on first start, so nothing leaves your machine. You can optionally configure an OpenAI-compatible model endpoint for model-backed extraction and summaries.

### Does Keep ever delete anything?

Only when you ask. Edits, undos and changed facts become new revisions or fact versions. Old revisions are kept for up to 30 days, and forgetting erases one or many sources for good and returns a signed receipt for each.
