Agents
An agent is simpler than you might think. At its core, it is just a loop — and understanding that loop is the key to designing great agents.
The agentic loop
Section titled “The agentic loop”Here is how every agent works:
- The agent receives a message — from you, from a schedule, or from another agent.
- The message is passed to a large language model (LLM) along with the agent’s instructions.
- The LLM responds. It either gives a final answer, or it decides to use a tool.
- If it used a tool, the result is fed back in and the LLM is called again.
- This repeats until the LLM decides it has a final response.
That is the entire concept. The agent loops — thinking, acting, observing — until the task is done. Through this loop, the agent can chain together multiple steps: looking up information, making changes, checking results, and finally responding to you.
What makes this powerful is not any single step. It is the fact that the agent can take as many steps as it needs, deciding at each turn what to do next.
Importantly, the value of an agent is not only in the final response it gives you. The tool calls themselves are where much of the real work happens — the agent can edit files, update data in other systems, send messages, and make changes on your behalf as part of the loop, long before it responds.
Designing an agent
Section titled “Designing an agent”From a design perspective, there are really only two things you need to think about:
- Instructions — what you tell the agent about who it is and how it should work.
- Tools — what the agent can actually do.
This page covers instructions. Tools are covered next.
The context
Section titled “The context”Every time the LLM is called within the loop, it receives a context — the full prompt that tells it everything it needs to know at that moment. The context is made up of two parts:
- The system prompt — persistent instructions that define the agent. This stays the same across every turn.
- The conversation — the accumulating messages from the user, the agent’s own responses, and the results of any tool calls the agent has made.
The system prompt is where you define your agent — and it is the part you can completely control. The conversation builds up naturally and unpredictably as the agent works. That is why crafting the system prompt well matters so much.
The system prompt
Section titled “The system prompt”You can put anything you want in a system prompt. It is just text — there are no rules about how to structure it. What matters is that the agent ends up with a clear sense of who it is, what it knows, and how it should work.
Here is an example of a simple but effective system prompt for an executive assistant agent:
You are a professional executive assistant focused on helping your user stay organized and on track with their goals.
Help the user manage their time, priorities, and commitments. Be proactive in suggesting next steps. Keep responses concise and actionable. When unsure about priorities, ask.
North Star: Maintain a clear understanding of the user’s current North Star goal.
Daily briefing: Provide a briefing each morning summarizing the key priorities for the day.
This prompt gives the agent an identity (executive assistant), behavioral guidance (proactive, concise, asks when unsure), and specific duties to maintain (north star tracking, daily briefing). That is enough for the agent to be genuinely useful.
Now imagine the user sends this agent a message:
“I’ve been offered a speaking slot at a conference next month, but I’m behind on the product launch. What would you advise?”
Even without any tools, the agent can already give a thoughtful answer — because the system prompt tells it who it is, how it should think, and what matters. It knows to weigh this against the user’s North Star goal, to be concise and actionable, and to ask clarifying questions when needed. The system prompt shapes everything about how the agent responds.
This is the foundation. A simple loop, a well-crafted system prompt, and the agent already has a clear sense of purpose. In the next section, we give it the ability to act.