Context Engineering
Context engineering is the discipline of designing what goes into your agent's wisdom graph — and what comes back out.
Why It Matters
The difference between an agent that flounders and one that grows wiser is not the model. It is the context. A well-engineered context strategy means your agent retrieves the right knowledge at the right time, avoids repeating mistakes, and builds on past successes.
Context engineering answers three questions:
- What do you store? Not everything deserves a place in the graph. Store decisions, learned skills, error patterns, and key facts. Skip transient data.
- How do you structure it? Context IDs, payload schemas, and linking strategies determine how knowledge connects and compounds.
- When do you retrieve it? Query design, scoping filters, and limit tuning control what the agent sees in its context window.
Three Pillars
Schema Design
Define consistent context ID conventions and payload structures. A coding agent might use skill:react_hooks, error:null_pointer, and session:2025_03_19. Consistency makes retrieval predictable.
Scoping Strategy
Use graph-level, type-level, and name-level filters to control the search space. Scoping prevents irrelevant knowledge from polluting the agent's context window.
Retrieval Tuning
Adjust query specificity, result limits, and context filters to balance precision and recall. Start narrow, widen only when needed.
Context engineering is iterative. Start with simple schemas, observe what your agent retrieves, and refine. The wisdom graph's confidence scoring helps surface what works and suppress what does not.