158 lines
3.3 KiB
JSON
158 lines
3.3 KiB
JSON
{
|
|||
|
|
"schema_version": 1,
|
||
|
|
"diagram_type": "dataflow",
|
||
|
|
"meta": {
|
||
|
|
"title": "Poimen Memory \u2014 Schema Relations",
|
||
|
|
"viewBox": [
|
||
|
|
960,
|
||
|
|
480
|
||
|
|
],
|
||
|
|
"quality_profile": "showcase"
|
||
|
|
},
|
||
|
|
"stages": [
|
||
|
|
{
|
||
|
|
"label": "Episodes"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"label": "Entities"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"label": "Relationships"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"label": "Indexes"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"nodes": [
|
||
|
|
{
|
||
|
|
"id": "node",
|
||
|
|
"type": "database",
|
||
|
|
"label": "memory_node",
|
||
|
|
"sublabel": "Raw messages",
|
||
|
|
"stage": 0,
|
||
|
|
"row": 0,
|
||
|
|
"tag": "BIGSERIAL"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "entity",
|
||
|
|
"type": "database",
|
||
|
|
"label": "memory_entity",
|
||
|
|
"sublabel": "Named entities",
|
||
|
|
"stage": 1,
|
||
|
|
"row": 0,
|
||
|
|
"tag": "UUID + tenant_id"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "community",
|
||
|
|
"type": "database",
|
||
|
|
"label": "memory_community",
|
||
|
|
"sublabel": "Clusters (Phase 4)",
|
||
|
|
"stage": 1,
|
||
|
|
"row": 1,
|
||
|
|
"tag": "UUID"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "edge",
|
||
|
|
"type": "database",
|
||
|
|
"label": "memory_edge",
|
||
|
|
"sublabel": "Facts + bi-temporal",
|
||
|
|
"stage": 2,
|
||
|
|
"row": 0,
|
||
|
|
"tag": "UUID + tenant_id"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "hnsw",
|
||
|
|
"type": "cloud",
|
||
|
|
"label": "HNSW Index",
|
||
|
|
"sublabel": "768-dim cosine",
|
||
|
|
"stage": 3,
|
||
|
|
"row": 0,
|
||
|
|
"tag": "pgvector"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"id": "fts",
|
||
|
|
"type": "cloud",
|
||
|
|
"label": "GIN Index",
|
||
|
|
"sublabel": "ts_rank BM25",
|
||
|
|
"stage": 3,
|
||
|
|
"row": 1,
|
||
|
|
"tag": "full-text"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"flows": [
|
||
|
|
{
|
||
|
|
"from": "node",
|
||
|
|
"to": "entity",
|
||
|
|
"label": "LLM extraction",
|
||
|
|
"classification": "ingest",
|
||
|
|
"variant": "emphasis",
|
||
|
|
"route": "straight"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"from": "entity",
|
||
|
|
"to": "edge",
|
||
|
|
"label": "source + target FK",
|
||
|
|
"classification": "foreign key",
|
||
|
|
"variant": "emphasis",
|
||
|
|
"route": "straight"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"from": "entity",
|
||
|
|
"to": "community",
|
||
|
|
"label": "community_id",
|
||
|
|
"classification": "membership",
|
||
|
|
"variant": "dashed",
|
||
|
|
"route": "straight",
|
||
|
|
"labelDy": 30
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"from": "edge",
|
||
|
|
"to": "hnsw",
|
||
|
|
"classification": "vector",
|
||
|
|
"variant": "default",
|
||
|
|
"route": "straight",
|
||
|
|
"label": "embedding",
|
||
|
|
"labelDy": -30
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"from": "edge",
|
||
|
|
"to": "fts",
|
||
|
|
"label": "fact text",
|
||
|
|
"classification": "text",
|
||
|
|
"variant": "dashed",
|
||
|
|
"route": "vertical-channel",
|
||
|
|
"labelDy": 30
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"cards": [
|
||
|
|
{
|
||
|
|
"dot": "emerald",
|
||
|
|
"title": "Three-Tier Graph",
|
||
|
|
"items": [
|
||
|
|
"memory_node \u2192 episodes (raw messages)",
|
||
|
|
"memory_entity \u2192 extracted entities",
|
||
|
|
"memory_edge \u2192 facts between entities",
|
||
|
|
"memory_community \u2192 clusters (Phase 4)"
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"dot": "rose",
|
||
|
|
"title": "Bi-Temporal + Tenant",
|
||
|
|
"items": [
|
||
|
|
"t_valid/t_invalid: when true in reality",
|
||
|
|
"t_created/t_expired: system transaction time",
|
||
|
|
"tenant_id: row-level multi-tenant isolation",
|
||
|
|
"Contradiction: active \u2192 candidate \u2192 confirmed"
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"dot": "cyan",
|
||
|
|
"title": "Search Indexes",
|
||
|
|
"items": [
|
||
|
|
"HNSW: name, summary, fact embeddings",
|
||
|
|
"GIN: ts_rank on name+summary and fact",
|
||
|
|
"RRF fusion: sem_weight + lex_weight"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|