Skip to content

Commit a9d190a

Browse files
Hovborgclaude
andcommitted
Add multilingual README (6 languages) and cookbook (6 tutorials)
Translations (docs/i18n/): - 简体中文 (Chinese Simplified) - 日本語 (Japanese) - 한국어 (Korean) - Español (Spanish) - Deutsch (German) - Dansk (Danish) Each ~200 lines covering: comparison table, quick start, catalog, smart enhancements, export, and playground. Language selector added to main README. Cookbook (6 step-by-step tutorials): 1. Getting Started — first agent in 5 minutes 2. Build Code Review Team — supervisor/worker pattern 3. Research Pipeline — parallel + fact-checking 4. Smart Enhancements — make any agent 40% smarter 5. Export Everywhere — use on any AI platform 6. Cost Optimization — cut costs by 80% Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 88d8d43 commit a9d190a

14 files changed

Lines changed: 2135 additions & 0 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ venv/
1717
.DS_Store
1818
Thumbs.db
1919
.ai-sessions/
20+
.playwright-cli/

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<p align="center">
2+
<a href="docs/i18n/README.zh-CN.md">简体中文</a> •
3+
<a href="docs/i18n/README.ja.md">日本語</a> •
4+
<a href="docs/i18n/README.ko.md">한국어</a> •
5+
<a href="docs/i18n/README.es.md">Español</a> •
6+
<a href="docs/i18n/README.de.md">Deutsch</a> •
7+
<a href="docs/i18n/README.da.md">Dansk</a>
8+
</p>
9+
110
<p align="center">
211
<img src="docs/assets/banner.svg" alt="multi-agent banner" width="700">
312
</p>

cookbook/01-getting-started.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Your First Agent in 5 Minutes
2+
3+
**Difficulty:** Easy
4+
5+
## What you'll build
6+
7+
A complete script that browses the agent catalog, loads an agent, gets a
8+
recommendation for your task, and estimates the cost -- all in under 20 lines of
9+
Python.
10+
11+
## Prerequisites
12+
13+
- Python 3.10+
14+
- `pip install multi-agent`
15+
16+
## Step 1 -- Install multi-agent
17+
18+
```bash
19+
pip install multi-agent
20+
```
21+
22+
Verify the install:
23+
24+
```bash
25+
multiagent --help
26+
```
27+
28+
You should see the CLI with commands like `search`, `info`, `list`, and
29+
`recommend`.
30+
31+
## Step 2 -- Browse the catalog from the CLI
32+
33+
```bash
34+
multiagent search "code review"
35+
```
36+
37+
Output:
38+
39+
```
40+
Found 3 agents matching "code review":
41+
42+
code/code-reviewer Review PRs for bugs, style, and security
43+
code/test-writer Generate tests for changed code
44+
code/refactorer Suggest and apply refactoring improvements
45+
```
46+
47+
You can also list everything:
48+
49+
```bash
50+
multiagent list # all agents
51+
multiagent list -c code # just the code category
52+
```
53+
54+
## Step 3 -- Load and inspect an agent in Python
55+
56+
```python
57+
from multiagent import Catalog
58+
59+
catalog = Catalog()
60+
print(f"Catalog has {len(catalog)} agents in {len(catalog.list_categories())} categories")
61+
62+
# Load a specific agent
63+
reviewer = catalog.load("code/code-reviewer")
64+
print(f"Name: {reviewer.full_name}")
65+
print(f"Description: {reviewer.description}")
66+
print(f"Tags: {reviewer.tags}")
67+
print(f"Prompt size: {len(reviewer.system_prompt)} chars")
68+
```
69+
70+
## Step 4 -- Get a recommendation
71+
72+
Describe your task in plain English and let the router pick the right agents and
73+
orchestration pattern:
74+
75+
```python
76+
from multiagent import Catalog, AgentRouter
77+
78+
catalog = Catalog()
79+
router = AgentRouter(catalog)
80+
81+
rec = router.recommend("I need to review a PR and write missing tests")
82+
print(rec.describe())
83+
```
84+
85+
Output:
86+
87+
```
88+
Recommended pattern: supervisor-worker
89+
Reason: Central reviewer coordinates specialists
90+
Confidence: 70%
91+
Agents:
92+
- code/code-reviewer: Reviews code changes for bugs, security, and style
93+
- code/test-writer: Generate tests for changed code
94+
```
95+
96+
## Step 5 -- Estimate costs
97+
98+
```python
99+
from multiagent import CostEstimator
100+
101+
estimate = CostEstimator.estimate_team(rec.agents, extra_input_tokens=5000)
102+
print(estimate)
103+
```
104+
105+
Output:
106+
107+
```
108+
Cost estimate for: code/code-reviewer, code/test-writer
109+
Model Tokens Cost
110+
---------------------------------------------
111+
gemma4-27b 9000 free (local)
112+
claude-haiku-4-5 9000 $0.0232
113+
gpt-4o-mini 9000 $0.0041
114+
claude-sonnet-4-6 9000 $0.0870
115+
```
116+
117+
## Complete runnable script
118+
119+
Save this as `my_first_agent.py` and run it with `python my_first_agent.py`:
120+
121+
```python
122+
"""My first multi-agent experience."""
123+
124+
from multiagent import Catalog, AgentRouter, CostEstimator
125+
126+
# 1. Browse the catalog
127+
catalog = Catalog()
128+
print(f"Loaded {len(catalog)} agents across {len(catalog.list_categories())} categories\n")
129+
130+
# 2. Search for agents
131+
results = catalog.search("code review")
132+
for agent in results:
133+
print(f" {agent.full_name}: {agent.description}")
134+
135+
# 3. Get a recommendation
136+
router = AgentRouter(catalog)
137+
rec = router.recommend("I need to review a PR and write missing tests")
138+
print(f"\n{rec.describe()}")
139+
140+
# 4. Estimate costs
141+
if rec.agents:
142+
estimate = CostEstimator.estimate_team(rec.agents, extra_input_tokens=5000)
143+
print(f"\n{estimate}")
144+
```
145+
146+
## Next steps
147+
148+
Ready to compose agents into a working team? Continue with
149+
[02 -- Build a Code Review Team](02-build-code-review-team.md).
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Build an Automated Code Review Team
2+
3+
**Difficulty:** Medium
4+
5+
## What you'll build
6+
7+
A three-agent code review team using the supervisor-worker pattern. The code
8+
reviewer supervises a test writer and a security auditor, all enhanced with smart
9+
prompts and exported to Claude Code.
10+
11+
## Prerequisites
12+
13+
- Python 3.10+
14+
- `pip install multi-agent`
15+
- Completed [01 -- Getting Started](01-getting-started.md)
16+
17+
## Step 1 -- Load the agents
18+
19+
```python
20+
from multiagent import Catalog
21+
22+
catalog = Catalog()
23+
reviewer = catalog.load("code/code-reviewer")
24+
test_writer = catalog.load("code/test-writer")
25+
security_auditor = catalog.load("code/security-auditor")
26+
27+
print(f"Supervisor: {reviewer.full_name}")
28+
print(f"Workers: {test_writer.full_name}, {security_auditor.full_name}")
29+
```
30+
31+
## Step 2 -- Compose with supervisor-worker pattern
32+
33+
The supervisor decomposes the task and delegates subtasks to workers:
34+
35+
```python
36+
from multiagent import patterns
37+
38+
team = patterns.supervisor_worker(
39+
supervisor=reviewer,
40+
workers=[test_writer, security_auditor],
41+
model="claude-haiku-4-5",
42+
)
43+
44+
print(team.describe())
45+
```
46+
47+
## Step 3 -- Enhance with smart prompts
48+
49+
Make each agent smarter with research-backed prompt engineering:
50+
51+
```python
52+
from multiagent import enhance_agent
53+
54+
smart_reviewer = enhance_agent(reviewer, profile="all")
55+
smart_test_writer = enhance_agent(test_writer, profile="category")
56+
smart_auditor = enhance_agent(security_auditor, profile="category")
57+
58+
print(f"Original prompt: {len(reviewer.system_prompt)} chars")
59+
print(f"Enhanced prompt: {len(smart_reviewer.system_prompt)} chars")
60+
```
61+
62+
## Step 4 -- Export to Claude Code
63+
64+
Generate skill files that Claude Code auto-discovers:
65+
66+
```python
67+
from multiagent import export_agent
68+
69+
for agent in [smart_reviewer, smart_test_writer, smart_auditor]:
70+
output = export_agent(agent, target="claude-code", output_dir=".agents/skills")
71+
print(f"Exported: {agent.name}.md")
72+
```
73+
74+
This creates files in `.agents/skills/` that Claude Code picks up automatically.
75+
76+
## Step 5 -- Visualize the team
77+
78+
Auto-generate a Mermaid diagram for documentation or README files:
79+
80+
```python
81+
from multiagent.visualize import visualize_team
82+
83+
diagram = visualize_team(
84+
[reviewer, test_writer, security_auditor],
85+
pattern="supervisor-worker",
86+
)
87+
print(diagram)
88+
```
89+
90+
## Step 6 -- Cost comparison across models
91+
92+
```python
93+
from multiagent import CostEstimator
94+
95+
agents = [reviewer, test_writer, security_auditor]
96+
97+
print(f"{'Model':<25} {'Cost':>10} {'Tokens':>8}")
98+
print("-" * 47)
99+
100+
for model in ["claude-haiku-4-5", "claude-sonnet-4-6", "gpt-4o", "gpt-4o-mini",
101+
"gemini-2.5-flash", "gemma4-27b"]:
102+
est = CostEstimator.estimate_team(agents, model=model, extra_input_tokens=5000)
103+
e = est.estimates[0]
104+
cost = f"${e.cost_usd:.4f}" if e.cost_usd > 0 else "free"
105+
print(f"{model:<25} {cost:>10} {e.total_tokens:>8}")
106+
```
107+
108+
## Complete runnable script
109+
110+
```python
111+
"""Build a code review team with smart enhancements."""
112+
113+
from multiagent import Catalog, CostEstimator, enhance_agent, export_agent, patterns
114+
from multiagent.visualize import visualize_team
115+
116+
catalog = Catalog()
117+
reviewer = catalog.load("code/code-reviewer")
118+
test_writer = catalog.load("code/test-writer")
119+
security_auditor = catalog.load("code/security-auditor")
120+
121+
# Enhance, compose, export, visualize, estimate -- all in one script
122+
smart_reviewer = enhance_agent(reviewer, profile="all")
123+
smart_test_writer = enhance_agent(test_writer, profile="category")
124+
smart_auditor = enhance_agent(security_auditor, profile="category")
125+
126+
team = patterns.supervisor_worker(
127+
supervisor=smart_reviewer, workers=[smart_test_writer, smart_auditor],
128+
model="claude-haiku-4-5",
129+
)
130+
print(team.describe())
131+
132+
for agent in [smart_reviewer, smart_test_writer, smart_auditor]:
133+
export_agent(agent, target="claude-code", output_dir=".agents/skills")
134+
135+
print("\n" + visualize_team([reviewer, test_writer, security_auditor], pattern="supervisor-worker"))
136+
print("\n" + str(CostEstimator.estimate_team([reviewer, test_writer, security_auditor], extra_input_tokens=5000)))
137+
```
138+
139+
## Next steps
140+
141+
Want to build a research pipeline with parallel agents? Continue with
142+
[03 -- Research Pipeline](03-research-pipeline.md).

0 commit comments

Comments
 (0)