A Ruby on Rails framework for building AI-powered apps where agents are implemented as controllers with actions and views.
BoxcarsAI/boxcars
A Ruby framework for building LLM-powered applications from composable tools, agents, and multi-provider engines.
- Stars
- 462
- Forks
- 41
- Open issues
- 7
- Last commit
- 25 days ago
What is it?
Boxcars is a Ruby framework for building LLM-powered systems, aimed especially at Ruby and Rails teams. Domain logic is packaged as Boxcar objects, which are single-purpose tools for search, math, SQL or ActiveRecord queries, and API calls. A Train coordinates a set of Boxcars with an Engine to break a problem into steps, either through legacy text ReAct (ZeroShot) or native provider tool calling (ToolTrain).
The framework supports multiple LLM providers through shared engine patterns, including OpenAI, Anthropic, Groq, Gemini, Ollama and Perplexity. It also offers JSON Schema enforced output, vector store integration, and MCP server connections over stdio that merge external MCP tools with local ones. A higher-level StationAgent adds lifecycle callbacks, agent nesting, handoffs and event streaming.
SQL and ActiveRecord boxcars default to read-only mode and reject write operations unless explicitly enabled. Optional provider gems are loaded only when used, and the project requires Ruby 3.3 or newer.
Key features
- 01Packages domain logic as reusable Boxcar tools for SQL, ActiveRecord, search and API calls.
- 02Offers ZeroShot text ReAct and ToolTrain native tool-calling orchestration.
- 03Supports OpenAI, Anthropic, Groq, Gemini, Ollama and other providers via shared engines.
- 04Enforces structured output with JSON Schema through JSONEngineBoxcar.
- 05Connects to MCP servers over stdio and merges their tools with local Boxcars.
- 06Provides StationAgent with callbacks, handoffs and event streaming.
Use cases
- Building internal copilots that query documents and ActiveRecord or SQL data.
- Creating operations bots that call Swagger-defined APIs for multi-step actions.
- Combining vector search with follow-up tool calls in retrieval-first assistants.
- Mixing custom Ruby tools with tools discovered from MCP servers.
Quick start
- 1
Add the gem to your Gemfile (requires Ruby 3.3 or newer)
gem 'boxcars' - 2
Install dependencies with Bundler
bundle install - 3
Or install the gem directly
gem install boxcars
Things to know
- Requires Ruby 3.3 or newer.
- Many features need optional provider gems and API keys to be added separately.
In collections
Topics
FAQ
- What is boxcars?
- A Ruby framework for building LLM-powered applications from composable tools, agents, and multi-provider engines. Boxcars is a Ruby framework for building LLM-powered systems, aimed especially at Ruby and Rails teams. Domain logic is packaged as Boxcar objects, which are single-purpose tools for search, math, SQL or ActiveRecord queries, and API calls. A Train coordinates a set of Boxcars with an Engine to break a problem into steps, either through legacy text ReAct (ZeroShot) or native provider tool calling (ToolTrain).
- Is boxcars free to use? What license does it have?
- boxcars is open source under the MIT license. Check the license terms before using it in commercial products.
- Is boxcars still maintained?
- Actively maintained. The last commit to boxcars was on Oct 13, 2026.
- What can I use boxcars for?
- Building internal copilots that query documents and ActiveRecord or SQL data. Creating operations bots that call Swagger-defined APIs for multi-step actions. Combining vector search with follow-up tool calls in retrieval-first assistants. Mixing custom Ruby tools with tools discovered from MCP servers.
- How do I install boxcars?
- Add the gem to your Gemfile (requires Ruby 3.3 or newer): gem 'boxcars' Install dependencies with Bundler: bundle install Or install the gem directly: gem install boxcars
- Where can I get boxcars?
- The source code and installation instructions are on GitHub: https://github.com/BoxcarsAI/boxcars
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
The Ruby AI framework for building LLM features with chat, tools, agents, embeddings, and Rails integration through one API.
Elixir library for integrating LLMs such as Claude, OpenAI, Gemini, Ollama and self-hosted models into Elixir applications.
A semantic cache library for LLM queries that stores responses and reuses them for similar questions to cut API costs and latency.
An open source MCP server that connects AI agents, IDEs and apps to databases with prebuilt tools or custom tool definitions.
An open-source platform for building and running autonomous, LLM-powered agents and multi-agent workflows, with a no-code graph editor.