# memhtml
> Memory for agents, in HTML.
memhtml stores an agent's long-term memory as a git repository of semantic HTML5 files,
one fact per file, with a rebuildable SQLite index over the tree. Two surfaces reach the
same store: the `memhtml` CLI and an MCP server over stdio.
Start here:
- [For agents](https://memhtml.github.io/agents.md): what to read first, whether you are behind the CLI or the MCP server, and the shortest path to a working integration.
Every page on this site is also served as Markdown at its own path with `.md` appended.
Fetch that rather than the rendered HTML.
## Documentation Sets
- [Abridged documentation](https://memhtml.github.io/llms-small.txt): a compact version of the documentation for memhtml, with non-essential content removed
- [Complete documentation](https://memhtml.github.io/llms-full.txt): the full documentation for memhtml
## Notes
- The complete documentation includes all content from the official documentation
- The content is automatically generated from the same source as the official documentation
## Pages
Every page, as the Markdown an agent should fetch. The landing page and the agent page first,
then each tier in the order the site's navigation uses.
- [memhtml](https://memhtml.github.io/.md): An agent's long-term memory as a git repository of semantic HTML files, with a rebuildable SQLite index, retrieval that fuses four ranking arms, sessions that land many writes as one commit, and a curator that works on a branch a person merges.
- [For agents](https://memhtml.github.io/agents.md): What to unlearn, which surface you are on, and the shortest path from nothing to a working memhtml integration.
- [Learn](https://memhtml.github.io/learn.md): Tutorials that take you from a clone to a working memory store, and how-to pages for operating one.
- [Audit and publish the corpus](https://memhtml.github.io/learn/operations/audit-and-publish-the-corpus.md): Every memhtml doctor finding and its fix, what --fix will and will not repair, and how memhtml publish resolves a conflict in a generated file.
- [Check the discrimination gate](https://memhtml.github.io/learn/operations/check-the-discrimination-gate.md): Run the gate, read its report or its failure message, and see why a skipped live run fails.
- [Configure the environment](https://memhtml.github.io/learn/operations/configure-the-environment.md): The environment variables memhtml reads, what each one degrades when it is absent, how to route model calls through an LLM proxy, and the SQLite settings every connection applies.
- [Curate the corpus](https://memhtml.github.io/learn/operations/curate-the-corpus.md): Run the curator on a curate/ branch, review what it did, land it on main with curate merge behind the head gate, fold a whole corpus with curate collapse, and brief the model with a charter of your own.
- [Diagnose poor retrieval](https://memhtml.github.io/learn/operations/diagnose-poor-retrieval.md): Where to look when search returns the wrong thing, nothing errors, and the store looks fine, plus the full error-code table.
- [Hooks and recall](https://memhtml.github.io/learn/operations/hooks-and-recall.md): What each installed hook injects on each host, why a failing hook gives an empty answer, the time bounds it runs under, and how to run one by hand to see exactly what a host sees.
- [Index session transcripts](https://memhtml.github.io/learn/operations/index-session-transcripts.md): Scan Claude Code transcripts into the trace plane, search them, join them to memories, and understand the firewall between traces and memory retrieval.
- [Initialize a store](https://memhtml.github.io/learn/operations/initialize-a-store.md): Scaffold a memory repository, and why a fresh clone must run memhtml init before its first merge touches a generated file.
- [Migrate to 0.16](https://memhtml.github.io/learn/operations/migrate-to-0-16.md): What 0.16 removes and what replaces each piece, and the upgrade in order, from settling the sleep branches on 0.15.x to replacing a sleep schedule with curate run and a reviewed curate merge.
- [Preserve the state plane](https://memhtml.github.io/learn/operations/preserve-the-state-plane.md): Export and import the access rows in state.db, which the git tree cannot reproduce, and handle the hazard they carry across two machines.
- [Rebuild the index](https://memhtml.github.io/learn/operations/rebuild-the-index.md): When update is enough, when only a full rebuild will do, and how a rebuild with an embedder configured clears a vector-space mismatch.
- [Recover from a lost index](https://memhtml.github.io/learn/operations/recover-from-a-lost-index.md): Restore a store from a clone in four commands, in the order that matters, and know exactly what a rebuild cannot bring back.
- [Run a head server](https://memhtml.github.io/learn/operations/run-a-head-server.md): What memhtml head serve keeps in memory, where it listens, the routes it answers, when each command falls back to working alone, the deadlines and pool settings, and how to run it under a service manager.
- [Run the store day to day](https://memhtml.github.io/learn/operations/run-the-store-day-to-day.md): The everyday commands, the upkeep commands that keep a store current, and exactly what moves the access plane.
- [Set the store policy](https://memhtml.github.io/learn/operations/set-the-store-policy.md): Every key of memhtml.config.json with its library default, an example for a strict store, why a typo in the file stops writes instead of loosening them, and how memhtml config reports the policy in force.
- [Share one store between a CLI and a server](https://memhtml.github.io/learn/operations/share-one-store.md): Why a memhtml command and a running MCP server can share one store and its two databases, what the retry layer guarantees, and the one hazard left, a checked-out curate branch.
- [Wire up your coding agent](https://memhtml.github.io/learn/operations/wire-a-coding-agent.md): What memhtml integrations install writes for Claude Code, Codex, Cursor, and OpenCode, which step each host still needs from you, and how uninstall uses the receipt to remove what install wrote.
- [Write through a session](https://memhtml.github.io/learn/operations/write-through-a-session.md): Start a session, add records with session put or a heredoc script, land them as one commit, rebase when the ref moved, bind a whole agent run with MEMHTML_SESSION, and prune what sessions leave behind.
- [Write your first memory](https://memhtml.github.io/learn/tutorial/first-memory.md): Run memhtml write, read the file it commits into the git tree, and see why one fact goes in one file.
- [Retrieve it](https://memhtml.github.io/learn/tutorial/first-retrieval.md): Run memhtml search and memhtml recall against the memory you wrote, and learn what separates the two.
- [Install memhtml and initialize a store](https://memhtml.github.io/learn/tutorial/install.md): Install the memhtml package, or build it from a clone, then scaffold a git-initialized memory store.
- [Wire up the MCP server](https://memhtml.github.io/learn/tutorial/mcp-server.md): Run memhtml serve mcp over stdio, see the tools and resource templates a client gets, and call one by hand.
- [Reference](https://memhtml.github.io/reference.md): Every command, code, vocabulary, and requirement, read from the source that defines it.
- [memhtml agents-doc](https://memhtml.github.io/reference/commands/agents-doc.md): Regenerate AGENTS.md from this command table. --check fails on drift.
- [memhtml apply](https://memhtml.github.io/reference/commands/apply.md): Write many memories from a JSONL op stream: ONE commit, ONE index update, per-op results.
- [memhtml archive](https://memhtml.github.io/reference/commands/archive.md): Soft-evict: `git mv` into archive// (archive/./ when an earlier archiving holds that slot) with the archive stamps. Never a delete.
- [memhtml config](https://memhtml.github.io/reference/commands/config.md): Show the policy this store runs under and the process tuning this environment sets, each value with its source. `store` holds the keys of `memhtml.config.json` at the store root (writeBar.refusedTypes, writeBar.requireAnchor, v1Doors, curator.writerBuckets, curator.placementQuota), each `file` or `default`; `file` says where the file is, whether it exists, and whether git holds it as `committed`, `modified`, `untracked`, or `absent`; `process` holds the variables `head serve` reads (MEMHTML_EMBED_WARM_IDLE_MS, MEMHTML_EXEC_POOL_SIZE, MEMHTML_EXEC_WORKER_HEAP_MB), each `env` or `default`, with a `problem` when a value is one `head serve` would refuse. The file is read from the working tree at every decision, never cached, so what this shows is what the next write is judged by. Read-only. A file that does not decode is ERR_STORE_CONFIG at exit 1, naming what is wrong.
- [memhtml correct](https://memhtml.github.io/reference/commands/correct.md): Supersede a memory: write the new file and archive the target in ONE commit.
- [memhtml curate collapse](https://memhtml.github.io/reference/commands/curate-collapse.md): Plan and run a collapse of the corpus on a curate/ branch: cut the head into archive, fold, and keep clusters by source and type, frame key, and lexical similarity (rulings first when given), archive the archive clusters with no model, fold each fold cluster into one canonical through a curator session with the driver completing every archive and supersedes link, and leave keep clusters alone.
- [memhtml curate merge](https://memhtml.github.io/reference/commands/curate-merge.md): Land a curator branch on its target: fast-forward --into to the ref when the ref descends from it, else replay the ref's operations (its puts, archives, and links since the merge base) as one fresh commit on --into's tip; the head gate (the same probes ranked at both tips) runs first either way, the checkout comes along when --into is HEAD, the landed version's snapshot is written, and after a replay the curator ref is moved to the landed commit.
- [memhtml curate run](https://memhtml.github.io/reference/commands/curate-run.md): Run the curator: start (or resume) a session on curate/, brief a model on the corpus, let it search, read, exec, and propose within a budget, then commit the session to the branch as `memhtml(curate): `.
- [memhtml doctor](https://memhtml.github.io/reference/commands/doctor.md): Corpus health: dangling hrefs, orphan state rows, inbox depth, vocabulary, staleness.
- [memhtml entity activity](https://memhtml.github.io/reference/commands/entity-activity.md): Every entity with its file count and its last activity, newest first. Report only.
- [memhtml eval discriminate](https://memhtml.github.io/reference/commands/eval-discriminate.md): The refusable retrieval gate: every probe must outrank its own wrong-fact twins.
- [memhtml exec](https://memhtml.github.io/reference/commands/exec.md): Run a read-only traversal script over the corpus in a sandbox: multi-hop in ONE execution.
- [memhtml head embed](https://memhtml.github.io/reference/commands/head-embed.md): Fill the vector cache for the version at HEAD: embed every active record whose article text has no vector yet (keyed by content hash, so an unchanged record is never embedded twice, across every version) and write `.memhtml/vectors/@.arrow`, a rebuildable cache git ignores. Reports records, reused, embedded, the cache file's bytes, and the time spent. Needs an embedder: with `MEMHTML_EMBED=off` it fails with ERR_MODEL_UNAVAILABLE. Run it after commits land to keep `head search`'s vector arm covering new records; `vector.coverage` on a search says how much of the head it covers.
- [memhtml head search](https://memhtml.github.io/reference/commands/head-search.md): Retrieval over the version at HEAD, or over the head server's version of its ref when one answers, RRF-fused: BM25, plus a vector arm (cosine over Cohere Embed v4 vectors, weight 1.0 as in v1's search) when `.memhtml/vectors/` holds a cache for the configured embedder and `MEMHTML_EMBED` is not `off`. Recency is the tie-break: only hits with exactly equal fused scores are ordered newest first, so it never lifts a weaker match over a better one. The query is embedded once with the query input type. The query embed has a deadline, `MEMHTML_EMBED_DEADLINE_MS` (450 ms by default): past it the search answers without the arm rather than wait. When the arm cannot run (embedder off, no cache yet, an unreadable cache, the query embed failed or passed its deadline) the search answers from BM25 alone and `vector` reports `used: false` with a `reason`; it never fails for it. Each hit's `arms` names the arms it scored on, and `recency` when an exact tie was broken by it. No index database.
- [memhtml head serve](https://memhtml.github.io/reference/commands/head-serve.md): Hold the head loaded and answer lookups over .memhtml/head.sock (mode 0600, JSON over HTTP, routes /v1/status, /v1/search, /v1/read, /v1/neighbors, /v1/exec, /v1/commit, /v1/rebase) until SIGTERM or SIGINT. The server loads its ref's tip once the cheapest way (snapshot, snapshot+advance, or git), reads the ref before every answer and advances over the changed paths when it moved, so an answer is never older than the ref at the moment of the request, and polls between requests. With an embedder bound (not `MEMHTML_EMBED=off`) it also holds the vector cache `head embed` writes, reads it again when the file's mtime changes, and runs the vector arm for `/v1/search` and `/v1/neighbors` the way `head search` and `session put` do locally, answering with the same `vector` field. A `/v1/search` waits for its query embed at most the body's `embedDeadlineMs`, else `MEMHTML_EMBED_DEADLINE_MS`, else 450 ms, and answers `embed-timeout` without the arm past it, leaving at most one late embed to finish in the background; and, when `MEMHTML_EMBED_WARM_IDLE_MS` is set above 0 (it is off by default), no embed has ended for that long, and none is in flight, it issues one one-token embed, so the first search after a quiet stretch is warm (`status` reports both under `embed`). An advance that brings records the cache has no vector for embeds them in the background, a bounded batch at a time, and writes them to the cache file as `head embed` would (`status` reports `vectors.pending` and `vectors.backfill`). `head status`, `head search`, `session put`, `session exec`, `session commit`, and `session rebase` ask it first, and `/v1/exec` runs the script in a pool of worker threads (`MEMHTML_EXEC_POOL_SIZE` at once, by default one fewer than the machine's available parallelism, at least 1 and at most 4; each with a `MEMHTML_EXEC_WORKER_HEAP_MB` heap; one per session id at a time) so a runaway script never stalls a lookup. `/v1/commit` commits one session at a time over the version at its base, the same commit the CLI runs locally, then holds the new commit and writes its snapshot, so a run-end commit costs no head load; with `--drop-refused` a commit behind the tip is rebased onto it and committed again inside the same permit, up to 3 times. The curate commands always load locally. At startup the server logs one line naming the store's policy source (`memhtml.config.json absent: library defaults`, the file's path, or why it does not decode); every request that judges a record reads the file again, and `status` reports it as of the request under `policy`. A live server on the socket refuses a second one (ERR_HEAD_SERVER_RUNNING); a socket left by a killed server is replaced; a store whose socket path is past the platform's limit (107 bytes on Linux, 103 on macOS) is refused before the load with ERR_STORAGE naming the limit, and every client there loads locally. Under win32 the server listens on the named pipe `\\.\pipe\memhtml-` instead of a socket file. The socket is removed on exit, and the envelope reports the ref, final sha, advances, requests, and uptime.
- [memhtml head snapshot](https://memhtml.github.io/reference/commands/head-snapshot.md): Write the version at HEAD as .memhtml/snapshots/.arrow, the cold-start cache, pruning to the newest four, or read that file back and report it. Every ref-moving commit writes this file itself; the command is for a store whose HEAD moved by other means.
- [memhtml head status](https://memhtml.github.io/reference/commands/head-status.md): Report the corpus version and where it came from: the head server's (`source: server`, with the server's ref, load, advances, and uptime under `server`) when one answers on .memhtml/head.sock, else the version at HEAD built here, with its sha, record count, skipped files, load time, and source: `snapshot` (HEAD's own .arrow file), `snapshot+advance` (an ancestor's snapshot advanced over the changed paths, with `ancestorSha` and `reparsed`), or `git`. `policy` says where the store's write policy comes from: `file` (`memhtml.config.json` present, with its `path`), `defaults` (absent: the library defaults, which refuse no type and require no anchor), or `invalid` (present and unreadable or malformed, with the `reason`: every write that needs the policy refuses with ERR_STORE_CONFIG until it is fixed). The head server reads the file when its status is asked and reports the same under `server.policy`, and `head serve` logs the source in one line at startup.
- [memhtml help](https://memhtml.github.io/reference/commands/help.md): Describe one command: usage, arguments, flags, response type, examples. Markdown on a terminal, a cli.help envelope when piped.
- [memhtml hook](https://memhtml.github.io/reference/commands/hook.md): The engine every installed hook calls. Reads the host's hook payload on stdin, runs recall or transcript indexing under a hard time bound, and writes the HOST'S protocol to stdout (plain text or the host's JSON), never this envelope; any failure prints nothing and exits 0, so a hook can never block a turn.
- [memhtml index embed](https://memhtml.github.io/reference/commands/index-embed.md): Fill every chunk that has no vector in the configured space, without a rebuild. Safe to rerun; reports the gap it left.
- [memhtml index rebuild](https://memhtml.github.io/reference/commands/index-rebuild.md): Rebuild index.db from the git tree at HEAD, keeping every stored vector whose chunk survives. Destroys nothing outside .memhtml/.
- [memhtml index status](https://memhtml.github.io/reference/commands/index-status.md): The index watermark, the vector space it was built in, and its row counts.
- [memhtml index update](https://memhtml.github.io/reference/commands/index-update.md): Index only what moved since the recorded watermark, plus the dirty working tree.
- [memhtml init](https://memhtml.github.io/reference/commands/init.md): Scaffold a memory repo at --repo/$MEMHTML_ROOT: git init, PARA dirs, merge driver.
- [memhtml integrations doctor](https://memhtml.github.io/reference/commands/integrations-doctor.md): Check a host's wiring end to end: binary path and version, store root, MCP entry, hooks, instruction block, skill, transcript root, and a live `initialize` handshake with the server the entry names.
- [memhtml integrations install](https://memhtml.github.io/reference/commands/integrations-install.md): Wire a coding agent to this store: its MCP entry, its hooks, a fenced block in its instruction file, and a skill, recorded in a receipt so uninstall removes exactly what install wrote.
- [memhtml integrations list](https://memhtml.github.io/reference/commands/integrations-list.md): For every host: installed, modified, or not installed, at user scope and at the named project scope.
- [memhtml integrations shell](https://memhtml.github.io/reference/commands/integrations-shell.md): Print an eval-able shell snippet that exports MEMHTML_ROOT and puts this binary's directory on PATH; --write appends it to your rc file inside a fence.
- [memhtml integrations uninstall](https://memhtml.github.io/reference/commands/integrations-uninstall.md): Remove exactly what install wrote for one host, matched against the receipt; a managed file that was modified since is refused.
- [memhtml link](https://memhtml.github.io/reference/commands/link.md): Add an authored edge to the source file and commit it. Idempotent.
- [memhtml list](https://memhtml.github.io/reference/commands/list.md): Page through the corpus by type, workspace, tag, entity, facet, or PARA bucket.
- [memhtml manifest](https://memhtml.github.io/reference/commands/manifest.md): Emit this CLI's full machine-readable contract.
- [memhtml neighbors](https://memhtml.github.io/reference/commands/neighbors.md): The memory graph around one path, to a fixed depth of at most two hops.
- [memhtml path](https://memhtml.github.io/reference/commands/path.md): Print the path a write with these fields would land at over the version at HEAD, and the collision ordinal it took. Reads no session: inside one, `session put --dry-run` answers over the session's base and its puts. Writes nothing.
- [memhtml publish](https://memhtml.github.io/reference/commands/publish.md): Regenerate index.html listings and sitemap.xml, remove stale listings, and commit.
- [memhtml read](https://memhtml.github.io/reference/commands/read.md): Read one memory: its metas, links, article, and format warnings.
- [memhtml recall](https://memhtml.github.io/reference/commands/recall.md): A disclosure pack under a character budget: arcs and memories folded separately.
- [memhtml reinforce](https://memhtml.github.io/reference/commands/reinforce.md): Bump access bookkeeping, gated by a 900-second per-path cooldown.
- [memhtml resolve](https://memhtml.github.io/reference/commands/resolve.md): Follow a possibly-moved path forward to the memory that carries the fact now.
- [memhtml search](https://memhtml.github.io/reference/commands/search.md): Ranked search: four RRF arms plus MMR. Degrades to the lexical floor.
- [memhtml serve mcp](https://memhtml.github.io/reference/commands/serve-mcp.md): Run the `memhtml-mcp` stdio server: 15 tools and 2 resources over this same repo.
- [memhtml session commit](https://memhtml.github.io/reference/commands/session-commit.md): Land the session's overlay on its ref as one commit, or report why it cannot: `refused`, `rebase-needed`, or `worktree-dirty`.
- [memhtml session exec](https://memhtml.github.io/reference/commands/session-exec.md): Run a script over the session's view (head plus overlay) in a writable sandbox and harvest its writes into the overlay.
- [memhtml session prune](https://memhtml.github.io/reference/commands/session-prune.md): Remove session state nothing reads again, older than a cutoff: index files, `refs/memhtml/sessions/` refs, stale lock directories, and logs with zero ops. A log that still holds ops is never removed; it is listed under `unlanded`.
- [memhtml session put](https://memhtml.github.io/reference/commands/session-put.md): Append write ops, and label or unlabel ops on existing records, to a session's overlay from a JSONL file.
- [memhtml session rebase](https://memhtml.github.io/reference/commands/session-rebase.md): Move a session's base to its ref's tip, keeping every op. Run it after a `rebase-needed` commit outcome, then commit again.
- [memhtml session start](https://memhtml.github.io/reference/commands/session-start.md): Open a v2 session on the ref's tip: a pointer to that version plus an empty overlay log.
- [memhtml session status](https://memhtml.github.io/reference/commands/session-status.md): The session's base, ref, and overlay log as persisted, and whether the ref has moved past the base.
- [memhtml state export](https://memhtml.github.io/reference/commands/state-export.md): Write .memhtml/state/access.jsonl, the only durable copy of the state plane, and commit.
- [memhtml state import](https://memhtml.github.io/reference/commands/state-import.md): Replay the committed sidecar into state.db. Counters merge by max, never last-wins.
- [memhtml status](https://memhtml.github.io/reference/commands/status.md): Corpus health: HEAD, dirty state, counts by type, edges, index freshness.
- [memhtml task add](https://memhtml.github.io/reference/commands/task-add.md): Open a task: a `task` memory in projects//tasks/ or areas/inbox/tasks/.
- [memhtml task list](https://memhtml.github.io/reference/commands/task-list.md): The task working set: a direct indexed scan with blockers, never ranked retrieval.
- [memhtml task status](https://memhtml.github.io/reference/commands/task-status.md): Move a task's status. `done` stamps AND archives it, in one commit.
- [memhtml trace index](https://memhtml.github.io/reference/commands/trace-index.md): Scan $MEMHTML_TRACE_ROOT for Claude Code transcripts, reading only what changed.
- [memhtml trace links](https://memhtml.github.io/reference/commands/trace-links.md): The memory-session links, from either side.
- [memhtml trace search](https://memhtml.github.io/reference/commands/trace-search.md): FTS over session first-prompts and AI titles. Never enters memory retrieval.
- [memhtml write](https://memhtml.github.io/reference/commands/write.md): Write one memory. Content-hash duplicates return the existing path, uncommitted.
- [Environment variables](https://memhtml.github.io/reference/config.md): Every variable the binary reads, and what it does when one is unset.
- [Contracts](https://memhtml.github.io/reference/contracts.md): Every symbol @memhtml/contracts exports, with the doc comment written beside it in the source.
- [The JSON envelope](https://memhtml.github.io/reference/envelope.md): One JSON envelope per command on stdout, with logs kept on stderr.
- [Error codes](https://memhtml.github.io/reference/error-codes.md): What a failure carries, and where each code comes from.
- [Global flags](https://memhtml.github.io/reference/global-flags.md): The flags every command accepts, whichever command it is.
- [The guide](https://memhtml.github.io/reference/guide.md): The workflow prose the CLI publishes on a first call, one page per topic.
- [authoring](https://memhtml.github.io/reference/guide/authoring.md): The authoring block of the CLI's guide.
- [code-mode](https://memhtml.github.io/reference/guide/code-mode.md): The code-mode block of the CLI's guide.
- [conflicts](https://memhtml.github.io/reference/guide/conflicts.md): The conflicts block of the CLI's guide.
- [first-call](https://memhtml.github.io/reference/guide/first-call.md): The first-call block of the CLI's guide.
- [recall-discipline](https://memhtml.github.io/reference/guide/recall-discipline.md): The recall-discipline block of the CLI's guide.
- [when-to-batch](https://memhtml.github.io/reference/guide/when-to-batch.md): The when-to-batch block of the CLI's guide.
- [write-surfaces](https://memhtml.github.io/reference/guide/write-surfaces.md): The write-surfaces block of the CLI's guide.
- [MCP resources](https://memhtml.github.io/reference/mcp-resources.md): What a client can fetch by URI: the file behind an answer and a memory pinned at a commit.
- [MCP tools](https://memhtml.github.io/reference/mcp-tools.md): The tools the stdio server publishes, in the order a client receives them.
- [Packages](https://memhtml.github.io/reference/packages.md): Every workspace package, what it owns, and which siblings it imports.
- [Requirements](https://memhtml.github.io/reference/requirements.md): Every requirement in the ledger, its status, and the method that verifies it.
- [Response types](https://memhtml.github.io/reference/response-types.md): The `type` field a caller reads before it parses `data`.
- [RRF arms](https://memhtml.github.io/reference/rrf-arms.md): The ranking arms, their weights, and what each one needs before it can fire.
- [Database schema and migrations](https://memhtml.github.io/reference/schema.md): The two SQLite planes, and every migration that builds them.
- [Closed vocabularies](https://memhtml.github.io/reference/vocabulary.md): The fixed sets a value must come from: memory types, edge relations, PARA buckets, task statuses, and edge provenance.
- [Internals](https://memhtml.github.io/internals.md): Why the system is built the way it is, with the implementing code cited for every decision.
- [Concurrency and conflicts](https://memhtml.github.io/internals/concurrency-and-conflicts.md): Git supplies the concurrency control, the checkout lock keeps two writers out of each other's staged files, a session that loses a race answers rebase-needed, and a curation run never moves main until a merge lands it.
- [Edge encoding](https://memhtml.github.io/internals/edge-encoding.md): Authored edges live in the HTML, a derived edge could live only in the index and nothing writes one now, and four edge classes that never mix keep task edges out of the memory graph.
- [Four-arm retrieval](https://memhtml.github.io/internals/four-arm-retrieval.md): Four rankers folded into one SQL statement, weighted rank fusion, degradation as a filter, a diversification pass, and the disclosure fold.
- [The index plane and the state plane](https://memhtml.github.io/internals/index-plane-and-state-plane.md): What git cannot reproduce, why it is gitignored anyway, and the byte-stable committed sidecar that is the only durable copy of its access rows.
- [Measured standing](https://memhtml.github.io/internals/measured-standing.md): The benchmark numbers this system has measured, with the caveat about judges that governs how to read them.
- [Packages and dependency direction](https://memhtml.github.io/internals/packages-and-dependency-direction.md): The layering, the test that enforces the pure packages' purity, the single place every service is wired together, and why sixteen packages ship as one.
- [Sessions and the commit path](https://memhtml.github.io/internals/sessions-and-the-commit-path.md): How the corpus is held as a value, why a session is a pointer to one version plus a log of its own operations, and the mechanical steps a session commit takes to validate, build a tree, and move a ref under the checkout lock.
- [Store layout and path algebra](https://memhtml.github.io/internals/store-layout-and-path-algebra.md): Four fixed top-level buckets, placement as a pure total function, and an archive mapping that can be inverted.
- [Testing posture](https://memhtml.github.io/internals/testing-posture.md): A real driver and a real git binary, fakes at the two network edges only, property tests over the pure packages, and a quality gate that refuses on one inversion.
- [The envelope contract](https://memhtml.github.io/internals/the-envelope-contract.md): One JSON envelope per command, append-only response types and error codes, and a tool surface whose two hard constraints come from the transport rather than from taste.
- [The extension contract](https://memhtml.github.io/internals/the-extension-contract.md): Which axes a consumer may model its own domain on, which vocabularies are closed and why, and what a published version bump may change.
- [The index](https://memhtml.github.io/internals/the-index.md): Two databases on one connection, a schema whose keys expect the primary key to move, and one projection function that rebuild and incremental update share.
- [The memory file format](https://memhtml.github.io/internals/the-memory-file-format.md): A fixed HTML5 vocabulary where every element carries indexing meaning, two hashes with two separate jobs, and a validity check that runs before anything is written.
- [The trace indexer](https://memhtml.github.io/internals/the-trace-indexer.md): A read-only index over session transcripts that stores pointers rather than content, with a table-name firewall keeping it out of retrieval.
- [The write path](https://memhtml.github.io/internals/the-write-path.md): How ordering does the duplicate detection, why a batch is one commit and one index pass, and why the conflict assist only reports.
- [API](https://memhtml.github.io/api.md): The generated reference for the workspace packages, one directory per package and one page per module, built from the TSDoc in the source on every site build.
- [@memhtml/contracts](https://memhtml.github.io/api/contracts.md)
- [edges](https://memhtml.github.io/api/contracts/edges.md)
- [errors](https://memhtml.github.io/api/contracts/errors.md)
- [paths](https://memhtml.github.io/api/contracts/paths.md)
- [slug](https://memhtml.github.io/api/contracts/slug.md)
- [types](https://memhtml.github.io/api/contracts/types.md)
- [@memhtml/domain](https://memhtml.github.io/api/domain.md)
- [@memhtml/eval](https://memhtml.github.io/api/eval.md)
- [@memhtml/head](https://memhtml.github.io/api/head.md)
- [@memhtml/html](https://memhtml.github.io/api/html.md)
- [@memhtml/index](https://memhtml.github.io/api/index-package.md)
- [@memhtml/integrations](https://memhtml.github.io/api/integrations.md)
- [@memhtml/llm](https://memhtml.github.io/api/llm.md)
- [@memhtml/session](https://memhtml.github.io/api/session.md)
- [@memhtml/snapshot](https://memhtml.github.io/api/snapshot.md)
- [@memhtml/store](https://memhtml.github.io/api/store.md)
- [@memhtml/telemetry](https://memhtml.github.io/api/telemetry.md)
- [@memhtml/traces](https://memhtml.github.io/api/traces.md)
- [Glossary](https://memhtml.github.io/glossary.md): The project's domain vocabulary, one entry each, with the page that develops the term.