Skip to main content
A MessageBoard is a forum for agents. Where every other channel holds one conversation, a board holds many threads. Each thread has a title, the agent that started it, labels such as status=open, and its own messages. Agents start, list, read, answer and relabel threads through five tools. Your code and people read the board, reply in threads, change labels, and hand a thread to a swarm to work in. Everything lives in a SQLite database, so a board survives restarts and several processes can share it. Reference: MessageBoard.

How the pieces fit

Only agents start threads. The board has no method for creating one, so work always enters the board through an agent. Labels are free-form key=value pairs; this guide uses status and kind, but pick whatever your workflow needs.

1. Agents open and answer threads

A planner splits a brief into one thread per question, and a researcher answers each one. Both get the same board.agent_tools; every post is signed with the agent_name of the agent that made it.
An agent needs enough loops to call its tools and then answer. max_loops=2 is enough to open threads. An agent that lists, reads, replies to and relabels several threads needs about one loop per tool call, plus one.

2. Read the board from your code

threads() returns a summary of each thread, most recent activity first. Pass labels to filter: only threads carrying every one of them are returned.
thread(thread_id) returns the thread as a Conversation, so every Conversation method works on it:
The Conversation is a copy read from the database. Changing it changes nothing on the board; post with reply().

3. Step in as a person

People and code can reply in any thread and change its labels. The thread moves to the top of threads() when it gets a message. Here a person pushes back on an answer and reopens the thread, and the researcher picks it up again:
A label set to None is removed: board.set_labels(thread_id, {"needs": None}). Agents do the same with label_thread(thread_id, "needs=").

4. A bug queue run on labels

Labels work as a status field. A triager opens one thread per bug; a fixer takes each open bug in turn; a reviewer closes the fixes it approves and reopens the rest. The board is saved to runs/bugs.db, so the queue survives restarts.
Because the loop is driven by threads({"status": "open"}), you can run the fixer step again later and it picks up exactly the bugs the reviewer reopened.

5. Give each thread its own swarm

board.channel(thread_id) turns one thread into a regular comms channel. Any agent or swarm that takes a channel then reads the thread before it runs and posts each member’s answer to it, signed with the member’s name. No tools needed. A coordinator opens one thread per project and labels it with the team that owns it. Each thread then gets the swarm its label asks for, and the swarms run at the same time:
Every method and tool takes the board’s lock, so swarms working in different threads, or in the same thread, never lose a message. Build a separate set of agents for each swarm, as with any channel.

6. Agents that use other tools too

agent_tools is a plain list, so an agent can hold the board’s tools next to its own:
The board’s tool names are fixed, so give an agent the tools of only one board.

7. Save, resume and share a board

With a file db_path, every board, thread and message is written as it happens. Keep the board’s id to open it again later, from the same process or a new one:
Things to know:
  • One file, many boards. Every MessageBoard(...) call creates a new board with its own id, even with the same name and db_path. To continue a board, load() it by id; list_boards() shows what a file holds.
  • Several processes. Every read goes to the database, so processes on the same machine that load() the same board see each other’s posts as soon as they are written.
  • Several machines. Keep the file on one machine. For agents elsewhere, use HttpChannel.
  • Plain SQL. The board’s tables (message_boards, board_threads, board_messages) can sit in the same file as a SqliteChannel, and any SQLite client can query them.
  • In memory. The default db_path=":memory:" keeps the board in this process only.

Tips

  • Name every agent. Posts are signed with agent_name, and threads are filtered by labels the agents write. Two agents on the default name can’t be told apart on the board.
  • Spell out the labels in the system prompt. The model types labels as a string, for example "kind=bug, status=open". Tell each agent which labels to write and which to look for, as in the examples above.
  • Drive the work from your code. Loop over board.threads({...}) and run an agent per thread, as the bug queue does. Each run then has a small, focused context, and you decide what runs next.
  • Close the board with board.close() when you are done. The file keeps everything.

Next steps