The specification (section 20) leaves technology choices open and asks for each consequential choice to be recorded with alternatives and trade-offs. These records describe the choices this implementation made, most of them while building phases 1 to 3. Status is “accepted” unless noted. A change to one of them is a new record that supersedes it.
db/app.sqlite, WAL mode) is the source of truth for every record; schema changes only
through migrations. FTS5 provides lexical search with BM25.VACUUM INTO, simple restores. One writer at a time and one
application process per database, which fits a team-sized installation; a hosted multi-tenant service (roadmap
phase 6) would need PostgreSQL. G3DB limits (8 parameters, no column names, open result sets) shape the data code.
The database must never be opened from the host (WAL file ownership, see AGENTS.md).nomic-embed-text, 768 dimensions), vectors in Qdrant, both as
containers. Lexical and vector rankings are fused with reciprocal rank fusion (k = 60); vector hits below
EmbeddingMinScore 0.6 are ignored. SQLite's embedding_index table tracks model, dimensions and revision per item,
so the vector store can be rebuilt from SQLite at any time (embed.cmd reindex).tests/retrieval-benchmark.sh) must be rerun before changing the model or the cutoff.core/lib.JsonLite.asp and compose responses as text.G3JSON. Rejected because, in a request that also uses G3DB, it caused silent lost writes and
stale values (AGENTS.md section 8).jobs table with their input. Processing is claimed with a conditional UPDATE
and a 5-minute lease; the embed-worker container picks up queued, interrupted and retryable jobs every 30 seconds.
Publishing and the job update share one transaction.provision.cmd/ops.sh and no dependency on an identity service. Key
rotation and revocation are manual. An OIDC front end can be added later without changing the data model.POST /learn); a principal with verify reviews them, and
the author cannot approve its own proposal without admin. Verification is stored per revision, so a correction
starts unverified. Trusted retrieval returns only verified items by default.kb.sh candidates / review).POST /context counts tokens as characters / 4 (counting_method estimate_chars_div_4, stated in every
response). Constraints are required: if they do not fit, the answer is 422 context_budget_exceeded.agent-memory-export format, schema_version 1, with a SHA-256 digest over the exact data
text. Imports keep ids, revisions, timestamps and author ids, rebuild derived data and are all-or-nothing. Unknown
author ids get placeholder principals (no keys, cannot sign in)./api/v1/metrics behind a token, counters held in process memory. Backups are verified SQLite copies in
db/backups/, restored with the server stopped.provision.cmd / ops.sh), which needs shell access to the
host. The specification lists management endpoints as mandatory “API or secure configuration”./me, /namespaces, /principals, /principals/{id}/keys,
/keys/{id}, /grants) with authorization derived from the existing namespace grants, no new role:
admin on a namespace allows granting and revoking access on it; granting with inherit, and creating namespaces
below it, needs an admin grant that itself inherits.Cache-Control: no-store; no Idempotency-Key replay for
responses that contain a key.POST /learn). The specification requires the core workflow to work without generative inference (AC-16) and
forbids automated approval.POST /consolidations groups a namespace's experiences by lexical similarity (significant words, Jaccard
= 0.35 by default, at least 2 shared words, words present in more than half of the experiences ignored, connected components) and builds a draft that only rearranges the experiences’ own text. Proposing is explicit (
"propose": true), creates ordinary proposed candidates citing the experiences, and an experience already cited by any candidate is not proposed again until enough new ones accumulate.
POST /learn.documents.format only allows text and markdown, and changing a
CHECK constraint in SQLite means rebuilding the table (and a new export schema version for a new canonical column).format: "html" is converted to Markdown in the request, before the job is stored; the document is a
markdown document and locators point into that text. The page's URL belongs in source_uri; the original HTML is not
stored. Conversion is RegExp-based in VBScript (core/lib.HtmlAdapter.asp): invisible and active content is dropped, the
structure the chunker understands (headings, lists, pre, tables) is kept, and nothing referenced by the page is
fetched (no SSRF surface).entities (type plus canonical key unique per namespace, aliases, properties) and
relationships (source and target as kind plus id, type, validity window, confidence, inferred flag, state).
Edges are proposed with POST /relate and need at least one evidence link, stored in evidence_links with owner kind
relationship (the migration rebuilds that table to widen its CHECK). They are reviewed like learning candidates:
verify permission, no self-review without admin. An edge is visible only when the caller can read the edge's
namespace and both endpoints’ namespaces; the check is one SQL condition per side (Graph_NodeVisibleSql), so lists,
fetches, traversal and exports apply the same rule and leave hidden edges out without a trace. POST /graph/traverse
is a breadth-first search over accepted edges valid now (proposed ones on request), skipping retired memories, with
limits of depth 3, 100 nodes and 300 edges and a truncated flag. Deleting a memory or an entity deletes its edges.
Export schema version 2 adds entities and the relationships whose namespace and both endpoints are exported; imports
accept versions 1 and 2.Powered by TurnKey Linux.