ARCHOS 525 BLUEPRINT · /d/dgm_llm-context-window-and-compaction
Context window management and compaction
7 COMPONENTS · 6 FLOWS · UPDATED 2026-11-23
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_llm-context-window-and-compaction) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_llm-context-window-and-compaction)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_llm-context-window-and-compaction" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Context window management and compaction — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
src_0[("Client application")]
n0_1["AI gateway"]
n1_2[("Workflow orchestrator")]
n2_3[("Vector database")]
n3_4["Inference server"]
ctrl_5["OpenTelemetry Collector"]
sink_6[("Client application")]
src_0 -->|"1. Budgets · HTTPS"| n0_1
n0_1 -->|"2. Compacts · HTTP/2"| n1_2
n1_2 -->|"3. Archives · gRPC"| n2_3
n2_3 -->|"4. Infers · HTTPS"| n3_4
n3_4 -->|"5. Sharp ans · HTTPS"| sink_6
n0_1 -->|"Tracks ctx · OTLP"| ctrl_5COMPONENT STACK (7)
- Client applicationSTATEFULLong multi-turn chat
- AI gatewaySTATELESSToken budget allocator
- Workflow orchestratorSTATEFULPinned sys + scratchpad
- Vector databaseSTATEFULOffloads cold turns
- Inference serverSTATELESSHigh-signal context
- OpenTelemetry CollectorSTATELESSContext fill % & cost
- Client applicationSTATEFULZero context rot
REQUEST & DATA FLOW (6)
- Client application → AI gateway (Budgets)[HTTPS]
- AI gateway → Workflow orchestrator (Compacts)[HTTP/2]
- Workflow orchestrator → Vector database (Archives)[gRPC]
- Vector database → Inference server (Infers)[HTTPS]
- Inference server → Client application (Sharp ans)[HTTPS]
- AI gateway → OpenTelemetry Collector (Tracks ctx)[OTLP]