Echo Memory
Echo Memory is a shared graph-memory MCP server for AI agents, letting them store facts/entities, retrieve relevant memory, trace causal chains, and manage document ingestion/audit without server-side model calls.
Store episodes as entity-and-fact graph data via
write_episode, including confidence, optional causal hints, entity resolutions, and stored/not-stored outcomes.Recall relevant facts via
query_memorywith hybrid search, recency digest, historicalas_ofsnapshots, or exact entityaboutqueries.Trace why something happened with
trace_cause, following recorded causal links upstream, downstream, or both.Record that a recalled fact saved re-explaining via
record_recall_save, using a fact ID returned by a read.Inspect human-readable memory changes with
get_audit_log.List un-ingested project memory files with
pending_documents, then close them withmark_ingested.Use solo or shared scopes while preserving provenance, history, and agent/session attribution.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Echo Memory Echo Memory, remember that the API rate limit is now 100 req/min."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Echo Memory
Shared memory for AI agents, as a graph in your own database. What Claude Code learns, Cursor and Codex can recall. Every fact records who wrote it and when, and the server never calls a model to store one.

Every line above is real output, captured from these commands against a throwaway
database. The transcript is at
.github/branding/demo-transcript.txt.
Your agents start every session from zero. The usual fix is a notes file you paste into context, which grows until it is mostly irrelevant to whatever you are asking. Echo Memory is the other shape: facts connected to each other, and a query that returns the few that matter. On the author's own 325 fact store that is 96.7% less context for the same answer, with the answer still present 87.2% of the time across 1,190 queries the harness derived from their own answers.
write_episode query_memory
billing ──uses──▸ Razorpay "how do we take payments"
│ written by claude-code ▸ billing uses Razorpay, not Stripe
│ supersedes ──▸ Stripe written by claude-code, 3 days ago
└ no model invoked ▸ 1,372 tokens, not 41,838Install
Requires: Python 3.11+ and Docker (for the database).
pipx install echo-mem
echo-memory quickstartquickstart starts the database, applies the schema, and prints the claude mcp add
line that registers it, filled in with the port it actually used. The Postgres image is
published, so nothing compiles.
Or use the hosted service and run no database at all:
pipx install echo-mem
echo-memory connect <key> # a key from https://app.echo-mem.comThen once per machine, so an agent knows when to record and recall rather than only that the tools exist:
echo-memory install --globalRestart your client afterwards. An MCP server is a long lived process that holds the code and config it started with, and an editable install does not change that.
The PyPI name is
echo-mem, notecho-memory. That name belongs to an unrelated hosted product. The import package and the CLI are bothecho_memory/echo-memory; only the distribution name differs.
Related MCP server: smriti-memcore
Upgrading
pipx upgrade echo-mem
echo-memory init-db # apply any new migrations
echo-memory reindex # rebuild what the new code derivesBoth steps, in that order, and neither is optional on a store that predates the version you just installed.
Skipping init-db fails loudly. A read against a schema older than the code raises an
undefined column, which is the good case: it stops rather than answering from something it
half understands.
Skipping reindex fails silently, which is worse. Derived data that the new code reads
differently is still the old data, and nothing errors. Concretely, on an upgrade to 0.5.3
the lexical corpus statistics are treated as stale until rebuilt, so BM25 stays off and
your queries keep ranking by ts_rank while the setting reports as on. reindex rebuilds
the embeddings and those statistics together. echo-memory health tells you afterwards.
Usage
echo-memory status # what each scope holds, and which agents have written
echo-memory health # a score, what is weak, and what to do about it
echo-memory dashboard --serve # the graph, in a browser, localhost only
echo-memory why <fact_id> # the full audit trail for one fact
echo-memory recall "<question>" # query the store from a terminal
echo-memory export # everything, as JSON
echo-memory install --for cursor # wire one client, project scoped
echo-memory adopt # wire every MCP client on the machine, each with its own id
echo-memory infer-causal-hints # type the facts whose own sentence states a cause (dry run)
echo-memory eval # retrieval quality against your own store
echo-memory eval --context # what a recall costs against injecting everything
echo-memory eval --context --sweep # the same, as a curve across corpus size
echo-memory eval-external locomo <path> # LoCoMo, the corpus the published figures use
echo-memory eval-external longmemeval <path> # LongMemEval, the same
echo-memory calibrate # is entity resolution trustworthy on your data
echo-memory benchmark # write, query and digest latency
echo-memory judge # retrieval scored on questions written before the answers
echo-memory judge-external # QA accuracy for a finished eval-external runOperating a store, rather than using one:
echo-memory graph # a scope's graph, as text or JSON
echo-memory merge # fold one node into another, once confirmed to be one entity
echo-memory unmerge # take back an alias a node absorbed from a different entity
echo-memory reattribute # set the project on facts written before projects were recorded
echo-memory distil # read facts out of a session the harness already recorded
echo-memory bootstrap # import the work that already exists on this machine
echo-memory analyse # first run comprehension pass for an existing project
echo-memory reconcile # re-notice memory files the capture hook missed
echo-memory pending # memory files noticed but not yet in the graph
echo-memory install-hooks # register every capture hook in ~/.claude/settings.json
echo-memory skill # print the usage instructions, for a client with no config file
echo-memory trial # record and review v1a exit criteria observationsAnswering for the data, which is the part a compliance review asks about:
echo-memory forget # erase facts outright, for a data subject's deletion request
echo-memory retain # how long this scope keeps a fact, and enforcing it
echo-memory verify # has any fact been changed behind this store's back
echo-memory exchange # signed, redacted knowledge bundles between organisations
echo-memory trust # record and read whether a fact was ever checked, and by whomThose five are deliberately not MCP tools, and a test reads the published tool list so that adding one later fails. Irreversible deletion of a scope, one prompt injection away from any agent holding a key, is not a trade worth making, and neither is handing one organisation's memory to another.
trust is the strongest of the five in one specific sense: it is the only
thing in this store that decides WHICH facts a read returns rather than the
order they come back in, so a tool for it would let any agent holding a key
mark its own claims verified and its inconvenient ones rejected.
Note that trust and verify are different jobs with confusingly close
names. verify asks whether the store has been tampered with, by checking the
attestation chain. trust records that a person checked a claim, which is what
trust/states.py's six states are and what the lesson layer filters on.
trust lessons is also the only thing that explains an empty lesson list: it
prints which of the three bars was not cleared, because "no lessons" covers
both a scope whose outcomes disagree and a scope where nobody has verified
anything, and those have different owners.
exchange is one directional and there is no federation API. An export is a
signed file whose signature covers the redacted content, so what a recipient
verifies is what was actually sent. An import lands in a quarantine scope that
ordinary retrieval is not given, at confidence: inferred, and becomes
readable only when a named verifier promotes the bundle. Revoking one stops
the scope being readable from then on; it cannot recall facts already returned
into an agent's context, which is a property of having handed data over rather
than a gap, and exchange export says so before it writes anything.
The seven MCP tools
Tool | What it does |
| Store entities and the facts connecting them. No model call. |
| Hybrid vector and full text retrieval, fused by reciprocal rank. Full text ranks by BM25. Takes |
| Causal chains through the entities a subject matches, not a ranked list. |
| Mark that a recalled fact saved re explaining something. Refuses a fact no read returned. |
| Every change to memory, with a plain language reason. |
| Memory files this project wrote that the graph has not heard about. |
| Close one of those out. |
What you get
A graph, not a list. Entities are nodes and a fact is an edge between two of them. Two sessions that never knew about each other resolve onto the same entity by name, so the second inherits what the first learned.
Bounded retrieval, designed but not built. The plan is that old, rarely read memory
demotes into higher level summaries over time, with nothing discarded and every summary
still edged back to the facts it came from. None of it exists yet: there is no tiering,
no summarisation, and retrieval today walks every active fact in the scope. It is
described in docs/designs/ and listed below as v1c, and this paragraph
used to claim it in the present tense.
A ranked answer that says why each fact is in it. Every returned fact carries
score, its cosine similarity to the query, rank, its position, and matched, the
channels that found it. score is deliberately not the fusion number: reciprocal rank
values are sums of 1/(k+rank) and mean nothing from one query to the next, while a
similarity means the same thing every time, which is what a caller thresholding on it
needs. It is computed for every fact returned, including the ones only full text search
found, because which channel retrieved a fact is an implementation detail and has no
business reaching a field callers read as relevance.
The full text channel ranks by BM25. Postgres's ts_rank counts term occurrences and
nothing else: no inverse document frequency, so a word in every fact of a scope counts as
much as one in three; no saturation, so repetition scales linearly; no length
normalisation, so a long fact is punished for being long. On 324 real prompts the rank 3
and rank 4 scores were identical in 59% of them, and reciprocal rank fusion reads rank
position and never the score underneath it, so a channel ordered by scan order handed the
fusion a coin flip.
BM25 is computed in SQL rather than installed, so no extension is added to your database.
Corpus statistics are rebuilt amortised on write inside the transaction that already holds
the scope's lock, and by echo-memory reindex; a scope that has none falls back to
ts_rank rather than ranking on statistics it does not have. ECHO_MEMORY_LEXICAL_BM25=0
returns to ts_rank everywhere.
Facts about an entity, which resemblance cannot express. query_memory takes
about, one or two entity names, and returns only the facts recorded against them. One
name gives the edges incident to that node; two give the edges between them in either
direction, which is "both names in the same fact" without going near the fact text.
This is not a ranking improvement and it is not a substitute for one. A query about one team returns a semantically close fact about a different team because the wrong fact genuinely does resemble the question, and no amount of better ranking removes it. Identity is not similarity, and a fact is an edge between two nodes, so asking which entity a fact is about is structural and exact.
Name matching is exact and case insensitive, never a substring, because a short name is a substring of longer unrelated words. A name nothing is recorded under returns no facts rather than the nearest thing, and so does a pair with no fact joining them: that is real absence and it means nobody recorded this, not here is something adjacent. More than two names is refused rather than answered empty, because an edge has two endpoints and a fact about three entities is a question this model cannot express.
The history the store has always kept is readable. Every fact has carried t_valid
and t_invalid since the first migration, and the read path had only ever asked whether a
fact is current, so the store paid to keep the whole record of what a scope believed and
could not answer the first question a post mortem asks. query_memory takes as_of in
unix seconds and every channel honours it: vector, full text, the graph hop, the digest.
Supersession is what makes that more than a curiosity. Writing the same source, target and
relation again with a changed claim does not edit the old fact, it ends it: the old
edge takes a t_invalid and stays queryable. Nothing is ever rewritten, so the history is
real rather than reconstructed, which is the property the memory reconsolidation
literature gives up and the reason this project refuses that idea.
Restating an unchanged claim is not a change and no longer counts as one. If the fact
text, the confidence and the causal hint all match the edge already there, the write is
skipped and reported under restated. It used to create a second edge, end the first, and
emit a supersession whose before_fact equalled its after_fact. That is the mechanism
behind one customer edge carrying 47 versions of a single sentence, and behind 543 writes
producing 112 facts while every one of them was billed. It also makes a retry safe: with
no idempotency key, a caller retrying a write that had actually landed used to burn a
version on it.
Every write answers whether it stored anything. write_episode can end with an empty
edges_created four different ways, and from the caller's side they used to be
indistinguishable without knowing which other key to inspect. Each one now reports
stored: false and names itself in not_stored: refused (validation rejected it),
deferred (an entity mention was close enough to an existing node to be worth asking
about and not close enough to merge), unchanged (every fact already existed word for
word) and no_facts (the episode asserted none). A refusal carries the same keys as a
success, so one check works on every path, and retryable separates a database blip worth
retrying from a validation error that will fail forever. A write that stored some of its
facts and held the rest says partial.
The deferral is the one that cost real data, because it looks most like success: a well
formed response, no error, isError false, and nothing written. A customer loading 26,633
facts read that as 26,633 successes and stored 1,650.
Provenance on every fact. Who wrote it, which tool, which project, when, and which reads returned it. A superseded fact is never deleted. It stops being drawn and stays reachable with its history.
Causal typing, and a walk over it. A fact can carry causal_hint: one of
caused_by, led_to, enabled_by, blocked_by or contradicts, set by the agent's
own read of what the session said and never inferred statistically. trace_cause walks
those links and returns chains rather than a ranked list, because the answer to "why did
this happen" is an ordered chain and similarity cannot produce one. "A led_to B" and "B
caused_by A" are one claim written from opposite ends, and both assemble into the same
chain.
A fact with no hint is associative, which is the default and usually correct. An empty
answer from trace_cause says which kind of empty it is: nobody recorded a cause here is
a different fact about a store than there are no chains.
Filling it in, for a store that predates it. Facts written before 0.5.0 carry no
hint, so on an existing store trace_cause has nothing to walk.
echo-memory infer-causal-hints re-reads the fact text already stored with your own
model (ECHO_MEMORY_LLM_API_KEY, ECHO_MEMORY_LLM_MODEL) and types the edges whose own
sentence states the relation. Dry run by default; --write applies what it printed and
--clear --write takes it back.
This is extraction done late, not causal discovery, and the difference is enforced rather
than promised. A sentence with no causal connective is never sent to a model, so
co-occurrence is refused before it costs anything. Every proposal has to quote the words
that state the relation, and a quote that is not literally in the fact is dropped, so a
model reasoning from the world instead of reading the sentence gets nothing stored. Each
hint written is audited and marked as extracted late, which is what makes --clear
able to remove exactly these and never one you wrote at write time.
No inference on the write path. Extraction happens in the calling agent, so storing
a memory invokes no model on the server. Three commands in the engine reach a provider and
all three are worth naming rather than glossing: infer-causal-hints above, distil, and
judge-external, which grades a finished benchmark run. None is an exception to the claim.
Each is a command a person types against facts already stored, none runs as part of a
write, a migration or a hook, and src/echo_memory/cli/llm.py holds the only outbound
request in the engine, so a store that runs none of them never causes a model call. The cost moved rather than vanished: the agent
has to arrive with entities and facts already extracted, which is what the
tool contract spells out. The comparison that makes this matter is
Zep/Graphiti, the closest architectural match, whose own description of ingestion is that
"every episode triggers multiple LLM calls" and that "write cost scales with volume".
The obvious reply is that cheap writes are cheap because they do less, and that reply is
correct on the mechanism. docs/WRITE-COST.md answers it properly,
including the two measured costs of the choice: the Stop gate fired seven times and
produced one fact, and a write touching an ambiguous entity is deferred rather than
stored. The deferral is still the cost; what has changed is that the call now says so
instead of returning as though it had succeeded.
Any MCP client. A coding assistant, a chatbot, an ops agent, or something built in house. Coding agents are where this is proven, not what it is limited to.
Six capabilities on top of the graph
Machines reporting outcomes, a read across several memories, whether a claim was ever checked, routing and a token budget for that read, signed bundles between organisations, and the identity the hosted service binds a credential to. All of it is in the engine, so self hosting gets all of it.
Collective learning | A validated door for what CI runs, deploys and test suites report, a single writer behind it, and lessons derived at read time. A lesson is never stored: retire one supporting outcome and it stops being produced |
Knowledge networks |
|
Agent identity | A registry of the agents an account has, and runs recording what changed underneath one. Cloud only, because the engine has no concept of a principal |
Trust and verification | Six states, append only, with their own tamper evident chain. Only |
Context intelligence | Which scopes are worth asking, decided with no model call, and an answer cut to a token budget that says what it dropped |
Knowledge exchange |
|
Two of these are off until an operator turns them on. ECHO_MEMORY_TRUST_RETRIEVAL and
ECHO_MEMORY_LESSONS default off, as does the graph wide write gate behind
ECHO_MEMORY_MAX_GRAPH_WRITERS, which costs 2.6x write throughput when on.
What "in the engine" means, exactly. Each of these is a Python API plus its tables,
and echo-memory exchange is the only one with a command. This release still registers
exactly 7 MCP tools, with the names and parameters 0.5.7 had, so nothing above reaches an
agent until something calls it: your own code, a future command, or the hosted service.
The event door in particular is an acceptance policy and an inbox, not a socket; a CI job
cannot post to the engine. docs/INTELLIGENCE.md names the entry point, or the absence of
one, per capability.
docs/INTELLIGENCE.md is the guide: the API for each, what it
costs, every environment variable, and a section per capability on what it does not do.
Numbers, and how they were taken
Every figure comes from this repository or a live store, with the command that reproduces it on yours and the size of the store it was taken against. The corpus is small and the noise floor is stated, because a difference nobody sized is not a result.
Two of these describe the store rather than the product. eval --context and
eval --ablate build their queries from the facts they are scoring, so the labels are
free and the absolute values belong to this store alone; they are honest about a
difference between configurations and say nothing about how echo-mem would rank on
somebody else's data. The two external rows are the ones to compare against anything.
Measure | Value | Reproduce |
Context per recall vs injecting everything | 96.7% less on a 325 fact store, hit@10 0.872 over 1,190 queries derived from their own answers, so read it as a token ratio with a floor attached rather than as accuracy |
|
The same saving across 8x of corpus growth | 75.5% at 32 facts rising to 96.4% at 261, hit@10 0.900 to 0.946 |
|
LoCoMo retrieval, 1,982 questions, 5,882 turns | recall@10 0.643, hit@10 0.700, MRR 0.485, session@10 0.907 |
|
LongMemEval retrieval, 90 questions, 15 per type | session@10 0.937, recall@10 0.727, MRR 0.428 |
|
Lexical BM25 against | +0.0271 MRR on entity_pair [+0.0083, +0.0481] and on multihop [+0.0166, +0.0381], the other two shapes inside noise, none worse |
|
Server side model calls per write | 0 |
|
Write, query, digest latency (median) | 24ms, 17ms, 4ms, against a 250 fact scope |
|
Entity resolution AUC | 0.666, 95% CI [0.421, 0.881] |
|
That last row is the one that went the wrong way, and it is here on purpose. The interval includes chance, so the unattended merge is switched off: at the automatic bar precision was 50% over two reviewed pairs, and the audit log showed that path had fired once in the system's entire history. A near match is now offered for confirmation instead.
The LoCoMo row is retrieval, not QA accuracy. Published LoCoMo results have a model write
an answer and a second model judge it; this asks only whether the turn holding the answer
came back, which is a ceiling on QA accuracy rather than a substitute for it, and is not
comparable to anybody's published QA figure. It also feeds raw dialogue turns, which skips
the extraction step this design pushes to the calling agent, so it is a floor as well as a
ceiling. The worst row, multi hop at recall@1 0.099, is in
docs/BENCHMARKS.md with the rest.
The context saving is measured against a specific baseline, stated so it cannot be read as more than it is. Not "no memory at all", which is however long a human spends re explaining and is unmeasurable. It is the thing people do instead: keep the project's notes in one file and paste the whole file. On that store the file is 325 facts, about 41,838 tokens; a recall returned 1,372 on average. The hit rate belongs beside it, because a recall that returned nothing would score 100%.
The graph
Memory is a graph, not a list of notes. Entities are nodes; a fact is an edge between two of them. That is the whole data model, and everything else follows from it.

Three projects here. checkout-api, mobile-app and data-pipeline were recorded in
separate sessions and never told about each other, yet the picture already separates them,
because separation is a property of the edges rather than a label anyone applied.
Clusters come from structure. Densely connected facts are grouped by label propagation
over the edges, and each cluster is named after its most connected node. That is why
data-pipeline sits apart: nothing it knows touches payments. It is also why
checkout-api and mobile-app share a cluster despite being different codebases. They
genuinely share an idea, and the graph found it rather than being told.
Components are the stronger claim. Two nodes in different components have no path between them at all, which is the strongest statement this graph can make that two memories are unrelated.
Click a node: everything it takes part in

idempotency keys is the largest node here and nobody made it large: seventeen facts from
several services resolved onto one entity by name. The panel lists every one, with which
agent wrote it and when.
Click a link: why memory believes it

Not a tooltip. Who wrote the fact, in which project, when, and how each of its entities
resolved. echo-memory why <fact_id> prints the same trail in a terminal.
Seeing your own
echo-memory dashboard --serve --openThe images above come from a synthetic dataset (scripts/demo-seed.py) rather than a real
store, for the obvious reason: a real memory graph is full of hostnames, account numbers
and client names.
Wiring more than one tool
Give each client its own ECHO_MEMORY_AGENT_ID. Cursor should say cursor, Claude
Desktop claude-desktop. Memory is shared either way, but a fact records which tool
learned it, and two tools claiming the same id makes cross tool recall impossible to see
afterwards.
echo-memory adopt # every MCP client on the machine, each with its own id
echo-memory install [path] # one project: MCP config plus a skill, committed with the codeadopt shows the diff before writing anything. For an agent that does not speak MCP, see
docs/INTEGRATIONS.md.
Is the graph in good shape?
echo-memory healthA score, what is strong, what needs attention, and what to do about each, including what
recall has cost: how often memory was read, how often a read returned anything, roughly
how many tokens were injected, and how many saves those reads produced. Writes were
counted from the start; reads were not counted at all, so nothing could answer whether
recall earns what it costs. It exists to be run when you have no question, because a store
can look healthy by every other number while most of its facts came from a bulk import,
the last real write was a week ago, and only one of several wired agents has ever written
anything. --json for machine readable output.
Nothing in it is gated. The paid plan sells hosting; diagnostics about your own data are not a thing to withhold from the person whose data it is.
Architecture
Storage PostgreSQL with pgvector and Apache AGE, from a single local agent up to an
organisation wide shared graph, with no forced migration later. The novel work is the
memory structure and the read/write algorithm on top of it, not a new database engine.
Retrieval Hybrid vector and full text search fused by reciprocal rank in v1a, with
the full text side ranked by BM25 computed in SQL over per scope corpus statistics.
Personalised PageRank via networkx lands in v1b for multi hop associative retrieval.
Interface Model Context Protocol, so any compliant agent reads and writes the same graph.
Status
Early and staged, on purpose. See docs/designs/ for the architecture
and the v1a to v1b plan.
v1a, built | Basic recall. Seven MCP tools, 40 CLI commands, on PyPI and in the MCP registry. |
v1b, part built | Causal typing and |
v1c, designed | Consolidation: hot, consolidated and archived tiers, so retrieval cost stops tracking total facts written. Nothing implemented. |
v1.1, planned | Organisation wide tenancy: per agent, per team, or org wide graphs. |
The validated wedge driving v1a is memory shared across coding agents, which is the author's own daily pain and the case with the most evidence behind it. Everything else is the target this architecture is built toward.
Hosted
app.echo-mem.com runs the database for you: $149 a month for 1,500,000 units, where a unit is one fact written or one fact returned. It is paid from the first key, because hosting is the thing it charges for, and it runs the same published package you would install yourself.
Running it yourself is free, for anything, at any size, with no account and no feature held back. Apache 2.0 attaches no employee count, no revenue threshold and no agreement to that. If you want the database run for you, or a commercial arrangement around it, talk to us by choice rather than by obligation.
See CONTRIBUTING.md. Issues and pull requests welcome; please read the
design docs first so proposals fit the staged build plan. Commits need a sign-off line,
git commit -s, which is the Developer Certificate of Origin. There is no
contributor agreement to read.
The most useful contribution is a measurement that disagrees with one of the numbers
above. Run echo-memory eval, calibrate or benchmark on your own store and open an
issue with the output.
License
Apache 2.0. See LICENSE. Run it, fork it, build on it, ship it in your
product, at any size, with no agreement and nobody to ask.
For about a month this was not true. Versions 0.5.0 to 0.5.5 shipped under the Business Source License, which made production use free only below fifty people and $5M of revenue. That is withdrawn. Ateleir Tech holds the copyright in the whole work and relicenses all of it, those versions included, so the grant only ever got wider and nobody lost a right they already had.
The reasoning, since a project that changes its licence twice owes you one: the restriction was protecting the wrong thing. What makes this hard to run is not the source, it is a Postgres with Apache AGE and pgvector that somebody has to operate, back up and upgrade. The hosted plan sells exactly that and is unaffected by the licence. Meanwhile the restriction was costing the thing the project most needs, which is for people to be able to use it without reading a grant first.
What is not Apache 2.0 is the hosted service itself: the metering, billing and tenancy that only exist because somebody is being invoiced. None of it sits in the read or write path.
mcp-name: com.echo-mem/echo-mem
Available Tools
7 toolsget_audit_logAInspect
Human-readable audit trail: what was written, invalidated, superseded,
or resolved, and why. since is an ISO8601 timestamp; entries at or after
it, chronologically ordered. At most 500 entries; truncated in the
result says when the log went on past that, and since is how to page.
Inputs: scope (required), since.
mark_ingestedBInspect
Close pending documents once their content is in the graph.
Pass the same session_id you pass write_episode. Closing a document is one of the two valid answers to a capture prompt - the other is writing the facts - so without it the gate that asked cannot tell a session that complied from one that ignored it.
The other half of pending_documents, and it exists because the queue could not be closed by the tool that had just drained it. On 2026-09-12 Codex read a pending note, wrote its facts correctly, and reported: "Its pending marker couldn't be cleared because the local echo-memory command wasn't available." It was right - marking done was CLI-only, so a tool that could do the hard half could not do the trivial one, and the file stayed queued for a tool that happened to have a shell.
Paths that are not in the queue are reported rather than silently ignored, because a mistyped path that returns success leaves a document queued forever while the caller believes it is done.
Inputs: paths (required), session_id.
pending_documentsAInspect
Memory files this project has written that are not in the graph yet.
A hook notices a file the moment it changes; turning it into entities and facts needs a model, so it waits here for one. Read each path, call write_episode with what it states, then mark_ingested to close it.
Claude Code is told about this queue at session start by a hook. Nothing tells any other tool, so this is how they find out at all.
Inputs: project.
query_memoryAInspect
Recall prior facts relevant to query, from this agent's own memory (scope="solo") or the pool shared across this user's agents (scope="shared"). Call this at session start, and any other time recalling prior context would save the user from re-explaining something.
digest=True ignores query and returns the most recently written active facts, an opt-in "catch me up"; never automatic.
as_of (optional): unix seconds. Answers with what this scope believed at that moment, including facts later superseded. Nothing here is ever rewritten, so use it for "what did we think was true when this was decided".
about (optional): one or two entity names. Returns only facts that ARE about them, not facts resembling your query. One name gives that entity's facts, two gives the facts between them, either direction: about=["Kohli"] or about=["Kohli", "Bumrah"]. At most two names, matched exactly and case-insensitively, never partially. A name nothing is recorded under returns no facts rather than the nearest thing, and so does a pair with no fact joining them: real absence, not something adjacent. Use it when you know whose fact you want, because resemblance cannot tell one entity from a similar one.
Each fact carries rank (1 first), score and matched. If you must drop facts to fit a budget, drop by rank: it is the fused result of every channel, and re-sorting by score throws that away. score is cosine similarity to your query, comparable across queries, diagnostic not a correctness test: a keyword match can be right at a low score. matched names the channels that found it; full text search is not the weaker one.
pending_ingest appears when memory files exist that the graph hasn't heard
about. Read each listed file, call write_episode with what it states, then
echo-memory pending --done <path>. The queue exists because extraction
needs a model and this server never calls one.
Inputs: scope (required), about, as_of, query, +2 more.
record_recall_saveAInspect
Record that a fact you recalled from memory saved the user from re-explaining something to you.
Call this IN THE SAME TURN, the moment it happens. The trigger is concrete: you called query_memory (or read a memory-derived fact), it answered something the user would otherwise have had to tell you again, and the fact was originally written by a DIFFERENT tool or a past session.
That is why this takes only a fact_id. Pass the one carried by the
query_memory result that helped; the server reads that edge's own agent_id
for the writer, and uses its own configured agent id for the reader. You
assert neither. Both used to be caller-supplied, and each in turn let the
model being graded type its own evidence.
The server also checks its read log for the fact you cite, and refuses an id no read in this scope has ever returned. Pass the id you were given, not one you remember.
If the fact's author and you are the same tool, the save is recorded but does not count - recalling your own note from ten minutes ago is not the thing being measured.
note should be one sentence naming what it saved re-explaining, written so it still makes sense read cold in six months. Recording the identical note twice is a no-op, so a retry after an error is safe.
Do NOT call this speculatively, for a fact you wrote this session, or because a recall was merely interesting. It is evidence for a gate that decides real build work; an inflated count is worse than an empty one.
Inputs: note (required), scope (required), fact_id (required).
trace_causeAInspect
Why something happened, not what resembles it. Follows the causal links
recorded on facts about subject and returns them as chains, ordered from
the subject outwards.
Use this when the question is "why", "what did this break", "what was this a consequence of", or "what happens if we undo it". query_memory ranks facts by similarity and returns a flat list, which cannot answer those - the chain is the answer.
direction: "upstream" for what led here, "downstream" for what followed, "both" for both. max_hops: 1 to 6, default 3.
causes/effects are chains, each a list of facts. contradictions are facts explicitly recorded as contradicting one of the matched entities.
Only links a caller recorded are followed. Nothing here infers a cause, so an empty answer means nobody asserted one - not that none exists. Pass causal_hint on a fact in write_episode to make it traceable.
Inputs: scope (required), subject (required), max_hops, direction.
write_episodeAInspect
Record something worth remembering later: a decision, a correction, a stated preference, or context that would otherwise be re-explained to another tool or a later session. Call it the moment you notice one, not batched and not at the end. You extract the entities and facts; this server never infers.
entities: name non-empty, unique within this call type any short string ("tool", "person", "decision") - not an enum
facts: source/target must each exactly match a name in entities relation_type any short string ("uses", "decided") - not an enum fact the sentence to remember, plain text confidence exactly one of "extracted" (stated), "inferred" (deduced), "ambiguous" (uncertain). Anything else, or a number, is rejected. causal_hint optional, only when the session said so: caused_by, led_to, enabled_by, blocked_by, contradicts. What trace_cause walks. Omit when merely associative.
entity_resolutions (optional): only after a call returned ambiguous_entities, to say which candidate a mention meant: {"mention": {"resolved_to": "<node_id>" | "new"}}. Omit otherwise.
assume_new (optional): True when every entity here is new. Answers "new" up front so the call cannot come back asking. Explicit resolutions win.
In the reply: stored is true only if the graph changed; when false,
not_stored says why and retryable says whether to send it again. A
call that returns is not a fact that stored. related_entities names
what this scope already calls these things; prefer them.
Example: write_episode(scope="solo", session_id="s1", entities=[{"name": "Postgres", "type": "tool"}, {"name": "Decision", "type": "decision"}], facts=[{"source": "Decision", "target": "Postgres", "relation_type": "uses", "confidence": "extracted", "fact": "decided to use Postgres for storage"}])
Inputs: facts (required), scope (required), entities (required), session_id (required), +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool occupies a distinct role: write_episode ingests, query_memory recalls by similarity, trace_cause walks causal links, pending_documents/mark_ingested form an explicit open/close pair on the same queue, and get_audit_log and record_recall_save are clearly separate reporting paths. The descriptions actively pre-empt the main confusion (query_memory vs trace_cause) by stating that a ranked flat list cannot answer causal questions. No two tools appear interchangeable.
Six of seven names follow a verb_noun snake_case pattern (query_memory, write_episode, get_audit_log, mark_ingested, record_recall_save, trace_cause). pending_documents deviates as a bare noun phrase, though it reads naturally as a queue-listing operation and mirrors mark_ingested as its counterpart.
Seven tools is tightly scoped for a memory server: one write path, one read path, one causal path, one audit path, one ingest pairing, and one evidence-recording path. Each tool has a distinct justification and none appear redundant or vestigial.
The surface covers the full memory lifecycle implied here: capture queue, write, recall, causal tracing, audit, and recall evidence. The notable gap is the absence of an explicit invalidate/forget/supersede tool, even though get_audit_log reports invalidations and supersessions — an agent has no direct operation to retract a fact, only to write new ones.
Maintenance
Related MCP Connectors
Long-term memory for AI agents: durable records, observable retrieval, governed context assembly.
Graph-native persistent memory for AI agents — 33 MCP tools, zero-LLM writes.
Long-term memory for AI agents: semantic facts, episodic events, and procedural workflows
Persistent long-term memory for AI agents: semantic search, knowledge graph, and task canvas.
Related MCP Servers
- AlicenseBqualityBmaintenanceCausal graph memory engine for AI agents. Scores memories using relevance × connectivity × reactivation, connects them in a causal graph, and actively forgets irrelevant ones. 11 MCP tools including store, recall, search, traverse, and explain.1332 PyPI31AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceA neuro-inspired long-term memory architecture for AI agents.121 PyPI3MIT
- AlicenseNot gradedqualityCmaintenancePersistent memory infrastructure for AI agents, enabling cross-session recall and autonomous memory evolution via an MCP server.1MIT
- AlicenseAqualityBmaintenanceAn MCP server providing long-term memory for AI agents with forgetting curves, consolidation, and graph-based retrieval.10MIT