DEV Community

Cover image for Ruby on Rails in the AI Era: Why don't need to switch to Python
Stoyan
Stoyan

Posted on

Ruby on Rails in the AI Era: Why don't need to switch to Python

Why Ruby on Rails Developers Don't Need to Switch to Python for AI

For the last few years, every AI conversation seemed to end with the same conclusion:

"If you want to build AI applications, learn Python."

And yes, Python is currently dominating the AI landscape. Most AI frameworks, tutorials, courses, and research projects are built around Python. Tools like PyTorch, Hugging Face, LangChain, and countless AI libraries make it the default choice for machine learning and AI development.

But what if you're already comfortable with Ruby and Rails (like me)?

Do you really need to switch?

I don't think so.

The AI Misconception

Many developers associate AI with:

  • Training neural networks
  • Building custom models
  • Deep learning research
  • Data science

But the reality is that most companies are not training the next GPT model.

They're building:

  • AI chatbots
  • Internal knowledge bases
  • AI-powered search
  • Customer support assistants
  • Workflow automation

These are software engineering problems.

Rails is already good at solving them

A modern AI stack can look surprisingly simple:

Rails API
+
RubyLLM
+
PostgreSQL + pgvector
+
Sidekiq
+
OpenAI / Claude / Gemini
Enter fullscreen mode Exit fullscreen mode

With this setup you can build a complete RAG (Retrieval-Augmented Generation) application (I've built chatbot at Roomspilot with that stack).

For example:

  1. Upload PDFs or documentation
  2. Split content into chunks
  3. Generate embeddings
  4. Store them in PostgreSQL using pgvector
  5. Retrieve relevant content through vector search
  6. Send the context to an LLM

That's basically how many production AI assistants work today.

FastAPI vs Rails API Mode

A common AI stack in Python looks like this:

FastAPI
+
PostgreSQL
+
Vector Database
+
OpenAI
Enter fullscreen mode Exit fullscreen mode

The Ruby equivalent is:

Rails API Mode
+
PostgreSQL + pgvector
+
RubyLLM
+
OpenAI
Enter fullscreen mode Exit fullscreen mode

Different language.

Same architecture.

As Rails developers, we already know how to build APIs, background jobs, authentication systems, multi-tenant applications, and scalable products.

The AI part is often just another integration.

Where Python still wins

If your goal is:

  • Model training
  • Deep learning
  • Computer vision
  • AI research

Python is the clear winner.

No debate there.

Where Rails still shines

If your goal is shipping AI-powered products quickly, Rails remains an excellent choice.

You don't have to throw away years of experience just because AI became the hottest topic in tech.

Sometimes the smartest move isn't learning an entirely new stack.

It's adding new capabilities to the stack you already master.

Top comments (0)