Repolode
BoxcarsAI

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. 1

    Add the gem to your Gemfile (requires Ruby 3.3 or newer)

    gem 'boxcars'
  2. 2

    Install dependencies with Bundler

    bundle install
  3. 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