A Markdown knowledge base whose agent memory is a category file a person can mute

Notarium

A self-hosted AGPL Markdown knowledge base with an MCP endpoint: agents append observations to per-category memory notes, versioned in one revision journal with people's edits.

LicenceAGPL-3.0-only in LICENSE, with a separately negotiated commercial licence offered in COMMERCIAL-LICENSE.md
Size156,615 lines of non-test TypeScript in the contract, core, engine, server and CLI packages and 74,247 in the React web client; the memory operations are packages/core/src/semanticOps/memory/memory.ts (331 lines) and recall/recall.ts (327)
Activity72 commits on main dated 2 August to 4 September 2026, all under the maintainer's account; the GitHub repository was created on 31 July 2026; version 0.2.0
Tests540 Vitest files, 312 beside the packages and 228 under test/; a GitLab CI file runs the suite with coverage and a job with a PostgreSQL service; none run here

Carries 3 of 7 rubric mechanisms. Most systems here carry none or one (41%), and a dash means the mechanism was not found at this commit — not that the system needed it. Each mark is one LLM reviewer's reading of the code at this commit rather than a run of it — known limits.

  • Tombstone
  • Trust state
  • Bi-temporal
  • Scope enforced
  • Mutation audit
  • Human review
  • Negative evals

1. Executive Summary

Notarium is a self-hosted knowledge base over plain Markdown, run as one container with a web editor and a built-in MCP endpoint. Agent memory is one note class among several. remember_about_user and remember_about_project append an observation to a note named after its category, in a reserved .notarium/memory/ mount that the agent cannot choose or leave. recall assembles a token-budgeted bundle from full-text, optional vector and wikilink neighbours across the spaces the caller can read.

Notable: memory shares the store, the permissions and the revision journal with the person's own notes, so every append is a versioned, attributed file a person can read, edit, mute or trash. Concurrent appends to one category are serialised on its name key, and a project handle narrows recall to that project's documents and its own memory.

Weak: nothing records whether a remembered fact is believed. The one control a person has, muted, is a category-level opt-out from automatic context, not a correction: search returns the category unlabelled, and new observations appended to it are muted with it.

Three marks are present and four are withheld (section 9).

Licence. The primary issue is the network clause: AGPL-3.0-only (LICENSE, NOTICE, copyright 2026 Sergey Padurets), and COMMERCIAL-LICENSE.md reads section 13 as requiring a modified instance offered to others over a network to publish its source, with a paid licence for SaaS, resale and embedding. Those commercial terms are separately negotiated and are not in the tree. THIRD_PARTY_NOTICES.md lists the bundled runtime licences, LGPL libvips in the optional vector stack among them. No rider restricts analysis. SECURITY.md asks for vulnerabilities through GitHub private vulnerability reporting, never a public issue.

2. Mental Model

A memory is a file, and a category is its name. The agent passes a label such as preferences or decisions; the server finds the agent-memory note whose title has the same name key in the right subdirectory, and appends the observation as a paragraph (packages/core/src/semanticOps/memory/memory.ts:107-128, :151-262). The first observation of a category creates the file at a path derived from the category, so two racing writers collide on one path rather than minting two notes (:85-102).

There are two axes and no third. About-user memory lives at the root of the mount in the person's personal space; about-project memory lives in .notarium/memory/<project-id>/ in the project's space (:273-285, docs/projects.md:72). The class is derived from the mount, so the agent chooses neither folder nor kind (packages/server/src/services/mcp/descriptions.ts:184-204).

Nothing about a memory's truth is stored. A category carries a summary, which feeds the profile, and a muted flag a person sets, which keeps the category out of automatic context (packages/core/src/knowledgeStore/knowledgeStore.ts:900-905). Correction is editing: the tool descriptions tell the agent to remove a fact by edit_note with an empty findReplace.

Diagram — an observation appends to the note its category names; a person's mute keeps that note, and every later append to it, out of the profile and recall, while search returns it
Diagram source
%% caption: an observation appends to the note its category names; a person's mute keeps that note, and every later append to it, out of the profile and recall, while search returns it
flowchart TD
    REM["remember_about_user<br/>or _project"] --> FENCE["category fence:<br/>find by name key<br/>and memory subdir"]
    FENCE --> NOTE["category note<br/>under .notarium/memory"]
    NOTE --> JNL["note_revisions row<br/>principal and kind"]
    HUM["person in web UI"] --> MUTE["muted: true"]
    MUTE --> NOTE
    NOTE --> IDX["memory index<br/>summary per category"]
    IDX --> M1{"muted?"}
    M1 -- "no" --> SS["start_session profile"]
    NOTE --> RC["recall: FTS or hybrid,<br/>graph hops, project lens"]
    RC --> M2{"agent-memory<br/>and muted?"}
    M2 -- "no" --> CTX["context bundle"]
    M2 -- "yes" --> DROP["dropped"]
    NOTE --> SRCH["search and get_note<br/>no muted check"]

3. Architecture

The repository is an npm workspace. packages/contract holds the Zod schemas for REST and the MCP tools. packages/core holds the read-model (CachedStore), the revision journal, the semantic operations including memory and recall, the importers and the visibility policy. packages/engine is the file-backed store over SQLite with FTS5, chunking and a local ONNX embedder; packages/engine-memory is an in-memory twin used in tests. packages/server is the Fastify service: REST routes, the MCP gateway, authentication and authorisation, the meta-DB drivers and jobs. packages/web is the React client.

Each space is a notes directory and its own index database, keyed by the space's stable directory name (packages/server/src/apps/server/server.ts:571), wrapped in a CachedStore that holds the journal (:581-584). The meta-DB is SQLite at DATA_DIR/meta.db unless META_DB_URL names PostgreSQL (packages/server/src/apps/server/dataPaths.ts:64-66).

Deployment and ergonomics

docker run with one volume starts the whole thing; the first visit creates the owner account. An agent connects with a personal access token or an OAuth 2.1 connector. Vector search needs two switches, the embedder package and VECTOR_SEARCH, and the published image defaults it off (.env.example:50-64); without it, search is FTS5 alone.

4. Essential Implementation Paths

  • Remember about the user. handleRememberUser refuses a blank observation or a category with brackets or newlines, mints the personal space on first touch, and refuses when the token is narrowed away from it or the host cannot provide a private domain (packages/server/src/services/mcp/tools/memory/memory.ts:16-83).
  • Remember about a project. handleRememberProject resolves the handle and requires space:write on its space (:85-143).
  • Append. remember holds the category fence; appendObservation finds or creates the note, appends with applyEdit, carries summary, tags and type forward, and retries a lost compare-and-swap within two budgets (packages/core/src/semanticOps/memory/memory.ts:151-271).
  • Journal. The write engine builds a revision with kind, principal and the agent attribution and appends it without awaiting (packages/core/src/cachedStore/helpers/writeEngine/writeEngine.ts:1509-1528).
  • Profile. curateAgentContext builds the about-user memory index into the start_session bundle (packages/server/src/services/mcp/tools/session/agentContext.ts:65-72).
  • Recall. handleRecall picks one narrowed target or every readable space, then recall searches, plans graph neighbours, ranks and assembles (packages/server/src/services/mcp/tools/read/read.ts:463-512, packages/core/src/semanticOps/recall/recall.ts:178-327).
  • Mute. PUT /api/note/mute refuses a note that is not agent-memory, then setNoteMuted rewrites the note under the same category fence (packages/server/src/apps/server/routes/note/note.ts:426-448, packages/server/src/services/spaces/agentContext.ts:936-978).

5. Memory Data Model

  • Category note. A Markdown file in the agent mount: title is the category, the body is the observations as paragraphs, frontmatter carries summary, muted, tags and type. The class agent-memory is indexed, versioned and recallable, and hidden from the graph, feed, tree and the person's search (packages/core/src/visibility/policy.ts:48-61).
  • Index row. One row per note in the space's SQLite index with a class column; memory is selected by class and by the subdirectory recovered from filePath (packages/core/src/semanticOps/memory/memory.ts:36-44).
  • Revision. A note_revisions row per note state: content-addressed state blob, kind, principal (pat:<user>:<id>, oauth:…, user:…, or null for an external edit), the agent session, entry_role and integrity (docs/note-history.md:3-30, :56-60, :70-72, docs/auth.md:22).
  • Retrieval log. For search, recall and get_note: owner, principal, agent, session, query, project, result count and the top five hits (packages/server/src/services/mcp/helpers/retrievalAudit/retrievalAudit.ts:17-107).

A note's identity is an internal id that survives rename and move. There is no event time, validity interval, confidence or status on a memory: the remember schemas take only the observation, category, summary and the compare-and-swap fields (packages/contract/src/schemas/tools/write.ts:36-44, :166-175).

6. Retrieval Mechanics

Eager. start_session loads the summary, or a 160-character snippet, of each about-user category into the profile under a 22,000-token personal budget shared with pins and context sets, skipping muted categories (packages/core/src/semanticOps/memory/memory.ts:290-331, packages/server/src/services/spaces/agentContext.ts:27). With a project hint it lists the project's unmuted category names as vocabulary, not their content (packages/server/src/services/mcp/tools/session/session.ts:316-320).

Recall. Per space, search under the agentRecall scope gives seeds. With the vector stack on, the engine fuses FTS5, vector and a one-hop graph channel by reciprocal rank (k 60, weights 1.0, 1.0 and 0.5) (packages/engine/src/services/notariumStore/notariumStore.ts:445-474). Recall then walks wikilinks depth hops; memory is never a graph node, so it enters only as a seed (packages/core/src/semanticOps/recall/recall.ts:80-82). Seeds outrank every neighbour by a 1,000-point hop penalty (:26-34).

Each candidate is read, its class rechecked, and a muted agent-memory note dropped (:270-284). Blocks are added whole until the character budget, four per token, would overflow, each capped at half the budget with a 500-token floor (:169-176, :245-324). The gateway refuses an identical search or recall repeated in one session (packages/server/src/services/mcp/gateway.ts:236-260).

search and get_note do not consult muted. The recall code says why: a muted category stays findable so the person can un-mute it and the agent will not re-create it (recall.ts:276-281).

7. Write Mechanics

A remember call blocks until the file write lands and returns the note id, the outcome (created or appended), the body's byte count and hash, and whether the summary changed (packages/core/src/semanticOps/memory/types.ts:31-36). The journal append is not awaited. The vector arm sees the change only after the embed loop processes the queued row (packages/engine/src/services/notariumStore/notariumStore.ts:1368-1374, :2459-2461).

The append is not idempotent without a key: a retry without idempotencyKey duplicates the observation, and the handler says so (packages/server/src/services/mcp/tools/memory/memory.ts:30-31). A summary passed in overwrites; an omitted one is carried forward.

A muted category keeps absorbing observations. findMemoryNote matches on class, id, name key and subdirectory and ignores muted (packages/core/src/semanticOps/memory/memory.ts:107-128), and the append passes no muted, which the store reads as carry the flag forward (:219-236, packages/core/src/knowledgeStore/knowledgeStore.ts:903-905). A new observation in a muted category is stored, reported appended, and never reaches the profile or recall.

No model runs on the write path, and nothing rewrites the store in the background. A consolidate reflection skill is named in the project docs and is not in the tree.

Operational cost

One file write, one index update and a deferred journal append per observation; one embedding per changed note when the vector stack is on. Recall costs one search per readable space, plus a graph fetch when depth is above 0.

8. Agent Integration

The gateway registers 28 tools; the README counts 23 (packages/contract/src/schemas/tools/registry.ts:74-113). Memory has two writers, remember_about_user and remember_about_project, and the general note tools reach memory notes too: edit_note to correct, delete_note to trash. The delete_note description tells the agent that restore and permanent erasure are human actions; no MCP tool restores, purges or mutes (packages/server/src/services/mcp/descriptions.ts:228-238).

Tool output passes through sanitizeText on the way out, and the project's security policy puts untrusted note content reaching a tool description in scope. Each authenticated call is recorded in an agent call trace, and the retrieval reads in the retrieval log.

A person sees memory in a Memory explorer in the web client, through GET /api/me/memory and GET /api/s/<slug>/projects/<id>/memory, each category with its author resolved from the journal (packages/server/src/apps/server/routes/auth/me.ts:505-512).

9. Reliability, Safety, and Trust

The space is the boundary

SECURITY.md:35-37 names the space as the isolation boundary and SECURITY.md:62-63 states that a member sees everything in a space. Project memory is a lens inside that boundary, not a second one (docs/projects.md:72). The personal space refuses a second member on the backend, which is what keeps about-user memory private (packages/server/src/apps/server/routes/auth/members.ts:25-29); the remember handler refuses to write when the personal domain cannot be provisioned as private (packages/server/src/services/mcp/tools/memory/memory.ts:48-55).

Mute is not a verdict

muted answers "should this be pushed", not "is this true". It hides a category from the profile, the vocabulary hint and recall, and leaves it in search and get_note with no label. A fact a person distrusts but keeps is one the agent can retrieve by asking for it.

History and erasure

Every state of a memory note is a journal row attributed to the token that wrote it, and the history view shows agent and human revisions in one chain (README.md, One history for you and your agent). Purging a trashed note is irreversible: it deletes all its revisions and unreferenced blobs and leaves an identity row and a per-space fence that refuses a re-appearing file under the purged id (docs/trash.md:154, packages/server/src/services/metaDb/drivers/pg/revisions.ts:1138-1171).

Marks

  • scope_enforced — present. A project handle filters recall to that project's subtree and memory subdirectory, and the profile reads only the about-user root; the space, a separate store chosen by membership, carries the boundary that matters.
  • audit_log — present. note_revisions records every memory write, edit, mute and deletion with kind and principal; best-effort, and purge removes a note's rows.
  • negative_eval — present. Populated recall cases for a muted category and for sibling and about-user memory under a project lens.
  • trust_state — withheld. muted is the one discrete field and it filters only automatic context; search and get_note return a muted category unlabelled, so it does not withhold a memory from being treated as true.
  • tombstone — withheld. Mute and trash are keyed on the category note. A fact removed by edit_note leaves nothing behind, and the next remember_* with the same words appends it again.
  • bitemporal — withheld. Memory has no event or validity time; the journal's timestamps are record time.
  • human_review — withheld. An observation is in context on the next read; nothing waits for a person.

10. Tests, Evals, and Benchmarks

The tree holds 540 Vitest files: unit suites beside each package, a fake-server suite that drives the real gateway over HTTP, store and meta-DB contract suites, and backup and release checks. The GitLab CI file runs npm run test:coverage and a job with a PostgreSQL 16 service (.gitlab-ci.yml:175, :305-315); its own comment counts 8,000 tests (:225). I ran none of them.

The memory cases are thorough on concurrency: sixteen racing observations land once, a lost create retries into an append, and a foreign writer that keeps committing exhausts a named budget (packages/core/src/semanticOps/memory/rememberAboutUser.test.ts:480-708). The recall cases pin muting and project narrowing against populated controls (packages/core/src/semanticOps/recall/recall.test.ts:319-341, :518-550), and test/fake-server/projectMemory.test.ts:136-240 checks attribution and partition isolation through the REST audit feed.

Cases to want first: a muted category returned by search beside an unmuted one, asserting the label the agent sees; an observation appended to a muted category, asserting what the person is shown; and the same fact remembered after a person removed it.

No paper describes Notarium, and no retrieval-quality benchmark is committed.

11. For Your Own Build

Steal

  • Make memory a file the person knows how to read. Category notes in a reserved mount, beside the person's own Markdown, with the same history view, is the cheapest audit surface in this design.
  • Fence the whole find-or-create-append window, not the write. Keying the fence on the name key the lookup matches on, plus the partition, closes the two-notes-for-one-category race.
  • Derive the class from the mount. An agent that cannot choose folder or kind cannot write memory into a person's visible notes, or the reverse.
  • Recheck class after a read by id. A direct read is not visibility-scoped, so recall checks again before emitting.

Avoid

  • Do not let a context opt-out stand in for a correction. A mute that search ignores and new appends inherit hides a problem from the person rather than from the agent.
  • Do not make the audit append best-effort for agent writes. A history that can lose the row explaining an agent's change is weakest where it is needed.

Fit

Fits a person or a small team who want one Markdown knowledge base that both they and their agents write, and who will read what the agent recorded. The memory model is deliberately thin and the platform under it is large.

Walk away if a fact must be marked disbelieved and kept, if a rejected value must stay rejected, or if memory about one project must be hidden from other members of the same space.

12. Open Questions

  • Whether a muted category should refuse or flag new appends, given that the remember response reports appended either way.
  • Whether search and get_note are meant to label muted memory for the agent.
  • Where the consolidate reflection skill named in docs/projects.md:92 is meant to live.

Appendix: File Index

  • Memory operations: packages/core/src/semanticOps/memory/memory.ts, packages/core/src/semanticOps/memory/consts.ts, packages/core/src/semanticOps/memory/types.ts
  • Recall: packages/core/src/semanticOps/recall/recall.ts, packages/server/src/services/mcp/tools/read/read.ts
  • MCP surface: packages/contract/src/schemas/tools/registry.ts, packages/contract/src/schemas/tools/write.ts, packages/server/src/services/mcp/gateway.ts, packages/server/src/services/mcp/descriptions.ts, packages/server/src/services/mcp/tools/memory/memory.ts, packages/server/src/services/mcp/tools/session/
  • Mute and profile: packages/server/src/apps/server/routes/note/note.ts, packages/server/src/services/spaces/agentContext.ts
  • History: packages/core/src/revisionJournal/revisionJournal.ts, packages/core/src/cachedStore/helpers/writeEngine/writeEngine.ts, packages/server/src/services/metaDb/drivers/pg/revisions.ts, packages/server/src/services/metaDb/drivers/sqlite/revisions.ts, docs/note-history.md, docs/trash.md
  • Search engine: packages/engine/src/services/notariumStore/notariumStore.ts
  • Policy and docs: packages/core/src/visibility/policy.ts, docs/note-model.md, docs/projects.md, docs/auth.md, SECURITY.md
  • Tests: packages/core/src/semanticOps/memory/rememberAboutUser.test.ts, packages/core/src/semanticOps/memory/rememberAboutProject.test.ts, packages/core/src/semanticOps/recall/recall.test.ts, test/fake-server/projectMemory.test.ts

Recorded searches

Run from the repository root at the pinned commit with /usr/bin/git grep. .gitmodules is absent.

  • No value-keyed rejection in the memory path. git grep -n -i -E 'tombstone|rejected|forbid' -- packages/core/src/semanticOps packages/server/src/services/mcp/tools/memory returns a link-payload comment in link.ts:86, a test's promise status and a doc comment in memory/types.ts:6; nothing in the remember path.
  • The MCP read tools do not consult muted. git grep -n -i 'muted' -- packages/server/src/services/mcp returns only tools/session/agentContext.ts:135, :186 and tools/session/session.ts:317-320.
  • No validity time on memory. git grep -n -i -E 'valid_from|validFrom|valid_to|validUntil|valid_at' -- packages ':!packages/web' returns nothing.
  • No pending or approval state for memory. git grep -n -E "'(pending|approve|approved|candidate)'" -- packages/server/src/services/mcp packages/core/src/semanticOps returns nothing.
  • No restore, purge or mute tool. The 28 entries in packages/contract/src/schemas/tools/registry.ts:74-113 include none; git grep -n -i -E 'purge|restore' -- packages/contract/src/schemas/tools/registry.ts returns nothing.
  • No consolidation code. git grep -l -i 'consolidat' returns docs/architecture.md, docs/projects.md and packages/core/src/libs/markdown/frontmatter/frontmatter.test.ts.
  • No paper. No CITATION.cff; git grep -n -i -E 'arxiv|doi\.org|bibtex' returns nothing.

History

2026-12-04 — 07f52af9…. First reading, from the 2026-12-04 triage shortlist, at the head of main. Screened: 22 files, no auto-run surface, none inside the cooldown, two build-time execution points (the Makefile and a prepublishOnly script in packages/cli/package.json), nine unpinned surfaces, eight of them with no lockfile beside them. Nothing was installed, built or run, and none of the 540 test files was run. Three marks (section 9).