Epistemic memory for AI agents over MCP: a typed graph of claims with provenance, metacontexts, validity in time, and a review loop
pip install epimemer==0.3.1 Copy PIP instructions
Epimemer is a memory server for AI agents, speaking the Model Context Protocol. The agent hands over what it has read, and Epimemer stores it as a typed graph of topics, facts and inferences. For each claim the graph records where it came from, which world it is about, when it held, what contradicts it, and who decided what. It then points the agent at the graph's own weak spots for review.
Epimemer does no extraction of its own. Reading a document and deciding what it claims is the agent's job. Epimemer's job is to store those claims with their evidence and to keep asking whether they still stand.
uv tool install "epimemer[sentence-transformers]" # or: pip install "epimemer[sentence-transformers]" Extra Adds When you need it sentence-transformers Local embeddings via sentence-transformers (pulls in PyTorch) Always, for real use: it is the only embedding provider apart from mock, which exists for tests. Without it the server refuses to start and names the extra to install The embedding model (all-MiniLM-L6-v2, about 80 MB) downloads on first run.
claude mcp add epimemer -- epimemer serve Then run /mcp inside Claude Code to confirm the server is listed. This uses the defaults: local embeddings and in-memory storage, lost when the server exits. See Persistence for the setup that keeps a graph.
Any other MCP client works the same way: the server speaks stdio, and epimemer serve is the command. The integration guide has the full configuration, the canonical tool table, and how the agent guidance reaches the agent: the server sends the per-call rules on connect and serves the full guide as the MCP prompt guide, so nothing is pasted into an agent's instructions.
Persistent storage is a SurrealDB server, a SQLite file per graph with nothing to run, or a Postgres database for a graph several people share (both below). The storage path is the whole difference between persistent and not. surreal start takes an optional [PATH] whose default is memory, so a server started without one keeps the entire graph in RAM and loses it on restart, with no error and no warning. Every command here passes an explicit rocksdb: path.
# Docker: on disk, in a named volume that outlives the container. # -u 0:0 because the image's non-root user cannot write the volume mount. docker run -d --name surrealdb -p 8000:8000 \ --restart unless-stopped -u 0:0 \ -v surreal-data:/data \ surrealdb/surrealdb:latest \ start --user root --pass root rocksdb:/data/epimemer.db # Or a native install: on disk, relative to the working directory surreal start --user root --pass root rocksdb:epimemer.db Then register the server with the backend named:
claude mcp add epimemer \ -e EPIMEMER_STORAGE_BACKEND=surrealdb \ -e EPIMEMER_SURREALDB_URL=ws://localhost:8000/rpc \ -e EPIMEMER_GRAPH=default \ -- epimemer serve root/root are SurrealDB's local-development credentials; set EPIMEMER_SURREALDB_USER and EPIMEMER_SURREALDB_PASS for anything else. Set EPIMEMER_GRAPH per server: the active graph is process state, so a client that reconnects lands back on whatever the server opened.
The same graph can live in a SQLite file instead, with nothing to run:
A graph can also live in a Postgres database you already run:
pip install "epimemer[postgres]" claude mcp add epimemer \ -e EPIMEMER_STORAGE_BACKEND=postgres \ -e EPIMEMER_POSTGRES_DSN=postgresql://epimemer:secret@db.example.org:5432/epimemer \ -e EPIMEMER_GRAPH=team \ -- epimemer serve Shared means several Epimemer servers, on one machine or many, reading and writing one graph at once. Each server keeps its own active graph and its own judge claims; the graph, its journal, its counters and its settings live in Postgres and are read on every call, so one server sees another's writes as soon as they are made, and the epimemer agents commands work against it too. Each graph is a schema of its own name in the database the DSN names, created on first use, so the database must exist and the role must be allowed to create schemas in it. The DSN is a URL or key=value pairs, so sslmode and a password file work as they do for any Postgres client. Without the extra or without a DSN, the server refuses to start and says which is missing.
Sharing today means everyone writes: search records when a claim was retrieved, so a role granted only SELECT cannot search yet. Give each person a role that can write to the graph's schema.
epimemer graphs list prints the backend, where its graphs live and the graphs on it, for any backend.
All configuration is via EPIMEMER_ environment variables:
Set EPIMEMER_LOG_FILE. When a client reports nothing beyond a connection that failed, this file is where the reason is: a server that dies during startup has nowhere else to put it, since everything on stderr goes with the process. python scripts/check_server_starts.py asks the same question from a shell, and prints what the server wrote.
Tools exposed via the Model Context Protocol (Claude Code prefixes each as mcp__epimemer__ ), grouped by purpose:
The integration guide has the canonical table with one-line descriptions and the authoritative tool count.
A browser dashboard showing the knowledge graph, pipeline execution and timelines, live. It is a standalone hub that many MCP sessions publish to, rather than a server embedded in each MCP process, so several agents can be watched from one page.
EPIMEMER_VIZ_HOST is a privacy setting as well as a network one. On the default loopback bind the hub keeps whole retrieval records, so they survive the MCP process exiting. Point it at a non-loopback address and sessions mirror structural metadata only, with no query text and no response payloads; the payloads stay in the MCP process, reachable only while it is running.
epimemer agents list shows a graph's approved judges, whether it requires one, and what each has said about itself. epimemer agents confirm admits one, epimemer agents rename renames one (add --same-judge to fold two that are really one into one), and epimemer agents require on|off|default decides whether writes to that graph must name one. No MCP tool can do any of this: a tool the agent calls cannot prove the user asked for it, so these acts are reserved for a person at the CLI.
epimemer agents retire takes a judge out of use. It keeps its name, its history and every decision, and review still answers for it; what changes is that claim_agent refuses it and the picker stops offering it beside the live ones. epimemer agents reinstate brings one back, as does the picker's A retired judge… entry. epimemer agents delete removes a judge that has never judged anything: it scans the graph, shows what it found, and refuses with the counts if anything names the judge, since a deleted record would leave rows carrying a key nothing resolves to a name.
epimemer relations backfill gives every relationship label already in use a record, in one go. It is idempotent and never touches a label that has one.
epimemer tags repair puts back the names an old enrichment overwrote. It is for graphs written before enrichment learned to describe a topic instead of renaming it, and it asks about each node before touching it, since only a person can say which of two sentences was the tag's name. Idempotent: on a graph that never held the damage it finds nothing.
All of these work only against a served SurrealDB. An embedded store lives inside the server process, so a CLI writing to it would write to a separate copy the running server never reads. For the two settings, use EPIMEMER_APPROVED_AGENTS and EPIMEMER_REQUIRE_JUDGE instead; the command refuses and names the right variable rather than appearing to succeed.
Three commands, and they are the same code the backup_graph tool runs:
epimemer graphs export --to # a bundle of the whole graph epimemer graphs import --graph # rebuild it as a new graph epimemer graphs verify # check one, then drop the copy epimemer graphs convert --to postgres # rebuild it on another backend, in one step A bundle is one JSON Lines file per section (metacontexts, judges, nodes, edges, the decision journal, the relation vocabulary, timelines, documents and segments, and the graph's own settings), plus a manifest, compressed into - .epimemer.tar.gz. --plain writes the directory uncompressed for reading or diffing, and import accepts either.
--to takes a local path, which covers an external drive, a synced folder or a repository you commit yourself, or a cloud URL. gs:// needs epimemer[gcs] installed and s3:// needs epimemer[s3]; a URL whose filesystem is missing is refused with the extra named. Credentials come from each provider's standard chain, and Epimemer reads none of its own.
Embeddings are not in the bundle. Import re-embeds every node with the provider the importing server is configured with, which is why export, change EPIMEMER_EMBEDDING_MODEL_ID, import is how a graph moves to a new embedding model. The manifest records what it was embedded with, so a restore onto a different model says so.
Import creates a new graph. It refuses a name that already exists, with no override: replacing a graph is delete_graph and then import, two acts you already have. A failed import drops the partial graph and says why.
The graphs commands run against whatever store the configuration names, so unlike the commands above they are not refused on an embedded one. They do warn: an embedded store opened from outside the server is an empty one, so exporting it writes an empty bundle and importing into it throws the graph away when the command exits.
Nothing runs on a schedule. Instead, store_decomposition and apply_reflection report stores_since_backup against backup_threshold, and when backup_suggested is true the agent raises it with you. Say yes and it calls backup_graph, which writes to EPIMEMER_BACKUP_DESTINATION and takes no path of its own, so an agent can act on the prompt without choosing where your graph goes. EPIMEMER_BACKUP_THRESHOLD sets how often it asks.
Development setup, the test suites, the frontend build and where the design notes live are in CONTRIBUTING.md. Bugs and proposals go to the issue tracker.
mcp memory knowledge-graph agents epistemic claude
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.




