Full lab · 20 missions · about 4 hours
Backend architecture: the full lab¶
In the video, a company that sells tickets grows from one server to twenty-two parts, and each part comes in because something broke. Here, you run the same backend on your own computer, break it the way I did, and add the part that fixes it.
Short on time? Start with the 10-minute exercise: take the email company down in the middle of a purchase, and fix it with a queue.
The architecture from the video: where each mission runs
missions 1 to 7 and 12: the app, its copies and the parts around them
missions 8 to 11 and 20: the copies move into a cluster
missions 13 to 18: MongoDB, ClickHouse, Airflow, Spark, Flink, Neo4j
missions 19 and 20: LangChain, Deep Agents, Qdrant and A2A
Before you start¶
You need Git and Docker, and on your computer bash, curl and python3, which the lab's helper scripts use. A Mac has all three. On Ubuntu: sudo apt install curl python3 git. On Windows, use a WSL terminal, such as Ubuntu, with Docker Desktop's WSL integration turned on.
Give Docker at least 8 GB of memory and 40 GB of disk. Most missions need much less: missions 1 to 7 run in about 2 GB. Every part of the backend is a container with one CPU, so the numbers you get are the app's own, before and after a part, and your computer's. They will differ from mine. Look at how a number changes, not at how big it is.
Pinned: what the bigger missions need
- Kubernetes (missions 8 to 11 and 20): nothing more to install. kind 0.33.0 and kubectl 1.37.0 run in an image the lab builds, and the cluster, Kubernetes 1.37.0, runs in four containers.
- The data tools (missions 14 to 17): about 15 GB of disk for four years of made-up orders, and about 700 MB of jars for Spark and Flink, which
tools/s5-jars.shdownloads from Maven Central. - The agents (missions 19 and 20): no model to download and no key: the long runs use a scripted stand-in model, a few rules in a container. One short run uses a free local model,
qwen3:1.7bin Ollama 0.40.18, about 1.4 GB. - Not in this lab: the chapters on the one physical server and on virtual machines (2, 3 and 5 in the video) ran on Multipass virtual machines that I set up by hand.
Get the lab from my tutorials repository on GitHub:
git clone --depth 1 --branch main https://github.com/antonputra/tutorials.git
cd tutorials/lessons/286/lab
mkdir -p .run
Every command on this page runs from this lab folder. The app is one image, and a few switches set what it does. Each step of a mission is a file in steps/ with its switches: you copy it to .env, and docker compose up -d --wait starts or changes what the step needs. The site answers on http://127.0.0.1:8080, only on your computer.
The shows, in the database from the first start: 1 the club night (200 seats, $25.00), 2 the theater (2,000 seats), 3 the arena (18,000 seats), 4 to 8 the stadium tour's five nights (60,000 seats each), and 9 a test show for the pipeline. The card company and the email company are stand-ins, small programs of mine: every card gets approved, and emails are only counted. No real money moves, and no real email goes out. Every name, email and card in the lab is made up.
The crowd is k6: buyers who each want one seat and try until the show sells out, and people who only look at the seat map. tools/reset.sh puts every seat back on sale between two sales, and tools/checks.sh <show> says what a sale left behind.
Mission 1. One server, as one app¶
The video starts with one server: the app and its database. Start the app, two copies of it behind a load balancer, the database and the two stand-ins:
The first start builds the app's image and downloads PostgreSQL 19.0 and HAProxy 3.4.8, so give it a few minutes. Then buy one ticket, Row F, Seat 14 of the club night, and look at what the purchase left behind:
POST /events/1/hold {"seat": 114}
{"held":114,"seat":"Row F, Seat 14","seconds":120} (HTTP 200)
POST /checkout {"email": "maya@example.com"}
{"order":1,"seat":"Row F, Seat 14","price":"$25.00","ticket":"emailed"} (HTTP 200)
the order's row in the database:
id | event_id | seat_id | email | status | card | device | addr
----+----------+---------+------------------+--------+------+--------+------
1 | 1 | 114 | maya@example.com | paid | | |
the card company's last line: charged $25.00 order=1 card=tok_demo charge=ch_000001
The purchase has four steps, all in one request: hold the seat, charge the card, mark the order paid and sold, then make the PDF ticket and email it.
Then the theater sale: 3,000 buyers arrive within 30 seconds for 2,000 seats.
tools/reset.sh
docker compose run --rm -T -e EVENT=2 -e BUYERS=3000 -e ARRIVE=30 crowd run --quiet /load/sale.js
tools/checks.sh 2
All 2,000 seats sold, no seat sold twice. In the video, one server did the same.
Mission 2. Two copies, one name¶
Two copies of the app behind a load balancer, HAProxy. First with no health check: the load balancer does not ask whether a copy is alive. The site is asked five times a second, and 5 seconds in, the copy app2 dies:
the load balancer's settings (haproxy/no-check.cfg): 0 lines that turn on a health check
14:08:30 docker compose kill app2
the answers around the kill (time, status, copy, milliseconds):
14:08:30.183 200 app1 2 ms
14:08:30.461 000 - 1017 ms
14:08:31.479 200 app1 2 ms
14:08:31.694 000 - 1054 ms
14:08:32.749 200 app1 3 ms
14:08:32.961 000 - 1067 ms
...
all answers after the kill, by status:
200 15
no answer 15
000 is a request with no answer. The load balancer keeps sending every second request to the dead copy, and each one waits a second for nothing. Now with the check, every 2 seconds, three misses:
the load balancer's settings (haproxy/check.cfg): 3 lines that turn on a health check
14:08:55 docker compose kill app2
the answers around the kill (time, status, copy, milliseconds):
14:08:55.182 200 app1 12 ms
14:08:55.382 200 app2 2 ms
14:08:55.618 200 app1 2 ms
14:08:55.818 200 app2 3 ms
14:08:56.018 200 app1 2 ms
14:08:56.272 000 - 1061 ms
14:08:57.332 200 app1 2 ms
...
all answers after the kill, by status:
200 40
no answer 10
Every second request fails for about 10 seconds, then every request goes to the living copy. Your counts may differ by a few. A dead machine doesn't refuse a connection, so each check waits its full 2 seconds. In the video: 16 of 31 requests failed without the check, and 10 of 78 with it.
The second problem with two copies: each one keeps the carts in its own memory. Bring the dead copy back, and run the theater sale with the carts in memory, then in the database:
docker compose up -d --wait
tools/reset.sh
docker compose run --rm -T -e EVENT=2 -e BUYERS=3000 -e ARRIVE=30 crowd run --quiet /load/sale.js
tools/checks.sh 2
cp steps/03c-carts-in-database.env .env
docker compose up -d --wait
tools/reset.sh
docker compose run --rm -T -e EVENT=2 -e BUYERS=3000 -e ARRIVE=30 crowd run --quiet /load/sale.js
tools/checks.sh 2
With the carts in memory, a buyer who picked a seat on one copy finds an empty cart on the other: in the video, 1,409 "your cart is empty" answers, and 133 seats stayed free and could not be bought. With the carts in the database, all 2,000 seats sold.
Mission 3. A cache¶
The arena sale: 21,600 buyers at 120 a second for 18,000 seats, while people who only look ask for 1,000 seat maps a second. Every seat map is a query to the database. tools/arena.sh runs the sale and reads each machine's CPU while it runs:
The database's CPU sits at its one CPU, and buyers wait until they give up. Now Redis in front of the seat map: one picture of the seats serves every visitor for two seconds:
cp steps/04a-cache.env .env
docker compose up -d --wait
tools/reset.sh
tools/arena.sh .run/arena-cache.txt
tools/checks.sh 3
In the video: without the cache, 2,607 of 18,000 seats sold and 85% of the requests got no answer; with it, all 18,000 sold, and the database's CPU dropped from 100% to about 10%. How many seats sell without the cache depends on your computer's speed: in my test VM, 9,270 of 18,000, with the database at 100% the whole time. The trap: a picture two seconds old can show a sold seat as free.
Buyer B's map, from the cache, still shows Row F, Seat 14 free after buyer A bought it. B asks for it and gets 409 seat_taken. Two seconds later, B's map shows it sold.
Mission 4. A standby, and backups¶
A standby is a second database that copies every change of the first, a moment later. Start it, then kill the first database 40 seconds into the arena sale. 20 seconds later, a script plays the person who promotes the standby by hand and points the copies at it:
cp steps/04b-standby.env .env
docker compose up -d --wait
tools/reset.sh
tools/db-dies.sh .run/db-dies
tools/made-it-across.sh
In the video, the first good answer came 27 seconds after the kill, and every paid order of the dead database was on the standby. Now put the first database back in charge, with a new standby that makes a fresh copy of it:
A standby copies your mistakes too. A backup lets you go back to a moment:
tools/reset.sh
tools/backup.sh
docker compose run --rm -T -e EVENT=2 -e BUYERS=3000 -e ARRIVE=30 crowd run --quiet /load/sale.js
tools/wrong-delete.sh .run/before-delete.txt
wrong-delete.sh types DELETE FROM orders WHERE event_id = 2; on the first database, keeps the moment just before it in .run/before-delete.txt, and shows that the standby has 0 orders too. Rebuild the database as it was at that moment, from last night's backup and every change since:
tools/restore-to.sh "$(cat .run/before-delete.txt)"
docker compose exec -T db-restore psql -U tickets -d tickets -c "SELECT count(*) FROM orders WHERE event_id = 2"
All 2,000 orders are back, in a third database. Stop it when you're done: docker compose --profile restore stop db-restore.
Mission 5. A read replica¶
Two pages only read: a buyer's own tickets, and the promoter's sales report, which is heavy on purpose. First both ask the main database, the one that sells, while 60 promoters keep the report open during the arena sale:
cp steps/09a-reports-on-the-main-database.env .env
docker compose up -d --wait
tools/reset.sh
REPORTS=60 tools/arena-reports.sh .run/arena-reports-main.txt
tools/checks.sh 3
Then the two pages ask the replica, the standby from mission 4, and purchases still ask the main database:
cp steps/09b-read-replica.env .env
docker compose up -d --wait
tools/reset.sh
REPORTS=60 tools/arena-reports.sh .run/arena-reports-replica.txt
tools/checks.sh 3
Look at the main database's CPU in each run's summary, and at the tickets sold. The trap: a buyer who has just paid may not find her ticket on the replica yet. The summary counts how often that happened, in buyers_whose_ticket_was_not_there_at_first, and how long until the ticket showed, in seconds_until_a_missing_ticket_showed. In my test VM, the main database's CPU went from 100% to about 13%, and the replica's from about 4% to 100%: the replica fell seconds behind, so most buyers did not find their ticket at first.
Mission 6. A queue and workers¶
This is the 10-minute exercise, with the arena's crowd. One purchase while the email company is down:
cp steps/05a-all-in-one-request.env .env
docker compose up -d --wait
tools/reset.sh
tools/email-down-one-purchase.sh
500 Internal Server Error for the buyer, and still the card is charged, the order is paid and the seat is sold. Now the whole arena sale, with the email company down for a minute, 30 seconds in, first with everything in one request, then with a queue, RabbitMQ, and three workers:
tools/reset.sh
tools/arena-bad-minute.sh down .run/bad-minute-inline.txt
tools/checks.sh 3
cp steps/05c-queue-three-workers.env .env
docker compose up -d --wait
tools/reset.sh
tools/arena-bad-minute.sh down .run/bad-minute-queue.txt
tools/checks.sh 3
In the video: 16,674 paid orders got 8,135 tickets, and 3,501 buyers paid more than once; with the queue, 18,000 orders got 18,000 tickets. When the sale ends, the workers are still emptying the queue, so the email stand-in shows fewer emails than orders: run tools/checks.sh 3 again a minute later, and the two counts are equal. The queue's own page shows the jobs pile up and empty: http://127.0.0.1:15672, user tickets, password tickets, a made-up one for this lab.
The trap: the email company is slow, not down, and a worker gives up after 2 seconds. Then with a key on each email:
tools/reset.sh
tools/arena-bad-minute.sh slow .run/slow-no-key.txt
tools/checks.sh 3
cp steps/05d-safe-to-do-twice.env .env
docker compose up -d --wait
tools/reset.sh
tools/arena-bad-minute.sh slow .run/slow-key.txt
tools/checks.sh 3
Look at the email stand-in's last line: most_for_one_order. In the video, 18,060 emails for 18,000 orders without the key, and 18,000 with it.
Mission 7. An event log¶
Two more programs want to hear about every sale: the report and the fraud check. First they read one more queue, then an event log, Kafka:
cp steps/05e-two-readers-one-queue.env .env
docker compose up -d --wait
tools/reset.sh
docker compose run --rm -T -e EVENT=2 -e BUYERS=3000 -e ARRIVE=30 crowd run --quiet /load/sale.js
for reader in report fraud; do docker compose logs $reader | grep "sales," | tail -1; done
On one queue, each reader gets about half: in the video, 1,000 sales and $45,000.00 each, for 2,000 sales. Now the event log:
cp steps/05f-event-log.env .env
docker compose up -d --wait
tools/reset.sh
docker compose run --rm -T -e EVENT=2 -e BUYERS=3000 -e ARRIVE=30 crowd run --quiet /load/sale.js
for reader in report fraud; do docker compose logs $reader | grep "sales," | tail -1; done
docker compose run --rm -T report timeout -s INT 12 python -m tickets.reader taxes
Both readers count all 2,000 sales. The last line starts a third reader after the sale is over: it reads every sale too, because the log keeps them. When you're done with Compose, stop it before the cluster: docker compose stop.
Mission 8. Kubernetes¶
The app's copies move into a cluster: one machine that decides, the control plane, and three that run the copies. kind makes the cluster from containers. Everything else stays where it was:
docker network create kind
cp steps/06a-kubernetes.env .env
tools/kube kind create cluster --config k8s/kind.yaml
tools/kube sh -c 'kind get kubeconfig --name tickets --internal > /kube/config'
docker build --build-arg VERSION=2.0 -t tickets:2.0 app
tools/kube kind load docker-image tickets:2.0 --name tickets
docker compose up -d --wait
tools/k apply -f k8s/config.yaml -f k8s/app.yaml
tools/kube kubectl -n kube-system patch deployment coredns --patch-file k8s/names-on-the-working-machines.json
tools/k is kubectl. Now break it:
A crashed copy is running again a second later. 40 copies answer within seconds, and back to 4 takes a second. When a whole machine dies, its copies are replaced on the other machines only after about five minutes: Kubernetes' own default wait. Start the machine again afterwards: docker start tickets-worker2. A new version goes in copy by copy, with no failed request: tools/rolling-update.sh 2.1.
Mission 9. Many copies, and a pooler¶
The stadium tour's first night, with 285,000 orders already in the database. Each copy of the app keeps its own connections to the database, and the database takes at most 100:
cp steps/12a-many-copies.env .env
docker compose up -d --wait
tools/presale.sh
tools/cluster-use.sh k8s/config-12a-direct.yaml 12
MORE_COPIES=20 MORE_AT=15 tools/stadium-copies.sh .run/stadium-direct.txt
15 seconds into the sale, Kubernetes is asked for 20 copies. The new copies are refused: sorry, too many clients already. Now PgBouncer between the copies and the database:
cp steps/12b-pooler.env .env
docker compose up -d --wait
tools/presale.sh
tools/cluster-use.sh k8s/config-12b-pooler.yaml 12
MORE_COPIES=20 MORE_AT=15 tools/stadium-copies.sh .run/stadium-pooler.txt
docker compose exec -T pooler bash -s 127.0.0.1 6432 tickets-two < pooler/two-sessions.sh
The pooler keeps a few connections and shares them. The last line shows what stops working through it: a setting, a temporary table and a saved query are gone, because the next statement runs in another database process.
Mission 10. A delivery pipeline¶
A change typed by hand on the cluster: one letter is lost from the card company's address. Nothing happens, until new copies start:
cp steps/06a-kubernetes.env .env
docker compose up -d --wait
tools/cluster-use.sh k8s/config.yaml 4
tools/hand-typed-change.sh
Now the same change through a pipeline: a Git repository with a hook that builds, tests, starts one trial copy with one real purchase, then ships copy by copy:
pipeline-init.sh prints how to change, commit and push. Make the same one-letter mistake in k8s/config.yaml of .pipeline/team, commit and push it: the trial purchase answers 402, and the pipeline stops with "Nothing was shipped". git revert takes a change back the same way.
Mission 11. Monitoring¶
The app counts its requests and sends traces. Prometheus, a dashboard in Grafana and Jaeger run beside the cluster:
cp steps/07a-seeing-inside.env .env
docker compose up -d --wait
tools/k apply -f k8s/monitoring.yaml
tools/cluster-use.sh k8s/config.yaml 4
tools/presale.sh
RATE=300 tools/stadium.sh .run/stadium-slow.txt
tools/dashboard-numbers.sh
python3 tools/trace.py --slowest --minutes 3
tools/db-time.sh db 5
"Checkout is slow." The dashboard says which part: the database reads millions of rows a second. The trace says which step: the purchase waits for the database. The database's own count says which statement: the check that a buyer has no more than four tickets. The fix is one index:
docker compose exec -T db psql -U tickets -d tickets -c "CREATE INDEX orders_by_buyer ON orders (email, event_id)"
tools/presale.sh
RATE=300 tools/stadium.sh .run/stadium-index.txt
tools/dashboard-numbers.sh
The dashboard itself is on http://127.0.0.1:3300, and the traces on http://127.0.0.1:16686. In the video, the slowest 5% of checkouts went from 2.3 s to 0.3 s.
Mission 12. Shards¶
Back on Compose, with four copies. Four nights of the stadium tour go on sale at once, and one database has every seat and every order. Each database's machine is a quarter of a CPU here, because one computer can't bring a crowd that fills a whole one:
tools/kube kind delete cluster --name tickets
cp steps/15a-a-tour-on-one-database.env .env
docker compose up -d --wait
tools/shards.sh reset
RATE=600 BUYERS=72000 tools/tour.sh .run/tour-one-database.txt
tools/shards.sh checks
Now four databases, the shards. Each night lives on the shard its number picks: what is left when the number is divided by 4. Night 2 is show 5, on shard 1:
cp steps/15b-shards.env .env
docker compose up -d --wait
tools/shards.sh reset
RATE=600 BUYERS=72000 tools/tour.sh .run/tour-shards.txt
tools/shards.sh checks
tools/shards.sh cpu
Compare the tickets sold each second. What shards don't do: a question across shows, a buyer's tickets or a report, has to ask every database.
Mission 13. A document database¶
Its own Compose project, stage6: its own copy of the selling database and of the app, MongoDB and Neo4j. A change to a table can freeze a sale: a report keeps orders open, ALTER TABLE waits behind it, and every purchase waits behind the ALTER:
docker compose stop
docker compose -f compose.data.yaml up -d --build --wait
tools/s6-frozen-sale.sh orders "card text" 20
Look at the purchases paid in each second: they drop to 0 while the change waits. Now event pages as documents, each with its own shape, and a new field with no table change:
docker compose -f compose.data.yaml run --rm -T s6-tools python /data/pages_load.py
tools/s6-new-field.sh
docker compose -f compose.data.yaml exec -T s6-mongo mongosh --quiet tickets /dev/stdin < data/misspelled.js
What it doesn't do: nothing checks the shape. The last line saves a misspelled field, and MongoDB takes it.
Mission 14. A warehouse¶
Its own Compose project, pipelines: four shards with four years of made-up orders, 22 million of them, a file store, SeaweedFS, and ClickHouse. tools/s5-dc is docker compose on that project:
docker compose -f compose.data.yaml stop
tools/s5-jars.sh
tools/s5-dc up -d --build --wait p-shard0 p-shard1 p-shard2 p-shard3 p-files p-warehouse
tools/s5-dc run --rm -T p-tools python /pipelines/history.py --seed 5 --big-day 2026-11-14 --big-orders 4000000
docker exec pipelines-p-warehouse-1 bash /sql/backfill.sh 2026-11-21
tools/s5-dc run --rm -T p-tools python /pipelines/report.py --runs 4 --until 2026-11-21 --explain --sizes
The same report, the money by show and month, on the four shards and on the column store, each on one CPU, with the rows and bytes each one read. What a warehouse doesn't do: change one row cheaply.
Mission 15. A data pipeline with a scheduler¶
First the nightly job as a plain script: extract yesterday's orders from each shard, transform, load into the warehouse, check. Shard 2 goes down for two minutes while it runs:
The script stops halfway and leaves a wrong report, with nobody told. Now the same steps in Airflow:
tools/s5-dc up -d --wait p-airflow
tools/s5-airflow-fails.sh retry-2026-11-22 2026-11-23T02:00:00-05:00 2 90 400
tools/s5-airflow-fails.sh fail-2026-11-23 2026-11-24T02:00:00-05:00 2 240 400
Shard 2 down for 90 seconds: a retry succeeds and the run is green. Down for 4 minutes: the run fails, visibly, and the warehouse has none of that day's rows. Airflow's page is on http://127.0.0.1:18080.
Mission 16. Batch processing on many machines¶
The transform as a Spark job over one large day of orders, 4 million, on one worker and on three:
tools/s5-dc --profile airflow stop
tools/s5-dc run --rm -T p-tools python /pipelines/nightly/step.py extract 2026-11-14
tools/s5-spark.sh 1 2026-11-14
tools/s5-spark.sh 3 2026-11-14
tools/s5-dc run --rm -T p-tools python /pipelines/nightly/step.py extract 2022-01-01
tools/s5-spark.sh 1 2022-01-01
Compare the wall times. The last job is a tiny day: starting Spark costs more than the work.
Mission 17. Stream processing¶
A scalper buys through many accounts with a few cards. A Flink job reads the sales topic and raises an alarm within seconds:
docker build -t tickets:pipelines app
tools/s5-dc up -d --build --wait p-log p-app p-payments p-mail p-reader
tools/s5-flink.sh start
tools/s5-sale.sh 120 1 20
(tools/s5-dc run --rm -T -e SECONDS=150 -e START=11001 -e SCALP_EVERY=0 -e RATE=5 p-crowd run --quiet /load/s5-scalper.js > /dev/null 2>&1) & sleep 3; tools/s5-flink-kill.sh card_k2 0; wait
tools/s5-flink.sh stop
The sale prints every alarm with its delay, about a second after the purchase. The long line keeps honest buyers coming while one card buys five tickets in 30 seconds, and Flink's worker is killed in the middle of that minute: the job comes back from its last checkpoint on the spare worker and still raises the alarm, about 30 seconds late. When you're done: tools/s5-dc --profile '*' stop.
Mission 18. A graph database¶
A history of buyers, cards, devices and addresses, with rings of scalpers hidden in it. The question: who is connected to this buyer, within N steps? On Postgres and on Neo4j, each on one CPU:
docker compose -f compose.data.yaml up -d --wait
docker compose -f compose.data.yaml run --rm -T s6-tools python /data/history.py --seed 25
docker compose -f compose.data.yaml exec -T s6-db psql -U tickets -d tickets -X -q -c "DROP DATABASE IF EXISTS history" -c "CREATE DATABASE history"
docker compose -f compose.data.yaml exec -T s6-db psql -U tickets -d history -X -f /data/history-postgres.sql
docker compose -f compose.data.yaml stop s6-graph
docker compose -f compose.data.yaml run --rm -T --no-deps s6-graph neo4j-admin database import full neo4j --overwrite-destination=true --nodes=Buyer=/import/buyers-header.csv,/import/buyers.csv --nodes=/import/things-header.csv,/import/things-neo4j.csv --nodes=Order=/import/orders-header.csv,/import/orders-neo4j.csv --relationships=USES=/import/uses-header.csv,/import/uses.csv --relationships=BOUGHT=/import/bought-header.csv,/import/bought.csv
docker compose -f compose.data.yaml up -d --wait s6-graph
docker compose -f compose.data.yaml run --rm -T s6-tools python /data/reach.py --steps 1,2,3,4,5,6,8,10,12 --runs 3 --limit 60
Look at how each one's time grows with the number of steps. Keep s6-graph running: the fraud team's agent in mission 20 reads it.
Mission 19. An agent, and search by meaning¶
Its own Compose project, agents: its own copy of the selling database, the queue and a worker, then the support team's database, Qdrant, Ollama, the scripted stand-in model, the fraud team's agent and ag-desk, where the steps run. First a bad sale: the queue is down for 15 seconds, and some buyers end up charged twice or with no ticket:
docker build -t tickets:agents app
docker build -t agents-desk:lab agents
docker compose -f compose.agents.yaml up -d --build --wait
tools/s7-queue-down-sale.sh 2 3000 100 10 15 .run/s7-k6.txt ring200a=card_0000219 ring200b=card_0000151 ring12800=card_0018826 household=card_0078662 honest=card_0923511
docker logs --since 10m agents-ag-mail-1 2>&1 | tools/s7-desk.sh python -m desk.emails make --event 2 --seed 7 --twice 150 --no-ticket 100
That makes the support team's inbox from the sale. Now the support agent, on LangChain and Deep Agents, reads every email. Its tools are parts you already met: it finds orders on the replica, puts "send the ticket again" on the queue, and asks for a refund that a person approves:
tools/s7-desk.sh python -m desk.support run today-1
tools/s7-desk.sh python -m desk.support counts today-1
tools/s7-desk.sh python -m desk.person today-1
tools/s7-desk.sh python -m desk.check today-1
The model here is the scripted stand-in. To try a free local model on a short run, pull it first: docker compose -f compose.agents.yaml exec -T ag-ollama ollama pull qwen3:1.7b.
Search by meaning, with Qdrant: the buyer's words find nothing by their words, and the right help article by meaning:
tools/s7-desk.sh python -m desk.help_index both "I got billed two times"
tools/s7-desk.sh python -m desk.help_index both "What is this extra fee at checkout?"
The second one is a wrong match that looks close: what search by meaning doesn't do.
Mission 20. A second agent, and the answer¶
The fraud team's agent has its own card and answers "is this buyer part of a ring?" from the graph of mission 18. The support agent asks it over A2A:
tools/s7-desk.sh python -m desk.a2a_wire card
tools/s7-desk.sh python -m desk.a2a_wire ask card_0000219 device_0000219 addr_0000219
The card, the task's states and the answer: part of a ring of 200. In mission 19's run, the refunds for that ring were held for a person.
And the question from the start of the video: a buyer presses Pay. Out of twenty-two parts, how many have to handle the purchase? Everything on the purchase's path runs, in the cluster, with PgBouncer and the four shards. Then everything that can be switched off is switched off at once, then each part of the path alone:
docker compose -f compose.agents.yaml stop
docker compose -f compose.data.yaml stop
cp steps/25-the-count.env .env
tools/count-the-parts.sh setup
tools/count-the-parts.sh all-on
tools/count-the-parts.sh all-off
tools/count-the-parts.sh alone
tools/count-the-parts.sh stop
A part counts when a purchase fails without it. In the video: four out of twenty-two.
Clean up¶
Remove every project's containers, volumes and the images the lab built. The first line removes the files that containers wrote into the lab folder, which on Linux belong to root:
docker run --rm -v "$PWD:/lab" -w /lab python:3.14.10-slim rm -rf data/import .pipeline .run
tools/kube kind delete cluster --name tickets 2> /dev/null
docker compose --profile '*' down -v --rmi local
docker compose -f compose.data.yaml down -v --rmi local
tools/s5-dc --profile '*' down -v --rmi local
docker compose -f compose.agents.yaml down -v --rmi local
docker network rm kind 2> /dev/null
docker image rm tickets:2.0 tickets:2.1 tickets:pipelines tickets:agents agents-desk:lab 2> /dev/null
rm .env
The images it downloaded stay in Docker's cache. Then you can delete the tutorials folder: cd ../../../.. && rm -rf tutorials.
The tools and their licenses¶
Free and open source, with two exceptions. MongoDB Community Server is under the SSPL, which the Open Source Initiative does not approve: it is free to use here, and it isn't open source. Docker Desktop on a Mac or on Windows is free for personal use, education, non-commercial open source and small businesses, and a paid subscription otherwise; Docker Engine and Compose themselves are Apache-2.0, and on Linux you need nothing else.
| Tool and version | License |
|---|---|
| PostgreSQL 19.0 | PostgreSQL License |
| HAProxy 3.4.8 | GPL-2.0-or-later |
| Redis 8.12.0 | AGPL-3.0, RSALv2 or SSPL-1.0 |
| RabbitMQ 4.4.1 | MPL-2.0 |
| Apache Kafka 4.4.0 | Apache-2.0 |
| Kubernetes and kubectl 1.37.0 | Apache-2.0 |
| kind 0.33.0 | Apache-2.0 |
| PgBouncer | ISC |
| Prometheus 3.16.0 | Apache-2.0 |
| Jaeger 2.23.0 | Apache-2.0 |
| Grafana 13.3.2 | AGPL-3.0 |
| k6 2.4.0 | AGPL-3.0 |
| ClickHouse 26.8.46.6 | Apache-2.0 |
| SeaweedFS 4.55 | Apache-2.0 |
| Apache Airflow 3.4.0 | Apache-2.0 |
| Apache Spark 4.3.0 | Apache-2.0 |
| Apache Flink 2.3.0 | Apache-2.0 |
| MongoDB Community 9.0.8 | SSPL-1.0, not open source |
| Neo4j Community 2026.10.2 | GPL-3.0 |
| Qdrant 1.20.2 | Apache-2.0 |
| Ollama 0.40.18 | MIT |
| The model qwen3:1.7b | Apache-2.0 |
| LangChain, Deep Agents | MIT |
| A2A Python SDK | Apache-2.0 |
| Python 3.14.10 | PSF-2.0 |
| FastAPI 0.165.0 | MIT |
Free. Unsubscribe anytime. Form not loading? Subscribe here.