01
Bootstrap layer
The runtime is installed into each repository with phantasm bootstrap.
That creates the local .phantasm/ layout, tracked config files, and the
state directory that holds the live runtime.
Architecture
Phantasm is a project-scoped memory runtime for coding agents. At a high level, it is a
local system that bootstraps into a repository, stores durable memory in a single
authoritative runtime, and answers explicit operations like ingest,
search, and compile through a deterministic request contract.
Design idea
Many competing systems optimize for cross-session recall, graph retrieval, or generic agent state. Phantasm’s design is narrower and more opinionated: memory belongs to the repository, should be bootstrapped locally, and should expose explicit operational semantics instead of behaving like a hidden background layer.
01
The runtime is installed into each repository with phantasm bootstrap.
That creates the local .phantasm/ layout, tracked config files, and the
state directory that holds the live runtime.
02
Phantasm exposes one explicit JSON request/response contract through
handle-request. Operations are versioned, auditable, and separated into
mutations, reads, snapshots, and maintenance flows.
03
The source of truth is one authoritative SQLite store per project under
.phantasm/state/store.sqlite. Runtime caches may exist, but durable memory
truth lives in local state, not in prompt text or transient agent memory.
04
The runtime stores authoritative records, suggestions, review items, raw evidence, operations, idempotency receipts, trust decisions, and backup metadata. The system is designed to preserve lifecycle and auditability, not just similarity search hits.
Runtime layout
.phantasm/
├── phantasm.toml
├── clients.toml
└── state/
├── store.sqlite
├── backups/
├── indexes/
├── logs/
├── raw/
└── tmp/
The important split is declarative config versus mutable local state. Config drives behavior; the SQLite-backed runtime holds the memory truth.
For the exact supported config keys today, use the configuration reference.
Operational flow
The client sends a versioned request envelope with operation, client profile, and parameters.
The runtime validates the request, trust profile, confirmations, and idempotency requirements.
The operation reads or mutates the project-scoped store against a stable snapshot or serialized write boundary.
The response returns machine-readable data, warnings, review items, remediation, and provenance summary.
Compile model
The project README frames Phantasm as a context compiler rather than a simple memory lookup layer. Conceptually, the runtime ingests structured project truth, resolves contradictions and lineage, determines what is live, profiles importance, allocates what fits within a token budget, and assembles the final context payload in model-aware order.
Even where the current codebase is still maturing toward that broader design, the implementation is already shaped around explicit operations, deterministic behavior, and durable project-local state rather than “store embeddings and hope retrieval works.”
High-level comparison
Implementation principles
Why this matters