The agent harness for Ruby applications.

watch it work ↓
demos

Watch it work.

Five short recordings of real runs, replayed in the browser. No model behind them, so click around as much as you like.

quickstart

A tool-using agent in one file.

Define a tool, hand it to an agent, stream the run. The block gets every event as it happens.

weather.rb
require "mistri"
weather = Mistri::Tool.define(
"get_weather", "Current weather for a city.",
schema: -> { string :city, "City name", required: true },
) do |args|
Weather.for(args["city"])
end
agent = Mistri.agent("claude-opus-4-8", tools: [weather])
agent.run("What should I wear in Lahore today?") do |event|
print event.delta if event.type == :text_delta
end
capabilities

What it handles.

The parts you would otherwise build and babysit yourself. Every panel is the real API, not pseudocode.

approval.rb
reimburse = Mistri::Tool.define(
"reimburse", "Issues an expense reimbursement.",
needs_approval: ->(args) { args["amount_usd"].to_i > 1000 },
) { |args| Expense.reimburse!(args) }
result = agent.run("Reimburse Dana's $1,200 travel")
result.awaiting_approval? # => true, nothing executed
# Days later, from a controller, then a worker:
session.approve(call_id)
agent.resume
get started

Put a mistri in your app.