Prima Get an API key

The stone repository

Repository format

A git repository of markdown files. Read with any editor, cloned with git.

Live Built and working today on the surface this card describes.

What it does

A stone repository is a git repository holding what your sessions write down. It has no schema beyond the file paths below and is read with git and a text editor.

Only text is read. Files ending .md, .markdown, .mdx or .txt. Everything else in the repository is left alone and simply not indexed.

Sessions engraved from the chat land at sessions/<year>/<month>/<date>-<slug>.md, each with front matter carrying the title, the date, the session id, the model, the source and whether the model produced the distillation or the fallback did.

If the repository keeps a meta/changelog.md, an engraving is appended to that day's entry there too. If it does not, nothing is created.

A repository provisioned for you on our git host, once per-tenant provisioning ships, is seeded with a README.md and a BRAIN.md and nothing else. That part is decided and not built; see the cloning card. A repository you connect yourself has whatever layout it already has.

Inputs and outputs

Read .md, .markdown, .mdx, .txt.
Skipped Dot-directories except .claude, plus node_modules, dist, build, .next, .astro, vendor, .venv, __pycache__, and any single file over 400,000 characters.
Written by an engraving sessions/<year>/<month>/<date>-<slug>.md, plus an appended line in meta/changelog.md when that file exists.
Front matter title, date, engraved_at, session, model, source, tags, distilled.
Default branch main.

Configuration

Layout Whatever the repository already has. The only path anything writes to on its own is the sessions directory.
Changelog Create meta/changelog.md and engravings append to it. Leave it out and they do not.
Location of engravings One convention for now, meant to be overridable per repository later.

Limits

  • Chunking, and therefore citation, works on headings. A file with no headings is one chunk and cites as a file rather than as a section.
  • A section longer than about 2,400 characters is split on paragraph boundaries. Every piece keeps the same heading, so a citation still resolves to something openable.
  • An engraved file is a distillation when the distillation succeeded. When the model call fails, the first 8,000 characters of the raw transcript are written instead, and the front matter says distilled: false. See the engrave card.

Example

what a repository looks like after a few sessions

README.md
BRAIN.md
meta/changelog.md
sessions/2026/09/2026-09-10-carry-over-rules-for-unused-holiday.md

Source of truth

  • prima-chat/server/wiki.ts (readable extensions, skipped directories, the size cap, the 2,400-character split)
  • prima-chat/server/engrave.ts (`renderNote`, the sessions path, the front matter, the changelog append)
  • philosophers_stone/operations/decisions/0037-stone-per-tenant-forgejo-org-and-token.md (a provisioned repository is seeded with README.md and BRAIN.md, default branch main; decided, not built)