Context engineering for agent optimization
Key Takeaway
Context engineering means tuning everything available to an agent's model, not just the prompt. Keep the context lean, accurate, and free of contradictions, and use logic for critical business workflows so behavior is predictable.
Context engineering is the practice of giving an AI agent the right information, tools, and instructions to reach its goals. Prompt engineering focuses on direct instructions, and RAG (Retrieval Augmented Generation) focuses on retrieving the right content. Context engineering is broader: it covers everything available to the model. You tune all of it so the agent has the best chance of solving the problem.
The parts of an agent's context
An agent's context has several parts:
| Part | What it includes |
|---|---|
| Prompts and instructions | Each subagent's instructions and the user's prompts |
| Actions and tools | Flows, Apex actions, and prompt templates |
| Data inputs | Structured and unstructured sources, such as CRM data, Data 360, knowledge articles, uploaded documents, and Slack |
| Memory | Short-term (the current conversation) or long-term (past interactions) |