1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
25 small wins to finish your pathNext lesson →
Your first agent
An agent is an object with a name and a set of instructions. That is all it takes to make one, and nothing runs when you do.
from agents import Agent
support = Agent(
name="Support",
instructions="You answer questions about orders. Be brief.",
)The name is for you and for the traces you will read later. The instructions are what the model is told about how to behave, every single turn.
print("name: ", support.name)
print("instructions:", support.instructions)
print("tools: ", support.tools)No tools yet, and no model named either. Creating an agent does not call anything, which is why this runs with no key and no network.
What an agent is not
It is not a running process, and it is not a conversation. It is a description: who this is, what it is told, what it can use. Something else has to take that description and run it, and that arrives in lesson 4.
The panel
Try changing the instructions in the panel and running it again. Nothing about the output changes except the line you edited, which is worth seeing once so the next lessons are not surprising.
Try it yourself
- Change the name and run it again.
- Add a second agent with different instructions and print both.
- Print
supporton its own and look at everything an agent carries.
Little by little, you're building something great.