The rhema framework is still in active development. Expect things to break.

ῥῆμα · "the spoken word": words that do things.

A small, embeddable agent framework in Rust.

Run the coding agent that ships with it, write your own driver, or embed the engine. Every layer is a generic crate with a public interface.

terminal1 / 3
the Rhema Code terminal mid-turn: shell tool calls and the streamed reply
let mut agent = Agent::builder()
    .provider(provider)      // the only model seam
    .resolver(tools)         // the capability seam
    .system("you are a helpful agent")
    .params(ChatParams::new("model-id"))
    .build()?;

let mut session = Session::default();  // caller-owned
session.history.push(Message::text(
    Role::User, "run the echo tool, then summarize"));

// one exchange: request in, reply and results out
let step = agent.step(
    &mut session, &mut sink, &ctx).await?;
// the provided turn loop, from rhema-core
pub async fn run_turn(
    agent: &mut Agent,
    session: &mut Session,
    input: Message,
    sink: &mut dyn EventSink,
    ctx: &ToolContext,
    max_iterations: u32,
) -> Result<ModelOutput, AgentError> {
    session.history.push(input);
    for _ in 0..max_iterations {
        let step = agent.step(session, sink, ctx).await?;
        if step.output.stop_reason != StopReason::ToolUse {
            return Ok(step.output);
        }
    }
    Err(AgentError::MaxIterations(max_iterations))
}

Rhema Code, the terminal-based coding agent.

01 · the workspace

Build at the right layer

Build at the layer you need: run a frontend, write it yourself on top of an existing agent, write your own agent, add a provider, embed the core.

layer 3 · frontends
Rhema Codebinary
the Rhema Code prompt and status line
The rhema binary: a full-screen terminal UI over rhema-coding-agent.
Rhema Clawdaemon
$ rhema-claw
http listening on 0.0.0.0:7799
The resident agent daemon, work in progress: HTTP chat, forge watches, memory, phone notifications.
layer 3 · protocols
rhema-acpThe Agent Client Protocol adapter: editors drive rhema-coding-agent through rhema acp.
layer 2 · drivers
rhema-coding-agentThe coding-agent driver: bash tool, approval seam, session save/resume. Embed it in any frontend.
rhema-autonomous-agentThe resident-agent driver: sources, a lease-driven loop, a tool registry. Rhema Claw runs it.
layer 1 · services
rhema-configThe config file: named profiles, stored keys, the active provider.
rhema-rsdResource-scoped dispatch: per-key leases, live inboxes, revision-guarded checkpoints.
rhema-memoryCross-session memory the model pulls through tools, never injected context.
rhema-identityThe accounts layer: accounts and their secrets, never shown to a model.
rhema-agent-toolsThe agent toolkit: approval-gated bash, skills, paste expansion, the prompt renderer.
layer 1 · adapters
google
anthropic
llama-cpp
openai-compatible
openrouter
copilot
layer 0 · core
rhema-coreThe step engine: request in, reply and tool results out.
rhema-providerThe adapters' shared base: model cards, pricing, SSE decoding.
02 · rhema code

Run the coding agent

Rhema Code is a full terminal UI, your editor over the Agent Client Protocol, on every provider the framework speaks.

Rhema Code TUI
The Rhema Code TUI
terminal

The rhema TUI. Replies stream in as rendered markdown, every tool call is a shell command shown with its exit code, and sessions save under the cache dir for /resume.

your editor

rhema acp speaks the Agent Client Protocol: T3 Code, Zed, JetBrains, Neovim, Emacs, and VS Code launch it as a subprocess, and bash calls prompt through the client's own permission UI.

one-shot

rhema run "summarize this diff" for scripts. Prompt on stdin, plain text on stdout, tool events on stderr, non-zero exit on failure.

03 · the layer map

The core assumes nothing

Each layer out adds a decision. Nothing in layer 0 knows a driver, a store, or an adapter exists.

layer 0core
  • rhema-core · the step engine and its seams
  • rhema-provider · the adapters' shared base: model cards, pricing, SSE decoding
layer 1services and adapters
  • rhema-config · the config file: named profiles, stored keys, the active provider
  • rhema-rsd · resource-scoped dispatch: per-key leases, live inboxes, revision-guarded checkpoints
  • rhema-memory · cross-session memory the model pulls through tools, never injected context
  • rhema-identity · the agent accounts layer: per-service accounts and their secrets, stored so no model reads them
  • rhema-agent-tools · the shared toolkit on the core's tools: approval-gated bash, skills, paste expansion, the system-prompt renderer
  • rhema-provider-{google, anthropic, llama-cpp, openai-compatible, openrouter, copilot} · six adapters: Gemini, Anthropic Messages, llama.cpp servers, any OpenAI-compatible endpoint, OpenRouter, GitHub Copilot
layer 2drivers
  • rhema-coding-agent · the coding-agent driver: bash tool, approval seam, session save/resume
  • rhema-autonomous-agent · the resident-agent core tier: sources, lease-driven driver, tool registry
layer 3frontends
  • rhema-code · the rhema binary: full-screen terminal UI, pipeable one-shot, rhema acp
  • rhema-acp · the Agent Client Protocol adapter: T3 Code, Zed, JetBrains, Neovim, Emacs, and VS Code drive rhema without a plugin per editor
  • rhema-claw · the resident agent daemon: HTTP chat, forge watches, memory, phone notifications

Outside the crates: integrations/rhema-forge-integration, the forge event vocabulary and ingest path the claw mounts for its watches.

04 · the discipline

Why it stays small

The framework stays small on purpose, and the discipline that keeps it there is written down and tested.

The whole API a driver touches is four traits: ModelProvider, the only model seam; ToolResolver, one capability primitive, not a registry; Event and EventSink, streaming deltas and step lifecycle; Session, caller-owned and fully serializable.

The engine is built for the coding agent, and the resident dispatcher is the falsification test on the seams: when the second consumer runs without adding anything to rhema-core, the boundaries hold. A test in the suite checks exactly that.

Deliberately out of the core: the turn loop, persistence, HTTP, tool registries, approvals, sandboxing. Each one is a driver, or a later crate.