activeagents/activeagent

ActiveAgent Rails framework for Agent Apps

What it solves

Building AI-powered features in Rails often feels unstructured. Active Agent brings Agent Oriented Programming to Rails, where agents are treated like controllers. It gives developers a familiar pattern for designing modular, reusable, and maintainable AI components that slot into existing Rails applications, reducing the friction of integrating large language models.

How it works

Agents are Ruby classes that inherit from ActiveAgent::Base and define actions as methods. Generation is handled through multiple providers (OpenAI, Anthropic, Ollama, DeepSeek, RubyLLM, and more), which are configured in a central YAML file. The framework supports streaming via ActionCable, tool/function calling, delegation to sub-agents with declared schemas and budgets, context management, and structured output using JSON schemas. Prompts can be written as ERB templates. A command-line interface runs evaluations and gates CI on pass rates, while an optional dashboard gem (actionagent) provides traces, metrics, and an agent builder.

Who it’s for

Rails developers who want to integrate AI capabilities into their applications without writing low-level provider plumbing. It suits teams already comfortable with Ruby and Rails who need a structured, controller-like approach to building AI features that are reusable and testable.

Highlights

  • Agent-oriented programming: agents behave like controllers in Rails
  • Supports many providers: OpenAI, Anthropic, Ollama, DeepSeek, RubyLLM, and more
  • Action-based design: each agent defines capabilities as methods
  • ERB view templates for prompts (text, JSON, HTML)
  • Real-time streaming via ActionCable
  • Tool/function calling and agent-as-tool delegation with budgets
  • Context management for multi-turn conversations
  • Structured output with JSON schemas
  • CLI for running evaluations and gating CI on pass rate
  • Optional dashboard (actionagent gem) for traces, metrics, and agent management

Related

  • Project
  • Project
  • Project
  • Project
  • Project