---
title: "🌟 What is OpenAI Agents SDK?"
source: Panaversity Learn Agentic AI
source_url: https://github.com/panaversity/learn-agentic-ai
licence: Apache-2.0
domain: agentic-ai
subdomain: panaversity-agentic
date_added: 2026-04-25
---

### 🌟 [What is OpenAI Agents SDK?](https://openai.github.io/openai-agents-python/)

Imagine you want to build a **smart assistant**—like a chatbot or an AI agent—that can:

* Answer questions intelligently,
* Use tools like calculators or web searches,
* And know when to ask another agent for help.

💡 The **OpenAI Agents SDK** helps you create such smart AI agents **easily using Python**.

---

### 🤖 In Simple Words

Think of it like this:

* **Agent** = A smart AI person (powered by GPT) with a job (instructions).
* **Tool** = A calculator, file reader, or anything the agent can “use”.
* **Handoff** = When one agent passes the task to another expert agent.
* **Guardrail** = A filter or checkpoint to make sure the input is okay.
* **Runner** = The engine that runs the agent’s brain.

---

### 🧒 Analogy for a 5-year-old:

Imagine you're in a big school with many teachers.

* 🧑‍🏫 The **Math Teacher** helps with math problems.
* 🧑‍🏫 The **History Teacher** helps with history questions.
* 🧑‍🏫 The **Receptionist** decides who the student should talk to.

This is how Agents SDK works:

1. The **student** (user) asks a question.
2. The **receptionist agent** reads the question and **hands it off** to the right teacher (agent).
3. The teacher may use a **tool** like a calculator.
4. If the question is naughty, a **guardrail** might block it before it even reaches the teacher.
5. Everything is recorded nicely so you can **see what happened** and **debug it** (called tracing).

---

### 🧪 Hello World Example (Python):

```python
from agents import Agent, Runner

agent = Agent(name="Assistant", instructions="You are a helpful assistant")

result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")
print(result.final_output)
```

📝 Output:

```
Code within the code,
Functions calling themselves now,
Infinite loop’s dance.
```

---

### 💡 Why Use It?

* Easy to learn and write.
* Lets you build **real-world AI workflows**.
* Built-in support for **tools, agents, handoffs, and guardrails**.
* Helps you **visualize and trace** what happened during the AI's thinking process.
