No Turn Order in Parallel
Message-passing tutorials assume agents take turns. Parallel agents don't wait for a message that hasn't been sent yet.
Multi-Agent Shared Context
Give every agent access to the same durable context. Decisions, discoveries and updates become instantly available across your entire workflow—without prompt sharing or duplicated work.
Agent log
Deprecating legacy-session-token, replaced by JWT.
Reading shared context before starting implementation… Skipping legacy-session-token because it is deprecated. Building jwt-auth instead.
No conflicts found. The Coder read the Planner's deprecation before acting.
Shared context
subject: sw-run-8841Deprecation: legacy-session-token
Built: jwt-auth, rbac, login, logout
STATUS: CLEAN
Problems
Without shared context, agents repeat work, lose decisions and rely on fragile handoffs to stay aligned.
Message-passing tutorials assume agents take turns. Parallel agents don't wait for a message that hasn't been sent yet.
The Reviewer catches the conflict only after both agents have finished. The wasted compute can't be recovered.
Without a shared authoritative layer, every agent is reconstructing state from whatever messages happened to reach it.
Features
Every role operates from the same durable context while preserving its own actions, decisions and provenance.
architectural_decision
Content
Deprecate legacy-session-token and replace it with JWT.
implementation_note
Built jwt-auth, RBAC, login and logout.
review_finding
STATUS: CLEAN
create_episode() records one raw fact per agent action. Cheap, append-only, no interpretation yet.
create_episode()
Planner records its architectural decision.
compile_memories_wait()
compileThe decision becomes active and readable by every agent.
get_context()
Coder reads the decision before writing any code.
The Coder's context read happens before it decides what to build, not after. That ordering is what prevents the collision instead of just detecting it.
bundle = shared.before_acting(
caller_id, task
)
result = agent.run(task, context=bundle)
shared.decide(caller_id, result.decision)
SharedContext isn't tied to this repo's agents. Wrap the same before_acting()/decide() pair around any CrewAI tool or Claude Agent SDK loop.
subject_id = "sw-run-8841"
planner
coder
reviewer
caller_id attributes every read and write
All three roles read and write the same subject. “Did someone already decide this?” becomes a lookup, not a guess.
One run, one subject_id. Every agent in the fleet reads and writes that same shared context, automatically.
Reference Builds
Compare the same workflow before and after Statewave, then inspect the complete execution history behind every decision.
python main.py --mode naive runs the same task with message-passing only. The Coder never sees the Planner's deprecation and rebuilds the dead module from scratch.
Reviewer detects duplicated work only after both agents have finished. Compute has already been wasted.
python main.py --mode statewave runs the identical task on a shared subject. The Coder reads the deprecation before writing any code and skips the dead module entirely.
The Coder read the Planner's deprecation before acting, so the obsolete module was never rebuilt.
timeline_inspector.py --run <id> prints the chronological chain for any run: what each agent knew when it acted, what it wrote and the final memory state.
Prevention
Traditional pipelines review conflicts after the work is done. Statewave gives the Coder the right context before it decides what to build.
Pipeline comparison
Context available before execution
Naive pipeline
Message-passing only
The Reviewer detects the conflict only after both agents finish.
Statewave pipeline
Shared subject
The deprecation is known before the first line of code is written.
from statewave_agents.context import
SharedContext
bundle = shared.before_acting(...)
result = agent.run(...)
shared.decide(...)
python timeline_inspector.py \
--run sw-abc12345
✓ chronological replay generated
Integration
Call before_acting() before an agent decides, and decide() after it produces output. Wrap those two calls around any existing agent loop in minutes.
Why Statewave
Everything agents need to remember, retrieve and explain, without turning raw conversation history into your architecture.
Every fact is classified and scored, so agents surface the most relevant context instead of searching through raw history.
Memories stay isolated by user and agent, making personalized sessions safe to run at scale.
Set a hard ceiling and Statewave fills it with the highest-signal memories without exceeding the limit.
Memory survives restarts and redeployments, so agents continue with context from the first message onward.
Every recalled fact links back to its source episode, showing exactly what an agent knew and when.
Retrieval stays fast enough for real-time conversations without adding noticeable delay to agent responses.
FAQ
Message passing assumes an ordering parallel agents do not have — an agent cannot wait for a message nobody has sent yet. Shared context inverts it: before_acting() reads the authoritative bundle for the run’s subject before an agent decides, and decide() writes the outcome back as an episode. "Did someone already decide this?" becomes a lookup against one store rather than a guess about which messages happened to arrive.
Ordering. The Coder’s context read happens before it chooses what to build, not after — so the Planner’s deprecation is known before the first line of code exists, and the obsolete module is never rebuilt. A reviewer-style check catches the same conflict only once both agents have finished, and that compute is unrecoverable. Prevention is a read-before-write discipline, not a smarter conflict detector.
Every read and write carries a caller_id and the run is one subject_id, so timeline_inspector.py --run <id> prints the chronological chain: what each agent read, what it wrote, and the final memory state. For compliance-grade runs, context assembly can also emit a state-assembly receipt with a SHA-256 hash of the exact bytes delivered and the content hash of the policy bundle applied.
No. SharedContext wraps whatever loop you already run — the same before_acting() and decide() pair goes around a CrewAI tool or a Claude Agent SDK loop, and each agent keeps its own prompt and model. Coordination runs on Postgres with no extra infrastructure: no message broker, no scheduler, and no graph database to operate alongside it.
Answers last checked against the Statewave docs and repositories on .
Shared memory that keeps every agent aligned before work begins, preventing duplicated decisions and conflicting implementations.