puzzlebox
Manage dynamic finite state machines to coordinate multiple agents effectively, facilitating complex workflows and ensuring real-time updates on state changes. Streamline transitions between project phases to keep teams aligned with overall project goals.
Author

cliffhall
MIT License
Quick Info
Tools 1
Last Updated 2026-02-19
Actions
Tags
puzzleboxcollaborationrealtimerealtime collaborationpuzzlebox managephases teams
puzzlebox
Coordinating agents with state machines
An MCP server that hosts finite state machines as dynamic resources that clients can subscribe to and be updated when their state changes.
Feature Roadmap and Status
A work in progress. Much is done, a few bits remain to be done.
* [x] Unit tests for tool code * [x] Integration tests for MCP server (both SSE and StreamableHttp) * [x] SSE transport * [x] StreamableHttp transport * [x] Multiple simultaneous client connections (both transports) * [x] Create puzzles (state machines) as dynamic resources * [x] Subscribe to puzzles * [x] Receive update notifications when puzzles change * [x] Get puzzle snapshot (current state and available actions) * [x] Change puzzle state by performing action on puzzle * [ ] Resource creation by puzzle state (used by agents and guard prompts) * [ ] Transition guard prompt creation (uses resources by state) * [ ] Transition guard via sampling * [ ] Command line REPL * [ ] Demo via REPLWhat problem does puzzlebox address?
Collaboration and coordination are related but different problems. Collaboration is good for non-trivial yet relatively simple tasks. To tackle long horizon efforts, puzzlebox solves for coordination.
### Teams need coordination Marshalling multiple agents toward a big goal is tougher than just breaking down a request into tasks, assigning them to available agents and [enabling collaboration](https://github.com/cliffhall/GooseTeam) between them. Just as a few agents can collaborate to complete a small project, several teams of process-aware agents need to operate within distinct project phases to tackle long horizon efforts. Consider enterprise-level software development processes: * A large software project typically moves through a multistep, occasionally backtracking path from inception to design to building to testing to documentation to marketing to production. * Different teams are focused on different aspects over time, informed by what's gone before and with an eye toward an ever-changing goal that is refined according to lessons learned. * Even within a phase, teams may cycle through their own phases, like Agile sprints. A certain amount of work is scoped for the sprint, the team works on their parts, and at the end of the sprint they decide what to tackle next. It accepts that each sprint could change the course of future development. These cycles can also be represented as puzzles. With puzzlebox, members of agentic teams can be made process-aware, but the process itself is not subject to hallucination. ### Scenario: Teams passing the torch Three agents are working. The current state of their shared puzzle is "Specification". * Agent 1 is specifying the domain language. * Agent 2 is defining project scope. * Agent 3 is producing the specification document. * The agents collaborate to reach the final specification document. * Once the spec is done, Agent 3 initiates a transition to "Design" state. * First, the spec is checked by an exit guard (i.e., LLM sampling) for completeness. * If problems are found, the state transition is canceled and the team continues. * If acceptable, the state changes to "Design". * The "Specification" agents are monitoring the puzzle and should clock out now. * Their long (and expensive) contexts have been distilled into the specification. * The "Design" team picks from here, with the spec as a resource and their contexts fresh and role-specific.What is a puzzle?
A puzzle is a finite state machine. It's just easier to say, write, and think about.
### A stateful thing you can act upon Imagine the Rubik's Cube puzzle. It has 43 quintillion states, and to transition between them, you act upon it by rotating the intersecting planes of the mechanism. ### Properties of a puzzle - A finite number of discrete states, e.g., "Series Concept and Tone", "World Building", "Arc Plotting", "Episode Planning", "Plotline Blending", "Episode Outline", "Script Writing" etc. - Each state may have any number of actions (including 0) that initiate transition to another state. - There is an initial state. - There is a current state that may differ after actions have been performed on the puzzle. - Transitions can be canceled by state exit and enter guards, e.g., Consult LLM via client sampling request. ### A Simple Example{
"initialState": "LOBBY",
"states": {
"LOBBY": {
"name": "LOBBY",
"actions": {
"START_GAME": { "name": "START_GAME", "targetState": "PLAYING" }
}
},
"PLAYING": {
"name": "PLAYING",
"actions": {
"END_GAME": { "name": "END_GAME", "targetState": "GAME_OVER" }
}
},
"GAME_OVER": {
"name": "GAME_OVER",
"actions": {
"RESTART": { "name": "RESTART", "targetState": "PLAYING" }
}
}
}
}
