Files
poimen-memory/public/sequence.json
T
rock 3d8b74e9bf
CI / CI (pull_request) Successful in 12m2s
docs: add architecture, dataflow, sequence diagrams
Interactive HTML diagrams in public/:
- architecture.html: System components (API, Worker, LLM, pgvector, Auth)
- dataflow.html: Ingest pipeline (Episode → Extract → Store → Serve)
- sequence.html: Ingest request lifecycle (Agent → API → Queue → Worker → LLM → DB)

All pass archify showcase validation (9/9 checks).
2026-09-10 07:38:45 +09:00

52 lines
3.5 KiB
JSON

{
"schema_version": 1,
"diagram_type": "sequence",
"meta": {
"title": "Poimen Ingest Request Lifecycle",
"quality_profile": "showcase",
"viewBox": [1020, 620],
"column_fit": "spread"
},
"participants": [
{ "id": "agent", "type": "external", "label": "AI Agent", "sublabel": "client" },
{ "id": "api", "type": "backend", "label": "Memory API", "sublabel": "actix-web" },
{ "id": "queue", "type": "messagebus", "label": "Queue", "sublabel": "ingest jobs" },
{ "id": "worker", "type": "backend", "label": "Worker", "sublabel": "pipeline" },
{ "id": "llm", "type": "external", "label": "LLM", "sublabel": "Ollama" },
{ "id": "db", "type": "database", "label": "pgvector", "sublabel": "postgres" }
],
"segments": [
{ "from": 150, "to": 240, "label": "Ingest" },
{ "from": 250, "to": 440, "label": "Extraction" },
{ "from": 450, "to": 560, "label": "Persist" }
],
"messages": [
{ "id": "ingest-req", "from": "agent", "to": "api", "y": 160, "label": "POST /memory/ingest", "variant": "emphasis" },
{ "id": "enqueue", "from": "api", "to": "queue", "y": 185, "label": "enqueue job", "variant": "default" },
{ "id": "accept", "from": "api", "to": "agent", "y": 210, "label": "202 pending", "variant": "return" },
{ "id": "poll", "from": "worker", "to": "queue", "y": 258, "label": "poll job", "variant": "default" },
{ "id": "job", "from": "queue", "to": "worker", "y": 290, "label": "episode records", "variant": "return" },
{ "id": "extract-entities", "from": "worker", "to": "llm", "y": 315, "label": "extract entities", "variant": "emphasis" },
{ "id": "entities-resp", "from": "llm", "to": "worker", "y": 345, "label": "JSON entities", "variant": "return" },
{ "id": "extract-facts", "from": "worker", "to": "llm", "y": 375, "label": "extract facts (entity pairs)", "variant": "emphasis" },
{ "id": "facts-resp", "from": "llm", "to": "worker", "y": 405, "label": "JSON edges", "variant": "return" },
{ "id": "save-entities", "from": "worker", "to": "db", "y": 460, "label": "INSERT memory_entity", "variant": "default" },
{ "id": "save-edges", "from": "worker", "to": "db", "y": 490, "label": "INSERT memory_edge", "variant": "default" },
{ "id": "embed", "from": "worker", "to": "db", "y": 520, "label": "store embeddings", "variant": "dashed" },
{ "id": "done", "from": "worker", "to": "queue", "y": 535, "label": "mark done", "variant": "return" }
],
"activations": [
{ "participant": "api", "from": 155, "to": 220, "type": "backend" },
{ "participant": "queue", "from": 180, "to": 295, "type": "messagebus" },
{ "participant": "worker", "from": 255, "to": 555, "type": "backend" },
{ "participant": "llm", "from": 310, "to": 350, "type": "external" },
{ "participant": "llm", "from": 370, "to": 410, "type": "external" },
{ "participant": "db", "from": 455, "to": 530, "type": "database" }
],
"cards": [
{ "dot": "emerald", "title": "Async Ingest", "items": ["Agent gets 202 immediately, no blocking", "Worker polls jobs from queue independently", "Decoupled ingest from extraction latency"] },
{ "dot": "cyan", "title": "LLM Extraction", "items": ["First call: extract named entities with types", "Second call: extract relationships between entity pairs", "JSON response cleaned of thinking tags and fences"] },
{ "dot": "orange", "title": "Persistence", "items": ["Entities saved with type, summary, confidence", "Edges saved with temporal fields (t_valid, t_invalid)", "Embeddings stored for vector similarity search"] }
]
}