Riffer is the all-in-one Ruby framework for AI agents — typed tools, structured output, streaming, and adapters for all major providers.
gem install riffer
class WeatherTool < Riffer::Tool
description 'Current weather for a city'
params do
required :city, String, description: 'City name'
end
def call(context:, city:)
text WeatherAPI.fetch(city).summary
end
end
class WeatherAgent < Riffer::Agent
model 'openai/gpt-5-mini'
uses_tools [WeatherTool]
end
puts WeatherAgent.generate('Raining in Vancouver?')
One gem covers the full lifecycle — from defining agents and tools to evaluating, guarding, and tracing them in production.
Declarative classes carry the model, instructions, tools, and output schema.
Typed params with automatic validation before your code runs.
Schema-validated JSON responses, parsed into Ruby data for you.
OpenAI, Azure OpenAI, Amazon Bedrock, Anthropic — plus a mock for tests.
Typed stream events from text deltas to web-search progress.
Measure agent quality and validate input and output at the boundary.
Read them in order, or jump straight to your topic.
Start here