The Agentic Primitives Stack
Most orchestration failures are primitive failures in disguise. A four-layer model for why agentic systems break.
Agents · Distributed Systems · Architecture
The core claim
Most agentic AI projects don't fail because the model is bad or the orchestration is wrong. They fail because nobody treated it as a systems engineering problem. "Agentic AI" is a vocabulary signal that we've crossed into systems territory — and systems have architecture.
The stack
Orchestration patterns ← loops, fan-out, supervisor agents, handoffs
↓
Harness / Runtime ← Claude Code, Codex — policies, tool routing, context injection
↓
Primitives ← state, memory, context, grounding, tool execution
↓
Model ← the LLM itself
The key insight: Orchestration frameworks (LangGraph, CrewAI, AutoGen) are pattern libraries that sit at the top of this stack. They assume the primitives are solved. They're often not. Most orchestration failures are actually primitive failures in disguise.
The primitives
State & Memory
- In-context memory — what's in the active window right now
- External retrieval — RAG, vector search, filesystem reads
- Persistence — what survives across sessions and agent handoffs
Context
- What gets passed between agents
- How context is scoped — per agent vs. shared
- Coherency — who has the authoritative version when two agents have seen different things
Grounding
- When to retrieve vs. recall (existence queries always hit source; reference data can be recalled)
- Freshness rules per data type
- Verification before any consequential action
Tool execution
- Calling tools reliably
- Handling failures and retries
- Knowing when a tool result is stale or invalid
The harness layer
Harnesses like Claude Code and Codex sit between the primitives and orchestration. They handle a lot — tool routing, context injection, permissions, hooks. But they enforce policies you define. If you haven't defined grounding rules, retrieval triggers, or context scoping — the harness has nothing to enforce.
The harness is where primitive policies live. It's not where primitives get solved automatically.
Why orchestration fails
Most teams debug at the orchestration layer — loops not terminating, agents repeating steps, handoffs losing state — when the actual failure is one level down:
- Agent reads stale context → grounding primitive not solved
- Two agents disagree on shared state → context coherency primitive not solved
- Agent confident about wrong answer → retrieval trigger not defined
- Session loses progress → persistence primitive not solved
Fix the primitive, orchestration problem disappears.
The cache analogy (memory management)
Context management within a single agent maps 1:1 to cache management:
| Cache concept | Agent equivalent |
|---|---|
| Cache hit | Answering from in-context recall |
| Cache miss | Triggering a tool call for fresh data |
| TTL | How long a loaded doc can be trusted |
| Cache invalidation | Stale context — still the hardest problem |
| L1/L2/L3 hierarchy | Active window → session artifacts → filesystem/API |
| Cache-Control headers | Retrieval trigger rules in harness config |
Phil Karlton: "There are only two hard problems in computer science: cache invalidation and naming things." Agentic systems are running into both.
Multi-agent context (next frontier)
When multiple agents share state, the problem becomes distributed cache coherency — exactly what distributed databases solved 20 years ago. No single agent knows what others have written. Solutions transfer directly:
- Write-through: update shared state immediately on every write
- Read-through: always retrieve before acting on shared state
- Eventual consistency: acceptable for reference data, dangerous for action-critical state
Content series built from this framework
| Post | Angle | Status |
|---|---|---|
| Post 1 | Memory management — context as a cache | Draft — not posted |
| Post 2 | Agentic systems — primitives vs. orchestration | Posted Jun 20 |
| Post 3 | Context across multiple agents — distributed systems lens | Not written |
| Substack | Full framework essay — model → primitives → harness → orchestration | Not written |
| Forbes Q2 | Multi-agent AI relearning distributed systems lessons | In progress |