Ruby-first framework for building AI agents and generators — plays nicely with Rails, treats prompts as first-class classes, and ships a growing catalog of drop-in generators.
Ruby-first framework for building AI agents and generators — plays nicely with Rails, treats prompts as first-class classes, and ships a growing catalog of drop-in generators.
Sublayer is a model-agnostic AI agent framework written in and for Ruby, giving the huge population of Rails developers idiomatic building blocks for LLM applications without forcing them to switch to Python or JavaScript. The framework centers on three primitives: Generators (a single LLM call with a typed input and output — think of it as a prompt-backed method), Actions (deterministic side-effect functions the AI can call, similar to tools), and Agents (long-running loops that watch triggers and orchestrate generators and actions). Because everything is a plain Ruby class, Sublayer projects fit naturally into a Rails app, use ActiveRecord for state, and get tested with RSpec. The library includes drivers for OpenAI, Anthropic, Google Gemini, Groq, Cohere, Mistral, Together, DeepSeek, and local Ollama models, and it uses Ruby type coercion to guarantee structured outputs. A community-curated catalog of prebuilt generators (blog-post writers, code refactorers, image describers, PR reviewers) means you can pull a battle-tested agent into your app in one gem install. Sublayer's built-in triggers include cron, file watchers, GitHub webhooks, and manual scripts, making it easy to build background AI workflows on any Ruby infrastructure. The project is open source and MIT-licensed, with an active Discord and no vendor cloud requirement — you host it wherever you already host Ruby. MCP client support lets Sublayer agents call any MCP server as an Action.
Was this helpful?
Feature information is available on the official website.
View Features →Free
Ready to get started with Sublayer?
View Pricing Options →Weekly insights on the latest AI tools, features, and trends delivered to your inbox.
No reviews yet. Be the first to share your experience!
Get started with Sublayer and see if it's the right fit for your needs.
Get Started →Take our 60-second quiz to get personalized tool recommendations
Find Your Perfect AI Stack →Explore 20 ready-to-deploy AI agent templates for sales, support, dev, research, and operations.
Browse Agent Templates →