Skip to slide
035 / 170

CH 03 · Building the Prompt · 12/12

Read as one page

Key takeaways

  • A model request has three parts worth knowing: layered instructions, a list of tools (JSON schemas), and an input list of structured conversation items.
  • Roles carry authority, in order: system, developer, user, assistant.
  • Store history as typed items, and link each tool call to its result with a shared call_id so the model understands cause and effect.
  • Put stable content (instructions, tools) first and variable content (the latest message) last. This is what makes caching possible.
  • The model only knows what is in the prompt. Brief it like a sharp colleague who just walked into the room.

Original sources: OpenAI's Unrolling the Codex agent loop and Jonathan Fulton's "Inside the Agent Harness" analysis of the Codex codebase.


Finished this idea?

Your learning progress stays in this browser.