A chat app's agent notes, kept the moment they are written and forgotten by deleting the row

loom (Aaen Studios)

A self-hosted MIT app for chatting with ACP agents like Claude Code; its server keeps their notes in SQLite FTS5 and a per-person profile.

LicenceMIT in LICENSE; NOTICE and TRADEMARKS.md reserve the name, logo and marketing material, not the code
Size91,974 lines of Calx in 98 files under server (instance.calx alone is 36,273), 29,210 under shared and 13,027 under core, beside Rust desktop and Swift iPhone apps; the memory subsystem is about 250 lines of server/store.calx, the 272-line server/learn.calx, and the tool and command handlers in server/instance.calx
Activity627 commits dated 15 September to 4 December 2026, all under one contributor account; the GitHub repository was created on 15 September; release notes run to 0.7.1
Tests1,000 Calx @test functions (636 under server) and 163 protocol scripts that drive a real instance with a fake ACP agent; CI runs both through scripts/check.calx; 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

loom is a self-hosted app for chatting with your own AI agents from a computer and a phone. The agents are Claude Code, Codex and other programs spoken to over ACP; loom's server, written in Calx, holds accounts, agents, chats, routines and memory, and gives every agent session its own MCP server of loom tools. This report covers the memory: notes in SQLite with full-text search, a short profile of each person, and an agent that looks back over a paused chat for facts worth keeping. It is unrelated to ClickHouse's Loom.

Notable: the look-back turn is scheduled by the prompt cache. A chat counts as paused four minutes after its last reply, a minute inside the five-minute cache, so reading the chat back costs a cache hit rather than a full context. A secluded agent is walled off from shared notes, the profile and every other agent, and the wall is tested from both sides.

Weak: a note is kept the moment the agent writes it, in every permission mode, and nothing marks who wrote a note when another agent recalls it. Forgetting deletes the row, so the next look-back can propose the same fact again. The per-agent filter binds the recall tool only: run_command memory.list hands an ordinary agent every note of the person's.

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

Licence. MIT in LICENSE, copyright 2026 Aaen Studios. NOTICE and TRADEMARKS.md reserve the name, logo, app icons and marketing material, not the code. The vendored gpui crates under desktop/vendor carry their own Apache-2.0 files. SECURITY.md asks for security problems to be reported privately, through GitHub's advisory form or by email, and not in an issue, discussion or pull request; it also says an agent doing what its permission mode and the person's rules allow is not a vulnerability.

2. Mental Model

A note is a fact the agent has decided to keep, and loom takes it at its word. There is no candidate state: propose_note and remember both end in an INSERT INTO memories, and the only difference is that a proposal also leaves a row in proposals and a line under the reply with Forget (server/instance.calx:8270-8292, :11069-11079). The function deciding this reads:

pub fn kept_at_once(kind: String, mode: String) -> bool {
    if kind == "note" { return true }
    return kind == "fix" and acp.allows(mode, String("edit"))
}

(server/learn.calx:28-31). A note stops being believed only when it is deleted, by the agent's forget, the person's Memory page, or the Undo the reply line carries.

The profile is different in kind. It is one block of text per person, rewritten whole, and it is pushed into every session; notes are pulled, by recall or by the browser landing on a site a note is tied to.

Diagram — every note is kept the moment it is written; the profile is pushed into sessions, notes are pulled by recall or a site visit, and forgetting deletes the row
Diagram source
%% caption: every note is kept the moment it is written; the profile is pushed into sessions, notes are pulled by recall or a site visit, and forgetting deletes the row
flowchart TD
    subgraph W["Writers"]
      direction TB
      RM["Agent: remember"] ~~~ LB["Look-back turn<br/>4 min after a reply,<br/>300+ chars said"] ~~~ PP["Person: Memory page"]
    end
    LB --> PN["propose_note"]
    PN --> K{"kind = note?"}
    K -- "always kept" --> MEM
    W --> MEM["memories + FTS5<br/>user, agent or shared,<br/>text, by, at, site"]
    UP["update_profile or<br/>About you page"] --> PR["profiles<br/>new revision, by, at"]
    PR --> SS["Session prompt,<br/>once per revision"]
    MEM --> RC["recall: same user,<br/>own or shared,<br/>bm25, 20 at most"]
    MEM --> SN["Site notes on the<br/>first browser call there"]
    MEM --> DEL["forget, delete or Undo:<br/>DELETE the row"]
    DEL -.->|"nothing remembers<br/>the value"| PN

3. Architecture

The server is one Calx program. server/instance.calx holds the instance: every command, every loom tool handler, the once-a-second loop, sessions and prompts. server/store.calx is the SQLite store, schema and queries together. server/learn.calx is what the look-back turn is told and what a reply shows of it, and server/walls.calx is the secluded-agent wall. shared/tools.calx defines loom's tools once for the server and loom mcp. The desktop app (Rust, on a vendored gpui) and the iPhone app reach memory through the same commands, memory.list, memory.put, memory.delete and profile.put (desktop/src/model.rs:14430-14457).

Each ACP session gets loom mcp with a random 24-byte token bound to one person, one agent and one conversation, held in the instance's memory (server/instance.calx:9013-9021). Every loom tool call presents it, and the handler resolves the person and the agent from it, never from the call (:10063-10071).

Loom writes each agent's instructions to AGENTS.md and CLAUDE.md in its folder and the person's skills to .claude/skills/ (:28543-28600). It writes no note into the agent's folder.

Deployment and ergonomics

The server runs on a Linux host, in Docker, or inside the desktop app; one SQLite database holds everything (PLAN.md, "Storage"). There is no embedding model, vector index or extraction service to stand up. The look-back turn is a turn of the agent's own program, so its cost lands on the person's Claude or Codex plan, as every other turn does.

4. Essential Implementation Paths

  • Authenticate a tool call. mcp_route reads the bearer token and finds the Grant; an unknown token gets a 401 (server/instance.calx:10063-10071).
  • Record before acting. Unless the tool only reads, the call is inserted into activity with status started and its arguments, then settled (:10131-10137, :2736-2746).
  • Remember. remember trims the text, forces shared off for a secluded agent, normalises the site to its host and calls remember_on, which inserts the row and its FTS row in one transaction (:11069-11079, server/store.calx:2744-2766).
  • Propose a note. propose_note calls propose, which keeps any note at once through keep_note, logs it and puts it under the reply (server/instance.calx:10780-10790, :8270-8292, :8337-8346).
  • Look back. pause_after marks a chat paused four minutes on; paused_now, from the once-a-second due loop, starts look_back, which runs a quiet turn when enough was said (:8394-8403, :8427-8445, :8453-8475, :13941).
  • Recall. recall calls memories_of with the agent and, unless secluded, the shared notes (:11177-11187, server/store.calx:2786-2808).
  • Site notes. with_site_notes appends the notes tied to the page's site on the agent's first call there (server/instance.calx:8144-8178).
  • Profile. update_profile and profile.put insert a revision; prompt pushes the text when the session has not had that revision (:11081-11087, :35353-35357, :28784-28797).
  • Forget. forget_of deletes the row and its FTS row (server/store.calx:2944-2967); memory.delete and undo call it for the person (server/instance.calx:35412-35416, :34146-34164).

5. Memory Data Model

  • memories: id, user, agent (empty for shared), text, by (the agent or device that wrote it), at, site (server/store.calx:303-305). memories_fts indexes text with unicode61 remove_diacritics 2 and carries user and agent unindexed (:318-320).
  • profiles: user, revision, text, by, at, keyed on person and revision (:231-233).
  • proposals: kind (skill, note or fix), data, why, status (waiting, kept, dropped, undone), decided, by, the reply it sits under, and later (:309-313). A kept note's data records the memory id (server/instance.calx:8343).
  • skills: name, description, body, at, keyed on person and name, with no history; a kept fix carries the old body in its proposal for Undo (server/store.calx:110-112, server/instance.calx:8351-8365).
  • skill_failures: the newest failure an agent reported of each skill, until a fix is proposed (server/store.calx:314-317).
  • activity: kind, text, by, at, status, input, why, ended and proposal (:89-93).

Time: one at per note. An imported OpenBot memory keeps its original time in that column (server/instance.calx:12971-12983). Nothing says when a fact was true.

6. Retrieval Mechanics

Notes are never placed in a prompt by loom. They reach the agent two ways.

recall with words turns each into a quoted prefix term and ORs them, so any word matches, ranked by FTS5's rank, 20 at most; without words it returns the newest notes (server/store.calx:4306-4313, :2786-2808). The scope is in the SQL:

WHERE memories_fts MATCH ? AND m.user = ?
  ... " AND (m.agent = ? OR m.agent = '')"   -- shared, the default
  ... " AND m.agent = ?"                     -- a secluded agent

The agent sees each note as id (shared): text. The by column is returned by the store and not printed (server/instance.calx:11177-11187).

Site notes: on the agent's first browser call at a site, the result gets a last text block of up to 20 notes tied to that host or a parent of it, newest first; a secluded agent's shared ones are skipped (:8144-8178, server/store.calx:2813-2824, :4241).

The profile is pushed. Each prompt checks what the session has been told and adds the profile text, labelled as kept by the person and their agents, when the stored revision differs; a secluded agent is never told it (server/instance.calx:28679, :28784-28797).

No embeddings: PLAN.md says they come in if full-text search is not enough. No retrieval benchmark is committed.

7. Write Mechanics

A write blocks the tool call for one SQLite transaction and is recallable on return. remember refuses only empty text; there is no length cap, no duplicate check and no merge (server/instance.calx:11069-11071, server/store.calx:2761-2766).

The look-back turn. When the person's turn ends with the agent's reply, pause_after sets the chat to pause four minutes on, for the agent's own chats and group chats, not tasks, routines, threads or side questions (server/instance.calx:8394-8403). At the pause, look_back counts the characters the person and this agent typed since the last look-back, without tool calls, and runs a quiet turn in the same session when there are 300 or more, or a skill it said failed wants a fix (:8453-8475, server/learn.calx:37-44). The turn is told to keep lasting facts with propose_note, one fact a note, and not what recall has, what mattered only today, or a secret (server/learn.calx:59-75). The four minutes are a minute short of the five-minute prompt cache, so the turn reads the chat from it (server/instance.calx:2205-2213).

A message the person sends meanwhile stops that turn (PLAN.md, "Memory"). In a session of 100,000 tokens or more the same turn also writes a summary of up to 600 words for the fresh session the chat moves to once the cache is cold; that summary is kept per conversation and is not a note (server/instance.calx:2215-2222).

Skills. save_skill writes a skill for every agent at once. propose_skill and a skill written from a recording wait for the person; fix_skill waits when the agent's mode asks about edits (server/learn.calx:28-31).

Operational cost

A note costs one insert. A look-back costs one quiet model turn per paused chat that crossed the threshold, read from a warm cache. Nothing runs on a schedule over the store.

8. Agent Integration

shared/tools.calx gives every session remember, recall, forget, update_profile, propose_note, propose_skill, skill_failed and fix_skill, beside loom's other tools (shared/tools.calx:81-93). The remember description tells the agent its notes are its own and a shared note is read by every agent of the person's.

run_command reaches loom's commands. memory.list, memory.put, profile.get and profile.put run at once for an agent; memory.delete asks the person; every proposal.* command is refused (server/commands.calx:179-184). proposal_command also refuses any caller that is not a device:

if not device.starts_with("d_") { return Answer.Refused(String("forbidden"), ...) }

(server/instance.calx:34072-34073). A test has an agent try proposal.undo through run_command and requires the refusal (tests/protocol/learn.calx:129-130).

9. Reliability, Safety, and Trust

Kept at once, by design

Every note is kept the moment an agent writes it, in every permission mode, shared ones included; PLAN.md says the person takes back what they do not want after. The reply line and the activity log make the write visible. Nothing makes it provisional: a note planted by a web page the agent read, and written with shared, reaches every agent of the person's on their next recall, unlabelled. Shared tables, beside it, mark rows another agent wrote as untrusted when read (server/tables.calx:98-101, server/instance.calx:13205, :13247); notes carry no such mark.

Per agent is a recall default

recall and site notes keep an ordinary agent to its own and the shared notes. run_command memory.list without agent calls memories(user, none, …) and returns every note of the person's, other agents' included (server/instance.calx:35396-35400, server/commands.calx:179). memory.put with another agent's id writes into its notes (server/instance.calx:35402-35407). The forget tool lets any ordinary agent delete a shared note without asking, while memory.delete through run_command asks the person (server/store.calx:2944-2950, server/commands.calx:184). Within one person, then, the wall is seclusion, not the agent column.

Seclusion is the wall

A secluded agent recalls, forgets and is shown on a site only its own notes; shared is forced off; update_profile, the profile in its prompt, profile.get and skills are refused. Every command it or another agent runs is walled, a list losing what is across the wall: an ordinary agent's memory.list comes back with secluded agents' notes stripped, and a command naming a secluded agent is refused as not found (server/walls.calx:30-34, :40-48, :53-56, server/instance.calx:12533, :34170-34179, :34196, :34226-34230, :34240). tests/protocol/private.calx:66-75 checks both directions with a matching note on each side, and lists_lose_what_is_walled_off checks the strip on a list of notes (server/walls.calx:102-107).

Forgetting

Forgetting deletes the row and its FTS row. The text survives in two places: a kept note's proposal keeps it in data with status undone or kept, and the activity log keeps "Remembered:" and "Forgot what was remembered:" lines of up to 100 characters (server/learn.calx:158-171). Nothing deletes from proposals. Deleting an agent sets a flag on it and leaves its notes (server/store.calx:1695-1699). Nothing consults a forgotten value when a note is written, so a look-back can propose it again.

Marks

  • scope_enforced — present. The person comes from the session token on every note read, and recall adds own-or-shared; between ordinary agents of one person the agent filter is a default, not a boundary.
  • audit_log — present. Profile revisions keep every value with who and when, and the activity log records each agent memory call before it runs. An agent's forget is logged by number only, and the person's Memory-page edits leave no entry.
  • negative_eval — present. Populated recall cases across agents, people and the secluded wall.
  • human_review — withheld. Notes have no review. Skill proposals wait for a device the agent cannot be, but save_skill writes a skill for every agent at once, so the queue binds only the agent's choice to use it.
  • trust_state — withheld. A note has no status; waiting, kept, dropped and undone belong to proposals, and a note is never waiting.
  • bitemporal — withheld. One at per note and per profile revision.
  • tombstone — withheld. A forgotten note's text sits in an undone proposal that no write path reads.

10. Tests, Evals, and Benchmarks

Unit tests are Calx @test functions beside the code, 1,000 in the tree. The 163 protocol scripts start a real instance with a fake ACP agent that plays the turn its prompt spells out, so a test can have the agent call remember with exact arguments. scripts/check.calx runs both, and CI runs it (tests/README.md, .github/workflows/ci.yml:220). I ran none of them.

The memory cases: memory_is_kept_per_agent_and_shared and notes_can_be_tied_to_a_site in server/store.calx:5193-5245; the Memory and profile block of tests/protocol/tools.calx:187-217; seclusion in tests/protocol/private.calx:66-75; and tests/protocol/learn.calx, which covers kept notes, Undo, the look-back turn, fixes in both modes and group chats. The negative cases are populated: in the store test, a recall for "deploy keys" must return one note while another agent's and another person's notes both match "deploy".

Cases to want: an ordinary agent's run_command memory.list, asserting what it may see; a note forgotten and then proposed again; and a shared note planted by one agent and recalled by another, asserting how it is labelled.

No paper describes loom: CITATION.cff is absent and the tree cites none.

11. For Your Own Build

Steal

  • Schedule reflective work by the cache. Firing the look-back a minute inside the cache window makes reading the whole chat back cheap, and a character threshold skips the "thanks" turns.
  • Push the profile by revision, pull the notes. One small block per revision keeps the prefix stable; notes arrive as tool results.
  • Put Undo on the reply that made the memory. The line under the reply is where a person notices what was kept.
  • Wall with a whole mode. Seclusion takes away the shared notes, the profile, skills and other agents together, and is tested from both sides.

Avoid

  • Do not give one memory two deletion doors with different gates. forget on a shared note and memory.delete should ask the same question.
  • Do not document a per-agent scope that a general command bypasses. Apply the agent filter to memory.list from an agent, or say it is a default.
  • Do not show a recalled note without its author when other agents can write shared ones.

Fit

Fits a person who wants their own agents across a desktop and a phone, with a memory they can read in one list and correct by deleting, and who accepts that whatever an agent writes is believed until they notice it. The memory is a small, honest part of a large app; most of the reading is the app.

Walk away if notes must be reviewed before an agent uses them, if a forgotten fact must stay forgotten, or if one ordinary agent must not read another's notes.

12. Open Questions

  • Whether memory.list and memory.put from an ordinary agent are meant to reach other agents' notes, given the remember description.
  • Whether a deleted agent's notes are meant to stay listed to the person and to other agents.
  • Whether forgotten text in proposals and the activity log is meant to outlive the note.

Appendix: File Index

  • Store and schema: server/store.calx (memories, profiles, proposals, activity, FTS helpers)
  • Tool and command handlers, prompts, look-back: server/instance.calx
  • Look-back prompt and proposal display: server/learn.calx
  • Secluded agents: server/walls.calx
  • Agent command access: server/commands.calx
  • Tool definitions: shared/tools.calx
  • Design: PLAN.md ("Memory", "Sharing and learning", "Secluded agents", "Storage"), protocol/protocol.md ("Teaching a task, and proposals")
  • Person's Memory page: desktop/src/model.rs
  • Tests: server/store.calx (@test functions), server/learn.calx, server/walls.calx, tests/protocol/tools.calx, tests/protocol/private.calx, tests/protocol/learn.calx

Recorded searches

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

  • Only forget_of deletes a note. git grep -n -E 'DELETE FROM (activity|\{table\}|memories|profiles|proposals)' -- server core shared returns server/store.calx:2945 and :2965 (the note and its FTS row), :3597 (the per-table loop of account removal), and core/cache.calx:388, the app's own cache.
  • Nothing edits a note except a folder move. git grep -n -E 'UPDATE (activity|profiles|proposals|memories)' -- server returns proposal status and name updates and the activity settle at server/store.calx:3634 and :3639; git grep -n -F 'UPDATE {table}' -- server/store.calx returns :2772, repath_memories.
  • No embeddings. git grep -n -i -E 'embedding' -- server shared core returns core/sherpa.calx:251, a voice-model setting; git grep -n -i -E 'fts5' -- server returns six lines.
  • Nothing reads a forgotten value on write. git grep -n -F "'undone'" -- server returns only the update at server/store.calx:2902; git grep -n -F '"undone"' -- server returns only the proposal.list status check at server/instance.calx:34076.
  • Notes carry no untrusted mark. git grep -n -i 'untrusted' -- 'server/*.calx' returns shared tables (server/tables.calx:98-101, server/instance.calx:13205, :13247) and Discord history, and nothing in the memory paths.
  • No paper. CITATION.cff is absent; git grep -n -i -E 'arxiv|doi\.org|bibtex' -- . returns nothing.

History

2026-12-04 — 2996dd08…. First reading, at the head of main on 2026-12-04. Screened: 24 files scanned, no auto-run surface, 14 dependency surfaces inside the 7-day cooldown (a count the depth-1 clone inflates), 5 build-time execution points (Rust build.rs files under desktop/, three of them in vendored gpui), 1 unpinned surface; AGENTS.md and CLAUDE.md read as data. Nothing was installed, built or run, and none of the 1,000 test functions or 163 protocol scripts was run. Three marks (section 9).