Skip to content

Commit 15b1276

Browse files
author
AgentPatterns
committed
README
1 parent 762d9bf commit 15b1276

1 file changed

Lines changed: 66 additions & 14 deletions

File tree

README.md

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,88 @@
1-
# AgentPatterns Examples
1+
# AgentPatterns Examples: Runnable AI Agent Patterns in Python
22

3-
Runnable code examples that accompany articles on [agentpatterns.tech](https://www.agentpatterns.tech).
3+
Production-style and beginner-friendly **AI agent examples** that map directly to the guides on [agentpatterns.tech](https://agentpatterns.tech).
44

5-
This repository is a practical companion to the main project: each article can include a small, focused example you can run locally and adapt for your own use cases.
5+
If you want to learn how to build agents with real execution loops, tool boundaries, routing, and safety checks, this repo is the fastest way to run and inspect working code.
66

7-
## What lives here
7+
## Why this repository
88

9-
- `examples/` contains article-aligned examples.
10-
- Each example is grouped by topic, then by language/runtime.
11-
- Examples are intentionally minimal: clear logic, fast setup, easy to remix.
9+
- Learn by running real code, not pseudo-code.
10+
- Move from simple loops to advanced multi-step agent patterns.
11+
- Reuse minimal, clean implementations in your own projects.
12+
- Follow examples that are aligned with concrete docs and architecture explanations.
1213

13-
## Current structure
14+
## Available examples
15+
16+
### Agent Patterns (Core Block)
17+
18+
The most important block of the site and the main architecture layer for production agents.
19+
20+
| Example | Focus | Local path | Article |
21+
| --- | --- | --- | --- |
22+
| ReAct Agent | `Think -> Act -> Observe` with budgets | `examples/react-agent/python` | https://agentpatterns.tech/en/agent-patterns/react-agent |
23+
| Routing Agent | Delegate to best specialist route | `examples/routing-agent/python` | https://agentpatterns.tech/en/agent-patterns/routing-agent |
24+
| Task Decomposition Agent | `Plan -> Execute -> Combine` workflow | `examples/task-decomposition-agent/python` | https://agentpatterns.tech/en/agent-patterns/task-decomposition-agent |
25+
26+
### Foundations
27+
28+
| Example | Focus | Local path | Article |
29+
| --- | --- | --- | --- |
30+
| Write Your First Agent | First loop (`Act -> Check -> Retry`) | `examples/write-your-first-agent/python` | https://agentpatterns.tech/en/start-here/write-your-first-agent |
31+
| Tool Calling Basics | Basic tool execution loop | `examples/tool-calling-basics/python` | https://agentpatterns.tech/en/foundations/tool-calling-basics |
32+
| Tool Calling | Tool + action restrictions (policy boundary) | `examples/tool-calling/python` | https://agentpatterns.tech/en/foundations/tool-calling |
33+
| LLM Limits in Agents | Validation, citations, confidence, handoff | `examples/llm-limits-agents/python` | https://agentpatterns.tech/en/foundations/llm-limits-agents |
34+
35+
## Project structure
1436

1537
```text
1638
examples/
1739
write-your-first-agent/
1840
python/
41+
tool-calling-basics/
42+
python/
43+
tool-calling/
44+
python/
45+
llm-limits-agents/
46+
python/
47+
react-agent/
48+
python/
49+
routing-agent/
50+
python/
51+
task-decomposition-agent/
52+
python/
53+
```
54+
55+
## Quick start
56+
57+
### 1) Choose an example
58+
59+
```bash
60+
EXAMPLE=react-agent
61+
cd examples/$EXAMPLE/python
1962
```
2063

21-
## Quick start (Python example)
64+
### 2) Install and run
2265

2366
```bash
24-
cd examples/write-your-first-agent/python
2567
python3 -m venv .venv
2668
source .venv/bin/activate
2769
pip install -r requirements.txt
2870
export OPENAI_API_KEY="sk-..."
2971
python main.py
3072
```
3173

32-
## Relation to agentpatterns.tech
74+
## Prerequisites
75+
76+
- Python 3.10+ (3.11+ recommended)
77+
- `OPENAI_API_KEY` environment variable
78+
- macOS/Linux shell commands above (adapt activation/export commands on Windows)
79+
80+
## How this maps to agentpatterns.tech
81+
82+
- **Docs** explain when and why to use each agent pattern.
83+
- **This repo** shows runnable implementations of those exact patterns.
84+
- Each example folder includes its own README with direct links to related concepts.
85+
86+
## License
3387

34-
- Articles explain concepts and patterns.
35-
- This repo provides runnable implementations for those materials.
36-
- As new articles are published, matching examples are added here.
88+
MIT

0 commit comments

Comments
 (0)