# Knowledge

> Four layers of memory, Library, Skills · MCP, Shared domains

## Four layers of memory

*The Assistant's memory has four layers: raw words → fragments → events → concepts. Each layer down is more distilled and is forgotten more slowly.*

| Layer | Holds | Forgetting |
| --- | --- | --- |
| L0 · Session | The raw conversation, one file per session | Raw material for distillation |
| L1 · Fragments | Single memories, in a graph database + a vector store | τ = 14 days; archived below 0.05 and dropped from the vector store |
| L2 · Events | Decisions and episodes; fragments hang under them | τ = 45 days; archived below 0.02 |
| L3 · Concepts | People, skills, domains, beliefs | Never decays |

Scores decay as `score × e^(−days/τ)`. Each time an L1 fragment is recalled, its τ grows by half the base value and its score is nudged up, so memories that keep coming up fade more slowly. L2 events decay on their fixed τ.

### Distillation

A check runs every 60 seconds, and any one of three conditions distills L0 into L1 / L2 / L3: every session has been idle for 30 minutes, one session's L0 has reached 200 lines and been quiet for 30 seconds, or someone triggers it by hand. A near-duplicate of an existing memory (cosine similarity ≥ 0.9) reinforces that memory instead of adding a new one. The first check after local midnight runs the day's decay pass.

### Recall

Recall takes the 10 nearest vectors first, then spreads two hops through the graph (halving at each hop) from fragments to events to concepts, and ranks the results by decayed score × activation. The Assistant then adds keyword matches across L1 to L3 and a scan of recent L0.

> Memory is separated per Space, per Assistant and per owner; each Space has its own graph database, and if it can't be reached recall fails rather than falling back to a shared one.

## Library

*The company's reference files live in one folder, mounted read-only into every project seat.*

- One folder per instance; project seats mount it read-only, and their prompt says so.
- The prompt carries the file list (name, size, date) but not the contents; past 50 files the list folds into folders with counts; an empty library adds nothing.
- Members add, edit and delete files in the Library panel, and Assistants can edit too. Every write bumps a revision, and seats rebuild with the new list on their next start.
- Scanned PDFs and images can't be read yet (no OCR).

## Skills · MCP

*Which skills and MCP servers a seat gets is one formula: what the scan finds ∩ the owner's tiers ∩ the Space's picks.*

```
effective = scan (built-in skills/ + custom roots)
          ∩ tier (required · allowed · hidden, set by the owner)
          ∩ Space picks (allowed ones toggle, required ones can't be turned off)
```

- The same effective set feeds the prompt, `--mcp-config` and the health checks.
- Skills appear in the prompt as "name — description (see SKILL.md)"; MCP servers reach Claude seats as `--mcp-config <file> --strict-mcp-config`.
- Codex seats get only `genki-ask-user` (cards, gates and the like), but still see the skill list.
- Installing: a seat writes `skill.json` + `SKILL.md` (or an MCP `<slug>.json`) into a custom root. It is allowed by default and takes effect on the next turn. The panel can also create one from text or import one from a public GitHub URL (its scripts are never run). A Codex plugin install waits for the owner or an admin to approve a card.

## Shared domains

*A few related projects share one directory: the conventions they all rely on, shared credentials, and a cross-project change log.*

- **`CONTEXT.md`**: What the member projects rely on together. It is also a snapshot, rewritten in place under the record rules
- **`LOG.md`**: The one append-only record: one line per change, `YYYY-MM-DD · project · change`
- **`KEYS.md`**: Shared credentials, never in git

Member projects' engine, chat and scheduled seats mount the domain read-write. With cross-read on (the default), sibling projects are mounted read-only too, minus `KEYS.md`, `.env*` and `data/`. Creating, editing and retiring domains is owner-only.
