ambient memory for Claude Code & AI agents
ngram captures what your agent learns, distills it into reconciled facts, and recalls it with receipts, including what it believed at any point in the past.
# same question, two points in time: both answers are true
POST /api/v1/ask {"question": "which port does the gateway listen on?"}
→ The gateway listens on port 9090 [1].
POST /api/v1/ask {"question": "…", "as_of": "2026-06-15"}
→ The gateway listens on port 7070 [1].
# nothing was deleted: the correction closed one fact and opened another
· six recall signals, every score explained
· append-only history, enforced by the database
· dashboard, REST, MCP and a Claude Code plugin
01
Hooks in Claude Code capture as you work, with no “remember this” required. MCP tools for agents, a REST API for everything else. Raw conversations stay archived alongside what gets extracted.
02
A single-pass extractor distills atomic facts with their entities, typed relations, kind and keywords. New facts reconcile against old ones: updates rewrite, contradictions retire. Every destructive change must pass an independent audit before it applies.
03
Hybrid recall fuses six signals: semantic, lexical, entities, recency, salience, graph. It shows you every one. Or just ask: answers come grounded in memory only, with citations.
When a fact is corrected or contradicted, ngram closes its validity interval instead of deleting it. The history log is append-only: the database itself refuses updates and deletes. The past stays exactly as it was believed.
Search and ask accept as_of: point-in-time recall over the facts of that moment, with each memory’s era-correct
text reconstructed from the log.
The Timeline shows it all: the state at any date, every change in a window, and the facts that get rewritten most.
# the event log for one fact, oldest first
ADD the gateway listens on port 7070
UPDATE the gateway listens on port 9090
FOLD detail compressed into its summary, recoverable via as_of
# UPDATE / DELETE on this log → rejected by trigger
Storage is the easy part. Every night, ngram re-reads what it knows and makes it better.
Each night, ngram writes down the questions every memory answers, and indexes those too. Queries are questions; now the index speaks their language.
Related facts consolidate into higher-level insights, recursively; each summary is audited for faithfulness before it is admitted. Old, cold, already-summarized detail folds into its gist: lossy in the present, lossless in the past.
Memories that get recalled grow stronger. Untouched ones fade toward a floor: attention, not deletion. Durable kinds like decisions and preferences age slower by design.
ngram learns each fact’s revision rate from its own history, and knows which values to distrust. Then it says so, out loud, when it answers.
/ask answers from your memories and nothing else. Every claim cites the memory it came from. When
memory is silent, it says so instead of improvising.
And because ngram tracks how often each fact changes, volatile values come with a warning: the answer itself tells you when to double-check.
“how many events per batch does the ingest accept?”
The ingest endpoint accepts batches of up to 500 events per request [1] (this value changes often and was last confirmed 20 days ago).
“what is our Q3 hiring plan?”
I don’t know based on the stored memories.
Every hit carries its full breakdown: why it ranked, signal by signal.
"signals": { "semantic": 0.66, "bm25": 1, "entity": 0, "recency": 0.14, "salience": 0.12, "graph": 0 }
Each source records what was extracted, what was proposed, what the audit blocked, and what actually applied.
processed · 3 added · 1 updated · audit blocked 1 operation
Facts link to entities; entities link to each other with the verbs the facts actually stated.
Borealis API ─requires→ mTLS · Lena ─leads→ platform team
Every memory shows its learned half-life and revision count, right next to its salience.
Stability · half-life ≈ 15 d · 2 revisions
The dashboard for humans, REST for services, MCP tools for agents. Every surface reads and writes the same memory, so what one agent learns, the next one knows.
Organizations, projects and scoped API keys keep teams and agents in their lanes. Humans sign in with GitHub; agents authenticate with keys; MCP speaks OAuth too.
The Claude Code plugin bundles it all: MCP tools for deliberate memory, lifecycle hooks for the ambient kind.
# tools your agent already knows how to use
search_memory · ask_memory · add_memory
get_memory · get_source · list_projects
# and the ones it never has to think about:
# hooks capture the session as you work
The recall benchmarks, the extraction eval and the weight-fitting harness ship in the repository. Baselines are frozen and deterministic: two consecutive runs are bit-identical. And when an experiment doesn’t improve the numbers, the README says so.
bench/ · bun test · frozen baselines