Skip to main content
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
[![Context window management and compaction — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_llm-context-window-and-compaction/opengraph-image)](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_5

COMPONENT STACK (7)

  • Client applicationSTATEFUL
    Long multi-turn chat
  • AI gatewaySTATELESS
    Token budget allocator
  • Workflow orchestratorSTATEFUL
    Pinned sys + scratchpad
  • Vector databaseSTATEFUL
    Offloads cold turns
  • Inference serverSTATELESS
    High-signal context
  • OpenTelemetry CollectorSTATELESS
    Context fill % & cost
  • Client applicationSTATEFUL
    Zero context rot

REQUEST & DATA FLOW (6)

  1. Client application → AI gateway (Budgets)[HTTPS]
  2. AI gateway → Workflow orchestrator (Compacts)[HTTP/2]
  3. Workflow orchestrator → Vector database (Archives)[gRPC]
  4. Vector database → Inference server (Infers)[HTTPS]
  5. Inference server → Client application (Sharp ans)[HTTPS]
  6. AI gateway → OpenTelemetry Collector (Tracks ctx)[OTLP]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →