For the complete documentation index, see llms.txt. This page is also available as Markdown.

Wiki API

Natural-language and structured access to the tenant's memory graph. The Wiki is downstream of the Ledger. Narrative, evidence-cited recall. And is never the source of truth for balances, transactions, or permissions.

Operation
Endpoint

Ask a natural-language question

POST /v1/wiki/question

Search entities

GET /v1/wiki/search

Get an entity

GET /v1/wiki/entity/{entity_id}

Evidence chain for an entity

GET /v1/wiki/entity/{entity_id}/evidence

Temporal history for an entity

GET /v1/wiki/entity/{entity_id}/history

Annotate (human correction)

POST /v1/wiki/annotate

Get the entity-kind JSON Schemas

GET /v1/wiki/schema

List memory pages

GET /v1/memory/pages

Get a memory page

GET /v1/memory/pages/{slug_or_id}

Regenerate a memory page

POST /v1/memory/regenerate

Search memory pages

GET /v1/memory/search

Ask a Question

POST /v1/wiki/question
Authorization: Bearer <token>
Content-Type: application/json

{
  "question":             "What did we spend on AWS last quarter, by environment?",
  "as_of":                "2026-03-31T23:59:59Z",
  "max_evidence_depth":   3
}

question is 1–2000 chars. max_evidence_depth defaults to 3 (max 5). This route puts an LLM in the hot path. Per-call costs apply. Every answer carries evidence_path back to Ledger rows and Raw artifacts.

Search Entities

Query params: kind (policy | agent), q (full-text), semantic (pgvector), since, until, limit (default 50, max 500), cursor. Pass semantic=<string> to run a pgvector similarity search instead of (or in addition to) full-text.

Wiki search returns only Wiki-resident kinds. The four Ledger kinds (account, counterparty, transaction, obligation) are rejected with request_params_invalid and a redirect hint to the corresponding /v1/ledger/* endpoint, since financial truth lives in the Ledger, not the Wiki.

Get an Entity

as_of enables bitemporal reads. The entity as it was known at that moment.

Evidence Chain

The full provenance trail behind a Wiki entity:

Temporal History

Every version of the entity, oldest first:

Annotate (Human Correction)

A human can correct a Wiki entity or relation; the annotation is applied as a new temporal version with provenance: "human_confirmed" rather than mutating the prior row.

The body is oneOf: an EntityAnnotation (above) or a RelationAnnotation (relation_id instead of entity_id).

Get the Entity-Kind Schemas

The JSON Schema(s) describing every Wiki entity kind:

Returns { counterparty: <JSON Schema document>, ... }. Omit kind for the full set.

Memory Pages

Memory pages are pre-rendered narrative views (Markdown) over the Ledger graph. "the AWS page," "Q1 cash flow," "vendor X relationship." Browsable and searchable.

page_type enum: account | counterparty | obligation | invoice | agent | policy | monthly_summary | cash_flow.

Get one page by slug or id:

Regenerate a page (after the underlying Ledger has changed):

Search memory pages by content:

Provenance Fields

| Field | Description | | ----------------- | --------------------------------------------------- | -------- | --------- | --------------- | ------------------ | | evidence_path | Ledger and Raw refs the answer depends on (Q&A) | | source_evidence | Raw refs the entity was extracted from (entity get) | | provenance | extracted | inferred | ambiguous | human_confirmed | agent_contributed | | confidence | Calibrated 0 to 1 score |

What's Next

🧠 The Wiki

The conceptual model.

Last updated