Mar 15, 2025

/

Active Agent

Agents Are Controllers: Active Agent Brings MVC to AI in Rails

Active Agent is the only AI agent framework designed specifically for Rails, combining core Rails conventions with Agent-Oriented Programming.

If you’re looking to build more powerful AI features without adding complexity to your Rails app, Active Agent is the solution you’ve been waiting for.


AI Development With MVC

Just like Rails structures web applications with controllers, Active Agent applies MVC patterns to AI development.

In Rails, ActionController relies on ActiveRecord to manipulate data and ActionView to render HTTP response templates.

Similarly, ActionMailer depends on ActiveRecord to fetch data and ActionView to render email templates.

Active Agent follows this same pattern with ActionPrompt, allowing you to:

  • Use ActiveRecord to manipulate AI-related data.

  • Use ActionView to render prompts for agents or interfaces for users.

Familiar patterns like these make AI development more intuitive, modular, and maintainable:

ActionController < AbstractController

ActionMailer < AbstractController

ActiveAgent < AbstractController

This approach allows AI logic to integrate seamlessly into Rails. For example, imagine an admin agent with read-only access that can generate reports on demand. It works by:

  • Using the database schema as context.

  • Treating the report request as a prompt.

  • Autonomously determining the next actions to execute.

Instead of writing custom logic for every query, the agent understands the request, pulls relevant data, and returns an intelligent response, eliminating the need for constant code modifications.

With Active Agent, implementing this kind of AI-powered feature is as easy as adding a controller or background job.


Agents Are AI Controllers

More than just an AI gem, Active Agent brings AI development in line with MVC conventions by introducing AI controllers. This a dedicated class for managing AI logic, just like ActionController for web requests or ActionMailer for emails.

Instead of scattering AI logic across models and services, Active Agent centralizes it within AI controllers to ensure encapsulated AI logic, minimal complexity, and faster development.

Agents in Active Agent handle AI functions in a structured way, managing:

  • Actions or tool calls performed by the agent

  • Prompts

  • Requests

  • Responses

By treating AI logic like controllers, Active Agent keeps everything modular, testable, and maintainable, just like Rails itself.


Agent-Oriented Programming in Rails

AI isn’t just another REST interface, and Active Agent isn’t just about structuring AI logic. It also introduces Agent-Oriented Programming (AOP), a paradigm that makes AI agents dynamic and adaptable.

AOP extends Object-Oriented Programming (OOP) with reasoning agents—autonomous objects that go beyond predefined attributes and methods.

In AOP, agents can:

  • Adapt to different tasks in real-time.

  • Make decisions based on context.

  • Eliminate hardcoded workflows.

This flexibility makes AOP an ideal paradigm for AI applications, reducing complexity in prompt engineering or RAG pipelines.


Why Active Agent?

With Active Agent, developers get Rails’ structured conventions along with AI’s adaptive intelligence. It's an open source framework that makes AI feel native to Rails without workarounds or complexity. 

If you’re ready to bring AI into your Rails app the right way, Active Agent is the framework for you.


Get Involved

Here’s how you can connect with me or get involved with Active Agent…

🛠️ Try it out (and open issues or submit a PR!)

💬 Join the Active Agent Discord

Hire me to work on your AI project (10% off contracts signed Feb-March 2025)

📩 Email me at justin@activeagents.ai or schedule a call

🐙 Find me on Bluesky, X, LinkedIn, Github

Read More

Check out more content about new releases and AI concepts, written by Active Agent creator Justin Bowen.

Check out more content about new releases and AI concepts, written by Active Agent creator Justin Bowen.

Mar 15, 2025

More than an AI gem, Active Agent brings AI development in line with MVC conventions with AI agents as controllers.

Mar 15, 2025

More than an AI gem, Active Agent brings AI development in line with MVC conventions with AI agents as controllers.

Mar 15, 2025

More than an AI gem, Active Agent brings AI development in line with MVC conventions with AI agents as controllers.

Mar 15, 2025

More than an AI gem, Active Agent brings AI development in line with MVC conventions with AI agents as controllers.

Mar 12, 2025

Build AI agent apps in Rails with Active Agent. New release includes improvements to streaming, less config, and bug fixes.

Mar 12, 2025

Build AI agent apps in Rails with Active Agent. New release includes improvements to streaming, less config, and bug fixes.

Mar 12, 2025

Build AI agent apps in Rails with Active Agent. New release includes improvements to streaming, less config, and bug fixes.

Mar 12, 2025

Build AI agent apps in Rails with Active Agent. New release includes improvements to streaming, less config, and bug fixes.

Mar 7, 2025

Watch as we refactor a Rails RAG system on thoughtbot’s livestream, replacing custom AI logic with Active Agent for a cleaner, Rails-native approach.

Mar 7, 2025

Watch as we refactor a Rails RAG system on thoughtbot’s livestream, replacing custom AI logic with Active Agent for a cleaner, Rails-native approach.

Mar 7, 2025

Watch as we refactor a Rails RAG system on thoughtbot’s livestream, replacing custom AI logic with Active Agent for a cleaner, Rails-native approach.

Mar 7, 2025

Watch as we refactor a Rails RAG system on thoughtbot’s livestream, replacing custom AI logic with Active Agent for a cleaner, Rails-native approach.

Feb 20, 2025

NEW: Active Agent 0.2, a production-ready release candidate so you can start building AI features or refactoring your Rails apps today.

Feb 20, 2025

NEW: Active Agent 0.2, a production-ready release candidate so you can start building AI features or refactoring your Rails apps today.

Feb 20, 2025

NEW: Active Agent 0.2, a production-ready release candidate so you can start building AI features or refactoring your Rails apps today.

Feb 20, 2025

NEW: Active Agent 0.2, a production-ready release candidate so you can start building AI features or refactoring your Rails apps today.

Sep 10, 2024

In most cases, integrating AI isn’t as simple as just plugging in ChatGPT’s API—and without proper implementation, it can lead to critical business mistakes.

Sep 10, 2024

In most cases, integrating AI isn’t as simple as just plugging in ChatGPT’s API—and without proper implementation, it can lead to critical business mistakes.

Sep 10, 2024

In most cases, integrating AI isn’t as simple as just plugging in ChatGPT’s API—and without proper implementation, it can lead to critical business mistakes.

Sep 10, 2024

In most cases, integrating AI isn’t as simple as just plugging in ChatGPT’s API—and without proper implementation, it can lead to critical business mistakes.

Ready to build AI products with Rails?

Copyright © 2025 Active Agent / Justin Bowen

Website & marketing by Sea Foam Media, the premiere agency for AI products & dev tools.

Active Agents Newsletter

Subscribe to receive occasional updates, news, and content from Active Agents.

Ready to build AI products with Rails?

Copyright © 2025 Active Agent / Justin Bowen

Website & marketing by Sea Foam Media, the premiere agency for AI products & dev tools.

Active Agents Newsletter

Subscribe to receive occasional updates, news, and content from Active Agents.

Ready to build AI products with Rails?

Copyright © 2025 Active Agent / Justin Bowen

Website & marketing by Sea Foam Media, the premiere agency for AI products & dev tools.

Active Agents Newsletter

Subscribe to receive occasional updates, news, and content from Active Agents.