Announcing Raix 1.0
Production-Ready AI Components for Ruby
After a long history of battle-testing in production at Olympia and months of heavy duty usage at Shopify, I’m thrilled to announce that Raix has reached version 1.0. This isn’t just another Ruby wrapper around OpenAI’s API — it’s a comprehensive framework for building sophisticated AI-powered applications with discrete, composable components.
Why Raix Exists
When we started building Olympia, one of the world’s most ambitious AI assistant platforms written entirely in Ruby, we quickly realized that existing solutions weren’t cutting it. We needed more than just API wrappers. We needed patterns, abstractions, and battle-tested code that could handle the complexity of real-world AI applications.
The development of Raix was supercharged when we began building Roast, Shopify’s homegrown AI workflow orchestration framework. Roast pushed Raix to new heights by requiring sophisticated tool orchestration, function dispatching, and seamless integration with multiple AI providers. The challenges of building a framework that could execute complex, multi-step AI workflows with dynamic tool selection forced us to refine Raix’s architecture and make it truly production-ready.
Raix (pronounced “ray” because the x is silent) is the distillation of everything we learned building these platforms that serve thousands of users daily. It’s proven code, extracted and refined based on integrating it with some of the largest production Ruby applications in existence.
What Makes Raix Different
1. Discrete AI Components, Not Chatbots
Most AI libraries assume you’re building agents and chat bots. Raix assumes you’re building software. The difference is profound. Instead of managing conversation state globally, Raix lets you create discrete AI components that handle specific tasks:
class OrderProcessor
include Raix::ChatCompletion
include Raix::FunctionDispatch
SYSTEM_PROMPT = "ommitted..."
function :validate_order do
# Your validation logic
end
function :process_payment do
# Payment processing
end
def initialize(order)
transcript << { system: SYSTEM_PROMPT }
transcript << { user: order.to_prompt }
end
def perform
chat_completion # AI orchestrates the function calls
end
end2. Automatic Tool Orchestration
Version 1.0 brings a major improvement: automatic conversation continuation after tool calls. This feature was born from necessity while building Roast, where workflows need to seamlessly chain tool executions without manual intervention. Previously, you had to specifying loop behavior to get a text response after function execution. Now it just works:
# Before 1.0 (deprecated)
response = ai.chat_completion(loop: true)
# After 1.0 - automatic continuation
response = ai.chat_completion
# Returns the final text response after all tool callsThis seemingly small change eliminates downstream complexity and makes AI components feel more natural to work with.
3. Production-Grade Features
Raix includes features you need for real applications:
- Prompt caching for Anthropic models (save up to 90% on API costs)
- Predicted outputs for OpenAI (reduce latency dramatically)
- JSON mode with automatic parsing and fallback strategies
- Function call caching with ActiveSupport::Cache integration
- Model Context Protocol (MCP) support for integrating external tools
- Structured responses with JSON schema validation
4. Rails-Like DSL
If you know Rails, you’ll feel at home with Raix. We’ve applied the same principles of convention over configuration and declarative programming:
class WeatherAssistant
include Raix::ChatCompletion
include Raix::FunctionDispatch function :check_weather,
"Check current weather for a location",
location: { type: "string", required: true } do |args|
# Implementation
end
endReal-World Patterns
Raix embodies the patterns I’ve documented in my book Patterns of Application Development Using AI. It’s not just about making API calls — it’s about understanding how to structure AI components within larger applications.
The collaboration between Raix and Roast demonstrates this perfectly. Roast uses Raix’s function dispatch to create sophisticated AI workflows where each step can dynamically invoke tools based on context. For instance, a Roast workflow might:
- Read files using AI-selected tools
- Analyze code patterns
- Generate reports or transformations
- Execute bash commands to run tests
- Write results back to files
All orchestrated through Raix’s clean abstractions.
For example, the Predicate module implements the Yes/No/Maybe pattern for decision-making:
class ApprovalDecision
include Raix::Predicate
yes? do |explanation|
approve_request!
notify_user("Approved: #{explanation}")
end
no? do |explanation|
reject_request!
notify_user("Rejected: #{explanation}")
end
end
ApprovalDecision.new.ask("Should we approve a $10,000 purchase order for office supplies?")Breaking Changes in 1.0
We’ve made some breaking changes to improve the developer experience:
- Automatic continuation is now the default — The
loopparameter is deprecated - Chat completion now always returns text — Previously returned arrays when the completion called function results, making the API very confusing for newcomers.
stop_looping!renamed - Nowstop_tool_calls_and_respond!for clarity
These changes make the library more intuitive and align better with how developers expect AI components to behave.
What’s Next
Raix 1.0 is just the beginning. Based on community feedback and open pull requests, we’re actively working on:
- Improved Developer Experience: Transitioning from params hash to keyword arguments for cleaner function definitions (#26)
- Enhanced Configuration: Adding the ability to check API client configuration status (#25)
- Expanded Provider Support: Exploring integrations with additional AI backends beyond OpenAI and Anthropic (#21)
- Robust Error Handling: Fixing edge cases with JSON payload validation and improving error messages
- Documentation Updates: Ensuring all code examples in documentation match the latest API
- Additional pattern implementations based on the ones in my book
The roadmap is shaped by real-world usage and community needs. We welcome contributions and feedback as we continue to evolve Raix into the definitive AI framework for Ruby.
Get Started
gem install raixOr add to your Gemfile:
gem 'raix', '~> 1.0'Check out the comprehensive README and dive into the patterns book to level up your AI development skills.
Thank You
Raix wouldn’t exist without the incredible Ruby community and the teams at Olympia and Shopify who battle-tested this code in production.
Special thanks to our contributors who helped shape Raix into what it is today:
- @macournoyer for core architecture contributions
- @bankair for feature implementations
- @henriquenfaria for bug fixes and improvements
- @ujh for testing and feedback
- @martinemde for code reviews and insights
- @andyw8 for documentation improvements
- @parruda for performance optimizations
- @mackross for API enhancements
- @nertzy for compatibility fixes
- @jsidoryn for feature suggestions
- @technicalpickles for Ruby best practices
- @lgray-crm for production testing
- @markhallen for bug reports and fixes
The synergy between Raix and Roast has proven that Ruby can power sophisticated AI applications at scale.
The age of AI-powered Ruby applications is here, and Raix gives you the tools to build them right. Whether you’re building AI assistants like Olympia or workflow orchestration systems like Roast, Raix provides the foundation you need. Let’s show the world that Ruby isn’t just still relevant — it’s leading the way in practical AI application development.
Happy coding!
— Obie
