1. Executive Summary
Sno Station runs Claude Code, Codex, Cursor, Gemini, Hermes Agent and
OpenClaw as one team, and its memory is the part they share.
@snoai/memory is a local HTTP sidecar on 127.0.0.1 over one
SQLCipher-encrypted SQLite file. Each host adapter captures finished
sessions into it and injects recalled memory at session start and before
each prompt, scoped to the current repository plus a global scope.
Notable: a correction writes a successor and closes the old row in one transaction, and automatic recall leaves the closed row out while manual recall shows it as retired. A nightly pass merges duplicates, closes replaced facts and deletes rows it judges not worth keeping. It backs up first, journals every verdict, and applies a change only after a second model, another vendor's agent when one is connected, confirms it. Lifecycle events go to a table whose triggers refuse updates and deletes.
Weak: a deletion leaves nothing that a later capture consults, so the same words come back; the table that would refuse them by content hash or key has no shipped caller. Rows that extraction parks are never served and never promoted. No workflow runs the test suite.
Four marks are present and three are withheld (section 9).
Licence. Apache-2.0 in LICENSE, with
NOTICE reading "Copyright 2026 Sno AI"; no rider.
SECURITY.md asks for vulnerabilities to be reported
privately by email and says not to open a public issue.
2. Mental Model
A memory is a row in nodix_memories: text, category,
project, a lane, an optional subject and attribute, an optional validity
window, and metadata
(packages/memory/src/store/schema.ts:133-160). Whether the
agent sees it depends on four things at read time: the lane is
active, no superseded_by is set, no
invalidated_at lies in the past, and the project is the
caller's or global
(packages/memory/src/store/memory-store-chunk-search.ts:76-110).
Rows enter in one of two ways. In Local First mode every message of a
finished session is stored verbatim as an episodic row. In the model
modes, an extraction pipeline proposes atomic records, keys profile
facts to a fixed attribute vocabulary, asks a model whether each
user-subject record is a durable self-statement, and parks what fails
(packages/memory/src/engine/extraction/atomic-memory-extraction.ts:1659-1702).
A parked or quarantined row is kept for diagnosis and never served.
Rows leave by supersession or deletion. A correction, an arriving fact about the same one-valued attribute, or a nightly replacement closes the older row and keeps it. A nightly duplicate or admission verdict, or an explicit delete, removes it.
Diagram source
%% caption: capture writes rows verbatim or through extraction; recall serves active, open rows of the project and global; the nightly pass closes or deletes a row only when a second model agrees
flowchart TD
HOOK["Session ends or<br/>is quiet 30 min"] --> MODE{"model calls<br/>enabled?"}
MODE -- "no" --> VERB["Local First:<br/>each message verbatim"]
MODE -- "yes" --> EXT["Extraction:<br/>key, guard, park"]
EXT --> SUP{"suppressed key<br/>or content hash?"}
SUP -- "match" --> SKIP["not written"]
SUP -- "none" --> ROW["Memory row<br/>lane, validity"]
VERB --> ROW
COR["correct: successor<br/>closes old row"] --> ROW
ROW --> REC{"active, open,<br/>project or global?"}
REC -- "yes" --> CTX["Injected block,<br/>framed as data"]
REC -- "no" --> OUT["not served"]
NIGHT["Nightly pass<br/>backup first"] --> CONF{"second model<br/>confirms?"}
CONF -- "yes" --> MUT["close or delete,<br/>journal and event"]
CONF -- "no" --> UND["journal undecided"]
MUT --> ROW3. Architecture
packages/memory is the engine.
src/sidecar/server.ts starts an HTTP server on 127.0.0.1 at
a random port, writes the port and a 32-byte random token to a discovery
file, and answers every path except /healthz with 401
unless the x-sidecar-token header matches
(packages/memory/src/sidecar/server.ts:176,
:408-411, :722-731). Nine /v1/*
routes map onto ContractRuntime
(packages/memory/src/contract/routes.ts:4-14,
packages/memory/src/engine/contract-runtime.ts), and
/rem/run queues the nightly pass.
The store is SQLite opened through @snoai/sqlite-crypto
(better-sqlite3-multiple-ciphers, SQLCipher compatibility
4), with sqlite-vec for chunk vectors and FTS5 for keyword search.
Embeddings and the reranker run locally through
@snoai/embedder. The six adapters under
apps/mem-* are clients: four install hooks and a
sno memory CLI, mem-claw registers OpenClaw
tools, and mem-hermes is a Python memory provider.
Deployment and ergonomics
The sidecar starts on demand from whichever adapter needs it and
serves every host on the machine. Three modes decide where model work
goes. Local First calls no model. Agent Native routes extraction and the
nightly judgements to the host agent itself. REM Enhanced uses Sno's
hosted models and uploads memory text to the user's space in Sno's cloud
(docs/security.md:5). The shipped
settings.default.json sets agent-native
(packages/memory/settings.default.json:2); the README says
setup selects Local First. In Agent Native, the default settings also
upload the day's sessions each night for Self Learning
(docs/security.md:5).
4. Essential Implementation Paths
- Authenticate. Token header compared with the
discovery token before any routing
(
packages/memory/src/sidecar/server.ts:408-411). - Resolve scope.
projectmaps a workspace path to a project id throughresolveProviderIdentity;scopePolicyreturns a policy that writes there and reads it plusglobal(packages/memory/src/engine/contract-runtime.ts:223-238). - Capture.
capture→onAgentEnd: verbatimrunLocalFirstCapturewhen extraction is off, otherwiseextractAndPersist(packages/memory/src/engine/contract-runtime.ts:290-323,packages/memory/src/engine/bindings/sno-station-mem-ambient-learning-hook.ts:40-121,:126-259). - Write extracted cards.
commitPreparedAtomicExtractionWrite: suppression check, insert, close on arrival (packages/memory/src/store/memory-store-atomic-extraction-write-api.ts:977-1009). - Recall.
autoRecall→retrieveForAutoRecallwithexcludeSupersededandexcludeInvalidatedBefore, an optional host-model pick, and a per-session ledger so a memory is injected once (packages/memory/src/engine/contract-runtime.ts:394-529,packages/memory/src/engine/retrieval/rem-consumer-retrieval.ts:247-288). - Correct and undo.
MemoryStore.correctandundo(packages/memory/src/store/memory-store-correct-api.ts:65-160). - Nightly pass.
runPrecisionNightSteps, behind the backup gate in the batch executor (packages/memory/src/engine/precision-night.ts:697-705,packages/memory/src/sidecar/rem-batch-executor.ts:75-104).
5. Memory Data Model
nodix_memories: id, text, category,project_id, importance, timestamp, timezone, metadata,content_hash,fact_id,lane(active,parked,quarantined),disposition_reason, subject, attribute,valid_from,valid_until, maturity, source, extractor version (packages/memory/src/store/schema.ts:133-160). A unique index covers project, content hash and category (packages/memory/drizzle/0008_widen_memory_hash_unique_index.sql:3-4).nodix_memory_relations: subject, one of 23 predicates, object, cascading from the source row (packages/memory/src/store/schema.ts:204-239).nodix_memory_suppressions: project with either subject and attribute or a SHA-256 of the text (packages/memory/src/store/schema.ts:251-257).nodix_atomic_extraction_ledger: one row per conversation chunk and pipeline version, so a chunk is extracted once.nodix_memory_events: the lifecycle and usage log, with receipt HMAC and key version (packages/memory/src/store/schema.ts:465-487).nodix_rem_journal: one row per nightly or extraction decision with stage, outcome, row id, reason and JSON detail (packages/memory/src/engine/rem/schema.ts:5-19).- Precision tables: per-place work or chat mode, the agent's loaded
instruction files, and a verdict per memory and file (
said,not-said,opposite).
Metadata carries superseded_by,
superseded_at, supersede_reason,
invalidated_at, asserted_by for statements the
assistant made, and a source_order that ranks statements by
when they were said rather than when they were written
(packages/memory/src/store/memory-source-order.ts:232-281).
6. Retrieval Mechanics
The retriever runs a sqlite-vec nearest-neighbour search and an FTS5
BM25 search over chunks, each filtered in SQL to the active lane and the
readable projects, then fuses them by weighted raw scores. A comment
records why it is not rank-based fusion: rank fusion measured 65%
against vector-only's 84% on LoCoMo
(packages/memory/src/engine/retrieval/retriever-search-modes.ts:376-418).
A local cross-encoder reranks at most 32 candidates
(docs/security.md:5).
Automatic recall adds excludeSuperseded and drops rows
invalidated before the request, then checks superseded_by
again on each row
(packages/memory/src/engine/retrieval/rem-consumer-retrieval.ts:262-283).
At the prompt, candidates pass a relevance floor, or a host-model pick
that prefers the owner's words over the assistant's
(packages/memory/src/engine/contract-runtime.ts:531-552).
An assistant-asserted line is labelled "said by the assistant, not
confirmed" (:496). A row that a nightly judgement found to
be said, or contradicted, by a loaded CLAUDE.md or
AGENTS.md is skipped (:571-578).
Session start uses a nightly ranked list of global rules and people
and project rules and pitfalls, leaving out assistant-asserted and
dropped rows
(packages/memory/src/store/session-start-selection.ts:5-30).
Manual recall returns retired rows marked with their successor.
The validity window is not a serving filter:
temporalExpiry defaults to off
(packages/memory/src/engine/retrieval/retrieval-config.ts:155).
7. Write Mechanics
The Claude Code adapter spools turns and captures a session once it
has ended or been quiet for 30 minutes
(packages/memory/config/coding-skin.ts:33,
apps/mem-claude/src/worker.ts:249-258). The capture route
does not cancel when the hook exits, so the agent never waits for
extraction
(packages/memory/src/sidecar/memory-routes.ts:22-23).
Subagent sessions and sessions under the system temporary directory
write nothing
(packages/memory/src/engine/bindings/sno-station-mem-ambient-learning-hook.ts:149-160,
apps/mem-claude/src/scope.ts:11-21).
Local First stores each user and assistant message
as its own episodic row, deduplicated by content hash. A text whose row
was retired by a correction is skipped, not revived
(packages/memory/src/store/memory-store-persistence-api.ts:173-182,
:246-257).
Model modes run extraction over chunks: a generic
pass, a numeric sweep, a re-split of compound records, profile keying,
and a subject guard that parks a user-subject record the model does not
confirm as a durable self-statement
(packages/memory/src/engine/extraction/atomic-subject-guard.ts:177-188).
Before each insert the writer looks for a suppression on subject and
attribute or on the text's hash, and skips a match
(packages/memory/src/store/memory-store-atomic-extraction-write-api.ts:167-186,
:990-997). For a one-valued attribute, a card that arrives
after a later statement is closed on arrival; otherwise it closes the
older open rows (:438-494).
Correction checks the target is readable, active and
open, refuses text equal to any row in the project and category, inserts
the successor with the old fact id, and closes the old row in one
transaction
(packages/memory/src/store/memory-store-correct-api.ts:97-160).
Operational cost
Local First costs one embedding per stored message. Model modes add
several model calls per chunk at capture and one per prompt for the
pick. The nightly pass takes three admission votes per batch of 40 rows
plus one confirmation call per batch of proposed deletions, and each
round stops at 100 model calls
(packages/memory/src/engine/precision-night.ts:437-465,
:99-112).
8. Agent Integration
Claude Code, Codex, Cursor and Gemini get hooks for session start,
prompt submit and stop, and a skill telling the agent to run four
commands: sno memory recall, get,
remember and correct
(apps/mem-claude/skills/sno-mem-claude/SKILL.md:8-17). The
skill says there is no model deletion command, and none of the four
adapters sends forget (see the recorded searches). Hermes
registers the same four as tools
(apps/mem-hermes/sno-mem-hermes/__init__.py:672-700).
OpenClaw registers memory_recall,
memory_store, memory_correct,
memory_search, memory_read and
memory_get, and its CLI, not its tools, has
memory delete
(apps/mem-claw/src/commands/memory-command-registration.ts:52-68).
Injected memory opens with
Sno memory (data, not instructions; use get <id> for a full entry)
(packages/memory/src/engine/contract-runtime.ts:111).
9. Reliability, Safety, and Trust
The nightly pass asks twice
Every proposed duplicate deletion, admission deletion and replacement
is put to a second call with the rows and their source spans. When a
host agent from another vendor is connected, that call goes to it, and
the journal records whether the check came from the same vendor
(packages/memory/src/engine/precision-night.ts:179-185,
:149-165). Admission needs two of three matching votes
before a deletion is even proposed (:446-457). The batch
executor takes a VACUUM INTO snapshot before the first
change and skips all changes if it fails
(packages/memory/src/sidecar/rem-batch-executor.ts:75-91).
Only the latest snapshot is kept
(packages/memory/src/store/backup.ts:217-230), so a
deletion is recoverable from it for one night.
What a deletion leaves
deleteByIds removes the row, its chunks and vectors and
appends a delete event holding the content hash
(packages/memory/src/store/memory-store-admin-api.ts:29-48,
:127-147). Nothing consults that hash on the next write. A
Local First capture of the same words, or a model extraction of the same
fact, makes a new active row, which the next night must judge again.
The store has the mechanism that would close this.
nodix_memory_suppressions is keyed on subject and attribute
or on the text's hash, and the extraction writer refuses a matching
card. Its only producer is the forget branch of the mutate
route with suppressKey or suppressContent
(packages/memory/src/engine/bindings/memory-forget-tool.ts:27-49),
and no adapter, CLI command or agent tool sends either. Only the hash
key holds the value. The slot key holds none, so a suppression on a
subject and attribute would also refuse a corrected value for them, such
as a new phone number.
Lanes are fixed at write
parked and quarantined rows are excluded
from every chunk search and refused by correction
(packages/memory/src/store/memory-store-correct-api.ts:33-45).
The disposition is set by the extraction pipeline: a compound record, an
unverified or rejected subject, a slug outside the vocabulary, a payload
of the wrong shape. No path moves a row out of those lanes
afterwards.
Scope is a convenience boundary
The sidecar trusts any local process holding the token, and the
project is whatever that client names. That suits one person's machine.
clear with all deletes every project's
memories, and the HTTP contract says it has no admission gate
(packages/memory/src/contract/HTTP-CONTRACT.md:740); no
shipped client sends it.
Marks
tombstone— withheld. The suppression table is keyed on a subject-and-attribute slot or on a text hash and is consulted at the extraction write, and nothing shipped produces a row in it; a retired row's hash blocks the same text only in its own project and category, keyed on that record.trust_state— withheld.lanewithholds parked and quarantined rows from every read, and is fixed at write;asserted_bylabels and is left out of session start, and is a speaker attribution, not a status.bitemporal— present. A validity window in columns beside the system'ssuperseded_at, with retirement by source order; set only by model extraction and correction.scope_enforced— present. Project plus global on every read; the project is caller-named.audit_log— present. Lifecycle events under database triggers, beside the nightly journal; corrections log only the successor.human_review— withheld. Every nightly decision is taken by models.resolveReflectionhas no client caller, and nothing waits for a person.negative_eval— present. A corrected value, a sibling project's rule, and parked and retired rows asserted absent from populated results.
10. Tests, Evals, and Benchmarks
tests/packages/memory holds 310 Vitest files with 1,939
cases, and the six adapter trees add 658. Most run against a real
encrypted store, many through the sidecar's HTTP routes. The HTTP
contract's field tables are checked against the Zod schemas by a test.
No workflow under .github runs them: ci.yml
installs and builds the workspace and the two standalone packages, and
nothing else (.github/workflows/ci.yml:21-26). I ran none
of them.
evals/ commits receipts for LoCoMo, Memora, LongMemEval
retrieval and a 23-probe product bench, each with per-question evidence
and the statement that the harness is not included. The LoCoMo receipt
reports 96.76% over 1,542 questions and says it merges reruns of wrong
answers (evals/locomo/README.md:5-9). I counted the rows:
1,492 are CORRECT, and 1,350 of those come from the first
full run, so that run scored 87.5%; ten later runs supplied the
rest.
Cases to want first: a deleted text captured again, asserting it is
not served; a forget with suppressContent driven from a
shipped client; and a CI job that runs the integration suite.
No paper describes Sno Station; CITATION.cff is absent,
and the README cites three papers as related work
(README.md:635-637).
11. For Your Own Build
Steal
- Close and create in one transaction, and give the successor the old fact id. History, recall exclusion and the event trail then agree by construction.
- Order retirement by when a thing was said, not when it was written. A source order on every row lets a late-arriving older statement close itself instead of the later one.
- Ask a second model, from another vendor where possible, before any destructive maintenance, and journal the undecided cases too. The journal then shows what the night declined to do.
- Guard the event table in the database. A trigger that refuses deletes of lifecycle rows and lets usage rows age out separates retention from audit.
Avoid
- Do not ship the tombstone without a door to it. A suppression table the writer consults and no client fills protects nothing.
- Do not let a write-time disposition become permanent. A parked row with no promotion path is a silent drop with extra storage.
- Do not keep only one pre-cleanup snapshot when deletions are model judgements; a mistake found two days later has no copy.
Fit
Fits one developer who uses several coding agents on one machine and wants them to share what they learn per repository, without running a service. The correction and nightly machinery are worth reading whatever the product.
Walk away if a deleted memory must stay deleted, if several people share the machine or the store, if every memory must be reviewed by a person, or if no session text may leave the machine and the default mode cannot be changed.
12. Open Questions
- Whether a client is meant to send
suppressKeyandsuppressContent, and whether the nightly admission deletion should write one. - Whether parked rows are meant to be reviewable, given that correction refuses them.
- Why a correction writes no
supersedeevent for the row it closes when the other supersession paths do. - Whether the README's statement that setup selects Local First
matches the installer, given that
settings.default.jsonsetsagent-native.
Appendix: File Index
- Sidecar:
packages/memory/src/sidecar/server.ts,packages/memory/src/sidecar/memory-routes.ts,packages/memory/src/sidecar/rem-batch-executor.ts,packages/memory/src/sidecar/rem-trigger.ts - Contract:
packages/memory/src/contract/HTTP-CONTRACT.md,packages/memory/src/contract/inputs.ts,packages/memory/src/contract/routes.ts,packages/memory/src/engine/contract-runtime.ts - Store:
packages/memory/src/store/schema.ts,packages/memory/src/store/memory-store-persistence-api.ts,packages/memory/src/store/memory-store-correct-api.ts,packages/memory/src/store/memory-store-atomic-extraction-write-api.ts,packages/memory/src/store/memory-store-suppression-api.ts,packages/memory/src/store/memory-store-admin-api.ts,packages/memory/src/store/memory-source-order.ts,packages/memory/src/store/session-start-selection.ts,packages/memory/src/store/backup.ts,packages/memory/drizzle/ - Retrieval:
packages/memory/src/engine/retrieval/,packages/memory/src/store/memory-store-chunk-search.ts - Capture and extraction:
packages/memory/src/engine/bindings/sno-station-mem-ambient-learning-hook.ts,packages/memory/src/engine/extraction/atomic-memory-extraction.ts,packages/memory/src/engine/extraction/atomic-subject-guard.ts,packages/memory/src/engine/bindings/memory-forget-tool.ts - Nightly pass:
packages/memory/src/engine/precision-night.ts - Events:
packages/memory/src/engine/telemetry/memory-telemetry-events.ts,packages/memory/src/engine/operations/runtime-audit-log.ts - Adapters:
apps/mem-claude/,apps/mem-codex/,apps/mem-cursor/,apps/mem-gemini/,apps/mem-claw/,apps/mem-hermes/ - Tests:
tests/packages/memory/integration/mem-update.test.ts,tests/packages/memory/integration/memory-precision-capture.test.ts,tests/packages/memory/integration/memory-precision-session-start-choice.test.ts,tests/packages/memory/integration/memory-telemetry-schema.test.ts,tests/packages/memory/integration/group-crud-review-write-path.test.ts,tests/apps/mem-claw/integration/atomic-memory-suppression.test.ts - Evals:
evals/
Recorded searches
Run from the repository root at the pinned commit with
/usr/bin/git grep. .gitmodules is absent.
- No shipped client sends a suppression.
git grep -l -i -E 'suppress_?(key|content)'returns the HTTP contract,inputs.ts, the forget tool, its schema,contract-runtime.tsand one test,tests/apps/mem-claw/integration/atomic-memory-suppression.test.ts; nothing underapps/. - Every client mutation is store, correct, undo or an OpenClaw
delete.
git grep -n -E '\.mutate\(|"mutate"' -- appsreturnsexplicit.ts:58in four adapters,memory-command-registration.ts:65and:96andhttp-memory-tools.ts:53and:68inmem-claw, andsno-mem-hermes/__init__.py:1289, whose ops are get, store and correct. - No lane change after write.
git grep -n -E 'UPDATE nodix_memories SET.*lane' -- packages/memory/src packages/memory/drizzlereturns onlymemory-store-persistence-api.ts:264, which revives an active, invalidated row asactive. - No workflow runs the tests.
git grep -n -i -E 'vitest|npm (run )?test|test:' -- .githubreturns nothing; the same search fornpm run buildreturnsci.yml:22. - The valid-at query has no product caller.
git grep -n 'listAtomicValidAt' -- ':!tests'returns its definition and two declarations inmemory-store-base.ts. - No client resolves a reflection.
git grep -n 'resolveReflection' -- appsreturns nothing. - Self Learning is routed here and implemented
elsewhere.
git grep -n -E '"R[2-5]"' -- ':!tests'returnspackages/memory/settings.default.json:159-174andpackages/memory/src/model/model-call-table.ts:11only. - A correction logs no supersession.
git grep -n -E 'writeLifecycleEvent|writeReceiptEvent' -- packages/memory/src/store/memory-store-correct-api.ts packages/memory/src/store/memory-source-order.tsreturnsmemory-store-correct-api.ts:145only, acreate. - The nightly pass writes no events itself.
git grep -n 'telemetryEvents' -- packages/memory/src/engine/precision-night.tsreturns nothing; its deletions go throughdeleteByIds, which does. - Only usage events are deleted.
git grep -n 'DELETE FROM nodix_memory_events'returnspackages/memory/src/store/maintenance.ts:287, limited torecallandinject. - No paper.
git grep -n -i -E 'arxiv|doi\.org|bibtex' -- ':!evals' ':!docs/readme'returnsREADME.md:635-637and a chunk-size citation inpackages/chunking/src/chunk-config.ts:73.
History
2026-12-05 — 59eec6e5…
— corrected at the unchanged pin. The page called the suppression table
value-keyed; only its text-hash key holds the value, and its
subject-and-attribute key is a slot key that would refuse a corrected
value too. No mark changes.
2026-12-04 — 59eec6e5….
First reading, at the head of main on 2026-12-04. Screened:
no auto-run surfaces; five build-time execution points (four Makefiles
and the @snoai/memory postinstall that downloads a
tokenizer); nineteen dependency surfaces inside the cooldown; fourteen
floating surfaces, most with no lockfile beside them;
AGENTS.md read as data. Nothing was installed, built or
run, and none of the 1,939 memory test cases was run. Four marks (section 9).