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…

这是什么?这是 Astrid OS 的 ReAct 循环协调器,属于 Unicity AOS 项目的一部分。它是一个无状态的状态机,驱动“获取上下文、思考、行动、观察、重复”这一循环,正是这个循环让智能体表现得像一个智能体。
它是独立的智能体,还是更大系统的一部分?它是 Astrid OS 架构中的一个 capsule(模块),被描述为协调其他五个 capsule 的“外壳”,自身不做任何具体工作。
我要怎样把它接入项目?没有独立的安装步骤。它在 Astrid OS 系统内部作为一个 capsule 使用,并且只通过 IPC 事件总线与其他 capsule 通信。
它依赖哪些其他 capsule?它协调五个配套的 capsule:Session(会话历史)、Identity(系统提示词)、Prompt Builder(合并插件贡献)、Provider,例如 Anthropic(流式返回 LLM 响应),以及 Tool Router(分发工具调用)。
这个 capsule 刻意不做哪些事?它从不自己调用 LLM、执行工具、构建提示词或存储对话历史,这些工作都由它所协调的其他 capsule 负责。
在这个 OS 模型里,“capsule”到底是什么?capsule 是一个自包含的模块,只通过 IPC 事件总线与其他 capsule 通信,因此任何一个部件(编排、提示词构建、工具路由)都可以独立替换。
轮次状态存放在哪里?每轮的临时控制流状态(不是聊天记录)保存在该 capsule 自己的 KV 存储中,键名类似 react.turn.{sessionid},而真正的对话历史仍保存在 Session capsule 里。
我能把 ReAct 策略换成别的吗?可以。由于这个 capsule 只包含纯粹的编排逻辑,它可以替换成辩论、MCTS 或链式验证(chain-of-verification)等其他策略,而无需改动任何其他 capsule。
Size
0.5 MB
Stars
5K
Age
7mo
Commits · 90 Days