Agentic Engineering from First Principles All chaptersLecturesLabDownload the book
Part IV · Agents Working Together

Chapter 20: Shared State

Central questionWhat happens when several agents coordinate by reading and writing the same workspace, rather than passing every message directly?

Lecture

Chapter principle

Shared state is shared influence. A blackboard simplifies information exchange by making state reusable. That same reuse magnifies stale data, conflicts, unauthorized writes, and bad evidence. So shared state needs explicit write, version, provenance, and trust policies.

Key takeaways

Experiments

Every experiment in the book is small, runnable and printed with its real output. In the Lab you can replay a recorded real run of each one, with no programming, and watch what the model and the agent do.

Experiment 36: Blackboard

How can agents share facts without overwriting each other?

Agents work out an order total: unit price × quantity + shipping. They share a blackboard that stores each fact with its source, a version number, and who has claimed which task. Each worker is a real model that reads one source and extracts one number. Then a cached web page claims a different price, two agents try to take the same task, and a price correction arrives while the total is being computed. This is a recorded run.

All the code for this chapter: github.com/agentic-engineering-book/code

This is Chapter 20 of Agentic Engineering from First Principles: thirty chapters, a case study and fifty-nine executable experiments, from a single model call to controlled, self-improving agents.
Download the bookBrowse all chapters
← Chapter 19: Debate and VotingChapter 21: Agent-to-Agent Communication →