capsule-react README

The project's README from github.com/unicity-aos/capsule-react. As one markdown file: README.md.

astrid-capsule-react

License: MIT OR Apache-2.0 MSRV: 1.94

The ReAct loop coordinator for Astrid OS.

In the OS model, this capsule is the shell. It drives the reasoning-and-action cycle that makes an agent an agent: fetch context, think, act, observe, repeat.

State machine

Idle -> AwaitingIdentity -> AwaitingPromptBuild -> Streaming -> AwaitingTools -> Streaming -> ... -> Idle

The react loop contains no inference logic. It is pure control flow that coordinates five other capsules over the IPC event bus:

  1. Session - fetch conversation history, persist turn results
  2. Identity - build the system prompt from workspace config
  3. Prompt Builder - merge plugin contributions into the final prompt
  4. Provider (e.g. Anthropic) - stream LLM responses
  5. Tool Router - dispatch tool calls and collect results

What it does not do

This capsule does not call LLMs, execute tools, build prompts, or store messages. It orchestrates the capsules that do. Replacing this capsule with a different orchestration strategy (debate, MCTS, chain-of-verification) changes the agent's behaviour without touching any other capsule.

Persistence

Ephemeral per-turn state is stored in the capsule KV store:

This is control flow state, not conversation history. History lives in the session capsule.

Development

rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --release

License

Dual-licensed under MIT and Apache 2.0.

Copyright (c) 2025-2026 Joshua J. Bouw and Unicity Labs.

capsule-react (unicity-aos/capsule-react)

Searching Database…

What is this?This is the ReAct loop coordinator for Astrid OS, part of the Unicity AOS project - a stateless state machine that drives the fetch-context, think, act, observe, repeat cycle that makes an agent behave like an agent.
Is this a standalone agent or a piece of a larger system?It is one 'capsule' (modular component) in Astrid OS's architecture, described as the 'shell' that coordinates five other capsules rather than doing any work itself.
How do I wire this into a project?There is no standalone install step - it is used internally as one capsule in the Astrid OS system and talks to the other capsules strictly over an IPC event bus.
What other capsules does it depend on?It coordinates five companion capsules: Session (history), Identity (system prompt), Prompt Builder (merges plugin contributions), Provider e.g. Anthropic (streams LLM responses), and Tool Router (dispatches tool calls).
What does this capsule deliberately not do?It never calls LLMs, executes tools, builds prompts, or stores conversation history itself - those jobs belong to the other capsules it orchestrates.
What exactly is a 'capsule' in this OS model?A capsule is a self-contained module that only talks to other capsules over an IPC event bus, so any single piece - orchestration, prompting, tool routing - can be swapped out independently.
Where does turn state get stored?Ephemeral per-turn control-flow state (not chat history) lives in the capsule's own KV store under keys like react.turn.{sessionid}, while actual conversation history stays in the Session capsule.
Can I swap the ReAct strategy for something else?Yes - because this capsule is pure orchestration logic, it can be replaced with a different strategy like debate, MCTS, or chain-of-verification without changing any of the other capsules.
Size
0.5 MB
Stars
5K
Age
7mo
Commits · 90 Days