Design: Entity wiki & edge statements

Entity pages are compiled from the graph. They make connected facts readable without introducing another place to author or synchronize knowledge.

Single source of truth#

The graph is the knowledge source of truth: durable facts live as entities + triples, with Library documents retained as provenance. “Memories” is a first-person view, not a second write path. An entity wiki is a compiled view of an entity’s neighborhood, not a separately authored document store.

LayerRole
LibrarySource documents
GraphWalkable world model
MemoriesFirst-person cards (owner-reachable)
Entity wikiView-time article for any entity
OntologyExtract vocabulary — not visibility

Provenance (source_doc_id, doc meta.source) distinguishes “I said this” (chat) from sync/library — filter views by that; don’t fork schemas.

In the shipped Knowledge UI, selecting an entity opens its wiki: About, an optional Summary, relations grouped by predicate, direction and source badges, and source documents. Editing the wiki is intentionally not a product concept; correct the source or graph relation and the view recompiles.

Edge statements#

Triples keep a short predicate for routing/collapse (attended, works_at, breed) and an optional statement — grounded prose for display/citation (“Attended the Program on Negotiation”).

Prefer reifying rich middles as entities when walkable:

  • Person -[attended]-> Workshop · statement optional
  • Example Workshop -[at]-> Example Institute

Ask walks endpoints; UI/wiki prefer statement when present, else format_fact.

Wiki compilation (view-time)#

GET /v1/graph/entities/{id}/wiki (and Graph/Knowledge entity detail):

  1. Entity + verified one-hop neighbors, limited to durable predicates
  2. Sections: About (description), Summary, Relations (grouped), Sources
  3. A structural summary is always available; an optional cached LLM summary in kv (entity.wiki.summary:{id}) is used only while its edge fingerprint matches
  4. Neighborhoods with at least six durable verified edges may be marked for compaction by the memory_groom workflow

Do not persist wiki markdown as canonical.