DEV Community

Cover image for Using CrewAI with Ruby Without the Boilerplate
Muhammad Ibtisam
Muhammad Ibtisam

Posted on

Using CrewAI with Ruby Without the Boilerplate

The Ruby ecosystem has always been great for building clean, maintainable, production-ready systems.

At the same time, tools like CrewAI are opening up a new world — multi-agent workflows that can research, generate, and collaborate on their own.

Naturally, I wanted to try CrewAI from Ruby.

But honestly… the experience wasn’t what I expected.


⚠️ The Gap

Using CrewAI in Ruby usually meant going a bit too low-level:

  • Writing raw HTTP requests
  • Manually handling authentication
  • Building your own polling for async runs
  • Dealing with inconsistent error handling

Sure, it worked.

But it didn’t feel like Ruby.

And if you’ve worked with Ruby for a while, you know that feeling matters.

We care about clean APIs, readability, and developer happiness.
Integrations should match that vibe.


💡 The Idea

I started thinking:

What if interacting with CrewAI felt just like calling a simple Ruby service object?

Something that:

  • Removes boilerplate
  • Feels predictable
  • Fits naturally into any Rails or Ruby app

So instead of scattering HTTP calls everywhere, I built a small client to wrap it all cleanly.


🧩 Introducing: ruby-crewai

ruby-crewai is a lightweight Ruby client for the CrewAI AMP API.

The goal is simple: make working with AI crews feel native to Ruby.


✨ Example

client = CrewAI::Client.new(
  access_token: ENV["CREWAI_TOKEN"],
  uri_base:     ENV["CREWAI_URI_BASE"]
)

client.kickoff(inputs: {
  topic: "AI in healthcare",
  audience: "CTOs"
})
Enter fullscreen mode Exit fullscreen mode

And… that’s pretty much it.

No manual requests.
No custom polling logic.
No unnecessary complexity.


⚙️ What You Can Do

With ruby-crewai, you can:

  • Kick off AI crews
  • Check execution status
  • Resume runs with human feedback
  • Handle errors in a clean, structured way

All through a simple, Ruby-friendly interface.


🧠 Why This Matters

Using modern AI tools shouldn’t mean stepping outside your ecosystem.

By making CrewAI feel natural in Ruby, you get:

  • Faster prototyping
  • Cleaner integrations
  • Less “glue code”

Which basically means:

👉 More time building actual features, not wiring things together


🚀 Getting Started

Install the gem:

gem install ruby-crewai
Enter fullscreen mode Exit fullscreen mode

Check out the project:

👉 https://github.com/MuhammadIbtisam/ruby-crewai


🔮 What’s Next?

This is just a small step toward better AI tooling in Ruby.

There’s still a lot to explore:

  • Multi-agent workflows
  • Human-in-the-loop systems
  • AI-powered backend services

If you’re experimenting with CrewAI or building AI features in Ruby, I’d genuinely love to hear how you’re approaching it.


❤️ Final Thoughts

Ruby has always been about developer experience.

AI integrations should feel the same — simple, expressive, and actually enjoyable to use.

Top comments (0)