Memory-aware agent harness
A reference agent harness merged with a memory-aware agent design: memory is read before the agent loop, managed and offloaded inside it, and written after it, through a memory manager over typed memory stores.
Agent harness
The memory-aware agent, end to end
control flow
memory read / write
harness-run (deterministic)
agent-triggered
memory store (database table)
Entry points
start condition
User query
+ thread id
API and SDK calls
Channels
Slack, email, web
Schedules, triggers
Other agents
Events, webhooks
auth, identity
user and thread ids
rate limits
Context assembly
before the loop · a memory-aware context window
System prompt
## Conversation
## Knowledge base
## Workflow
## Entity
## Summary
Tool retrieval
80% check
Agent loop · assemble → invoke → act, until a stop condition
Model
reason · choose
Loop controller
max iterations · stop
Guardrails
input · action · output
Action layer
Tools, MCP
functions
Code exec
sandbox
Filesystem
workspace
Sub-agents
delegate
Memory tools
agent calls
Context management
offload tool logs · summarize at 80% · trim
Post-loop memory writes
workflow: steps and outcome · entities · final answer to conversation
Outputs
answer · data · artifacts · actions
Observe, evaluate
traces · cost · evals · feedback
Memory manager
read / write ops over stores
database tables · embeddings
semantic search · thread ids
extract · consolidate · update
Conversational
messages per thread
Knowledge base
semantic · documents
Workflow
procedural · steps, outcomes
Entity
people, places, orgs
Summary
compressed history, by id
Toolbox
semantic tool memory
Tool logs
offloaded tool outputs
Checkpoints
thread state, resume
Runtime
durable execution · pause and resume · queues and concurrency · deployment and scaling · identity and secrets
Overview
Previous
Next
Play tour
How it works
Design choices
Risks → defenses