Home / Architecture

What the forest looks like inside

Four tables, one vector store, three entry points. Shape rules are enforced in code, writes are dry-run by default.

Four layers
01

Access入口层

CLI (amm), HTTP API bound to 127.0.0.1, MCP over stdio, and an Electron desktop window. One core, four doors.

02

Core核心层

22 modules: capture, grouping, retrieval, digging, withering, handoff packing. Shape rules and safety constraints live here.

03

Storage存储层

Four SQLite tables (memory_tree / hollow / truffle / earth) plus a local Chroma index. Single machine, backup-friendly.

04

Bridge接入层

21 MCP tools and 4 resources that hand the forest to any MCP host: Claude Desktop, DSH, or your own client.

Two pipelines

Write: from a leaf to a tree

  • Captureleaf_add or amm add — one sentence lands in the pending layer, unassigned.
  • Groupamm plan proposes (model call), amm apply commits; or move things by hand.
  • Take shapeThree leaves make a solid branch; three solid branches make a trunk — decided by rules.
  • IndexRebuild the vector index after structural changes so search keeps up.

Recall: ask first, then give

  • IntentDecide whether this needs a sentence, a thread, or a whole topic.
  • RetrieveSemantic search proposes candidates; hollows are excluded, always.
  • Offermemory_suggest returns metadata only: how many, how long, last stored — no text.
  • Commitmemory_commit returns the text only after the user chooses, wrapped in a “reference, not instruction” note.
data flow HOST WRITEpipeline MEMORYtree RECALLpipeline EXTRACT RANK stdio / http sqlite + index
Data model

Four tables and one self-referencing tree.

memory_treetree / trunk / branch / leaf, self-referencing parent_id, ON DELETE CASCADE
hollowhollows, attached to trunk only, encrypted, dies with the tree
trufflesecret vault, encrypted with salt padding
earthkey-value settings: lifetimes, model, file fingerprints

DDL lives in amm_core/schema.sql; the full API is at /docs.

~/allmymind/amm/data/ ├── memory.sqlite # 4 tables ├── chroma/ # vector index ├── backups/ # single-file snapshots └── plans/ # grouping plans awaiting signature