Build your autonomous agent company
The capstone: a group of collaborating agents that runs a business itself.
Goal: after this module you have a running system of collaborating agents that independently
processes jobs, checks them, delivers, and tracks revenue โ with you as the owner at the right
checkpoints. This is the destination the whole course works toward.
Companion code: code/agent_company.py.
Honest first: what "autonomous" means here
You're building a largely autonomous business: the agents do the work, you approve the risky moments (money, delivery to customers). That isn't a limitation but a strength โ it keeps your quality high and you legally safe (modules 10 & 11). "100% human-free, guaranteed income" does not exist; a running system with human checkpoints does. This is what you have after this module.
The architecture: a small company of agents
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Jobs โโโโโโโโโโโโโโโโถ โ COORDINATOR โ pulls work, drives the
(inbox / form / โ (the orchestration, โ pipeline, watches the budget
jobs.json) โ in code) โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ per job
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ WRITER โ โโโถ โ REVIEWER โ โโโถ โ CLIENT COMMS โ
โ (agent) โ โโโ โ (agent, QA) โ โ (delivery mail)โ
โโโโโโโโโโโโโโโโ revise โโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ
makes deliverable approves/rejects โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ HUMAN (approval) โ โ guardrail
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Delivery + LEDGER โ
โ (revenue, cost, margin) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Four agent roles, one human checkpoint, and a ledger that tracks your revenue. Together they form a company that does a day's work with a single command.
How this ties all the modules together
| Part of the company | Comes from module |
|---|---|
| The agents and their prompts | 04 (first agent), 01 (what is an agent) |
| Tools & actions | 05 |
| The autonomous loop + revision | 06 |
| Budget, human-in-the-loop, logging | 10 |
| Multiple collaborating agents | 07 (Managed Agents / multi-agent) |
| Price, revenue, ledger | 08 |
| Delivery, email, payment | 09 |
| The 7-day path to your first customer | Worked example |
The code: agent_company.py
The script implements exactly the architecture above:
- Coordinator โ reads jobs from
jobs.json(in reality: your inbox/CRM/form), watches the
daily budget, and sends each job through the pipeline.
- Writer (agent) โ produces the deliverable with structured output.
- Reviewer (agent) โ checks for facts, style and completeness; gives a score and requests a
revision if needed (up to MAX_REVISIES).
- Client comms โ drafts a short delivery email (cheap model, since it's a simple task).
- Human โ approves before delivery (skip with
--autofor unattended runs). - Ledger โ books revenue per customer in
grootboek.json, totals cost and margin.
Run it:
python code/agent_company.py # with human approval per delivery
python code/agent_company.py --auto # unattended (for scheduled runs)
You'll watch the agents collaborate: write โ review โ revise if needed โ deliver โ book. The deliverables land in code/outputs/, the log in code/company.log, the revenue in code/grootboek.json.
Running it 24/7
A business that only runs when you start the script by hand isn't autonomous yet. Schedule it:
Linux / Mac (cron) โ every morning at 8:00:
crontab -e
# add (adjust the paths):
0 8 * * * cd /path/to/project && /path/to/.venv/bin/python code/agent_company.py --auto >> code/cron.log 2>&1
Windows: use Task Scheduler โ daily task โ start python code/agent_company.py --auto.
In the cloud / 24/7 without your own PC: run it on a small server, or move to Managed Agents (module 07), which run entirely on Anthropic's infrastructure.
๐ก Only switch to
--autoonce you've checked the output for a while. Run supervised first, then
let go gradually โ autonomy is earned step by step (module 10).
Scaling into a bigger company
- More roles โ add agents: a research agent, an SEO agent, a customer-service agent.
- Real integrations โ replace
jobs.jsonwith your real inbox/form, and the "delivery" with a
real email tool (module 09) and payment (Stripe/Gumroad).
- Multiple niches โ run the same system with different prompts for different markets.
- Coordinator as an agent โ let a Managed-Agent coordinator decide itself which specialist is
needed when (module 07).
Definition of done โ
After this module you have:
- A group of collaborating agents that processes jobs on its own (writer + reviewer + client comms, driven by a coordinator).
- Quality control built in (the reviewer approves/rejects and asks for revisions).
- Guardrails: daily budget, logging and human approval before delivery.
- A ledger that tracks your revenue, costs and margin.
- A way to schedule it 24/7 (cron / Task Scheduler / cloud / Managed Agents).
That's a real, running AI-agent business. What it earns is up to your niche, your price and your distribution (module 08 & the worked example) โ but the machine is in place.
Your assignment
- Run
agent_company.pyand follow the collaboration between the agents. - Replace the prompts and
PRIJS_PER_OPDRACHT(price per job) with your own business's. - Connect
jobs.jsonto a real source of jobs, and delivery to email/payment. - Schedule it with cron or Task Scheduler and let it run supervised for a week first.
Congratulations โ you haven't just learned how agents run a business, you have one running. Head
to the worked example for the path to your first paying customer.