Agent Engineering

5 Messages Behind One Conversation

Left: what the user sees | Right: what actually happens in the API. Scroll down to auto-play what happens behind a single weather query.

Actual Execution Flow
Messages 0
Tokens 0
API Calls 0
7 steps · Watch what happens behind a single weather query
JSON Format Reference
Complete format of the messages array
{ "messages": [ { "role": "system", "content": "instruction" }, { "role": "user", "content": "user message" }, { "role": "assistant", "content": null, "tool_calls": [{ "name": "…", "arguments": {…} }] }, { "role": "tool", "tool_call_id": "…", "content": "result" }, { "role": "assistant", "content": "final response" } ] } // 5 messages total // 2 model API calls // 1 tool call
Takeaway
Takeaway  The user sees one response. Behind it: 5 messages, 2 model API calls, 1 external API call. The essence of product design is deciding which of these steps the user perceives — and which are handled silently.