ARCHOS 525 BLUEPRINT · /d/dgm_agent-context-engineering-patterns
Context engineering for agents (budget, compaction, prefix caching, loop)
14 COMPONENTS · 18 FLOWS · UPDATED 2026-11-21
GITHUB README / PR PREVIEW CARD
[](https://archos.sageideas.dev/d/dgm_agent-context-engineering-patterns) *Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_agent-context-engineering-patterns)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_agent-context-engineering-patterns" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Context engineering for agents (budget, compaction, prefix caching, loop) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
client_0[("Web Client")]
alerting_1[("Alerting")]
session_2[("Session store")]
vector_3[("Vector database")]
registry_4[("Prompt and config registry")]
orch_5[("Agent orchestration runtime")]
summ_6["Inference server"]
obj_7[("Object storage")]
tsdb_8[("Time-series database (TSDB)")]
infer_9["Inference server"]
toolgw_10["Function calling"]
pdp_11["Policy decision point (PDP)"]
secrets_12[("Secrets manager")]
capacity_13["Capacity Estimate"]
client_0 -->|"1. Asks with JWT · HTTPS"| orch_5
orch_5 -->|"2. Reads, saves turns · HTTP/2"| session_2
session_2 -->|"3. Returns turns · HTTP/2"| orch_5
orch_5 -->|"4. Searches memories · HTTP/2"| vector_3
vector_3 -->|"5. Returns top items · HTTP/2"| orch_5
orch_5 -->|"6. Prompt, prefix first · HTTP/2"| infer_9
infer_9 -->|"7. Returns reply · HTTP/2"| orch_5
orch_5 -->|"8. Calls tool · HTTP/2"| toolgw_10
toolgw_10 -->|"9. Returns result · HTTP/2"| orch_5
orch_5 -->|"10. Relays answer · HTTPS"| client_0
registry_4 -->|"Supplies pinned prefix · HTTP/2"| orch_5
orch_5 -->|"Summarizes old turns · HTTP/2"| summ_6
orch_5 -->|"Stores raw result · HTTPS"| obj_7
toolgw_10 -->|"Asks, fails closed · HTTP/2"| pdp_11
secrets_12 -->|"Supplies tool keys · HTTPS"| toolgw_10
orch_5 -->|"Exports (OTLP) · OTLP"| tsdb_8
infer_9 -->|"Exports (OTLP) · OTLP"| tsdb_8
tsdb_8 -->|"Feeds Alerting · HTTP"| alerting_1COMPONENT STACK (13)
- Web ClientSTATEFULStaff member on an untrusted network
- AlertingSTATEFULOn-call pager outside our boundary
- Session storeSTATEFULTurns and the summary, 24 hours
- Vector databaseSTATEFULMemories by embedding, per user
- Prompt and config registrySTATEFULPinned prefix: system prompt, tools
- Agent orchestration runtimeSTATEFULBuilds each prompt inside the budget
- Inference serverSTATELESSSmall model that summarizes turns
- Object storageSTATEFULRaw tool results, kept by id
- Time-series database (TSDB)STATEFULPrompt tokens, cache hits, loops
- Inference serverSTATELESSMain model; reuses a shared prefix
- Function callingSTATELESSRuns only tools the PDP allows
- Policy decision point (PDP)STATELESSAllows tools per user
- Secrets managerSTATEFULHolds the tool keys
REQUEST & DATA FLOW (18)
- Web Client → Agent orchestration runtime (Asks with JWT)[HTTPS]
- Agent orchestration runtime → Session store (Reads, saves turns)[HTTP/2]
- Session store → Agent orchestration runtime (Returns turns)[HTTP/2]
- Agent orchestration runtime → Vector database (Searches memories)[HTTP/2]
- Vector database → Agent orchestration runtime (Returns top items)[HTTP/2]
- Agent orchestration runtime → Inference server (Prompt, prefix first)[HTTP/2]
- Inference server → Agent orchestration runtime (Returns reply)[HTTP/2]
- Agent orchestration runtime → Function calling (Calls tool)[HTTP/2]
- Function calling → Agent orchestration runtime (Returns result)[HTTP/2]
- Agent orchestration runtime → Web Client (Relays answer)[HTTPS]
- Prompt and config registry → Agent orchestration runtime (Supplies pinned prefix)[HTTP/2]
- Agent orchestration runtime → Inference server (Summarizes old turns)[HTTP/2]
- Agent orchestration runtime → Object storage (Stores raw result)[HTTPS]
- Function calling → Policy decision point (PDP) (Asks, fails closed)[HTTP/2]