Ruby on Rails for the AI Era

Duration: 1h 05m | On demand Ruby on Rails has powered some of the world’s most successful startups and continues to be one of the most productive frameworks for building scalable web applications. In this webinar, Luis Payan], Senior Software Engineer at BEON.tech, breaks down how Ruby on Rails…

Published on

Verified author
Luis Payan
Written by Luis Payan Senior Ruby on Rails Engineer
Contents

Duration: 1h 05m | On demand

Ruby on Rails has powered some of the world’s most successful startups and continues to be one of the most productive frameworks for building scalable web applications.

In this webinar, Luis Payan], Senior Software Engineer at BEON.tech, breaks down how Ruby on Rails works in practice, step by step, from understanding MVC architecture to building and deploying a real-world application.

🎥 Watch the Full Webinar

Prefer to watch? The complete session is above.
Prefer to read and go deeper into each concept? Keep scrolling.

What You’ll Learn

By the end, you’ll understand how to:

  • Generate embeddings and store them in PostgreSQL using pgvector
  • Implement semantic search by comparing vector similarity
  • Run embedding generation asynchronously using Rails background jobs
  • Build a real-time streaming assistant using Action Cable
  • Stream model responses chunk-by-chunk into the UI
  • Generate dynamic CSV reports using AI-generated SQL
  • Reuse the embedding logic across models using Rails concerns

The goal is not just to define Ruby on Rails, but to show how it fits into real production environments and how you can start building with it yourself.

Rails in the Age of AI

There’s a common misconception that Rails is falling behind in the AI era.

In reality, most AI features are integrations: API calls, background jobs, database operations, and real-time updates. Rails excels at structured backend workflows and rapid development.

Instead of replacing Rails, the opportunity is to enhance it.

This webinar demonstrates how.

Feature 1: Semantic Product Search

(Embeddings + pgvector)

Traditional ecommerce search relies on filters and keyword matching. As product catalogs grow, users spend more time configuring filters than finding what they need.

Semantic search improves this experience by matching meaning instead of keywords.

For example:

  • “Show me stuff related to sports”
  • “Things you’d put in a bedroom”

Instead of exact matches, the system compares vector representations of text.

How Semantic Search Works

The workflow:

  1. Convert product text into embeddings
  2. Store embeddings in PostgreSQL using pgvector
  3. Convert the user query into an embedding
  4. Compare vectors using similarity operators
  5. Return the closest matches

Each product generates a semantic context using:

  • Name
  • Description
  • Tags

Because embedding generation can be slow at scale, the demo runs this process asynchronously using Rails background jobs.

This keeps the user experience responsive.

Making Embeddings Reusable with Rails Concerns

In real applications, multiple models may require embeddings: Products, Posts, FAQs, etc.

Instead of duplicating logic, the webinar shows how to extract embedding behavior into a Rails concern.

This allows you to:

  • Centralize embedding generation
  • Standardize context building
  • Reuse functionality across models

This keeps the system maintainable as the schema grows.

Feature 2: AI Product Assistant

(Streaming Chat with Action Cable)

The second feature is a ChatGPT-style assistant embedded in a product page.

Users can ask natural-language questions like:

“Can you compare this car with the most popular brands?”

Real-Time Streaming Architecture

The system works as follows:

  1. The user sends a message
  2. Rails forwards it to the language model
  3. The model streams the response incrementally
  4. Rails broadcasts chunks via Action Cable
  5. The frontend appends chunks in real time

Instead of waiting for a full response, the UI updates as text is generated.

This creates a responsive, modern experience using Rails-native tools (Hotwire and Stimulus).

Feature 3: Dynamic Report Generator

(AI → SQL → CSV)

The third feature allows users to generate reports using natural language prompts.

Example:

“Show total products sold, add quantity per order by each user, and include all user info.”

How the Report Generator Works

  1. The user submits a request
  2. Rails sends the prompt plus database context to the model
  3. The model generates SQL
  4. Rails executes the SQL
  5. Rails generates a CSV in memory
  6. The file is sent directly to the browser

Rails supports raw SQL execution when needed and allows CSV streaming without storing files on the server.

Security Considerations

Generating SQL with AI introduces risk.

In production environments, you should:

  • Use a read-only database user
  • Restrict allowed query types
  • Validate AI-generated output
  • Block destructive statements
  • Limit accessible tables
  • Protect the feature with strict authorization

AI integration requires architectural boundaries, not blind execution.

Key Takeaways

Rails remains one of the fastest ways to ship structured web applications, even in the age of AI.

This webinar demonstrates that you can:

  • Implement semantic search with embeddings and pgvector
  • Build real-time AI assistants with Action Cable
  • Generate dynamic reports using AI-powered SQL
  • Integrate modern AI features without changing your stack

The goal is not to chase trends, but to leverage Rails’ strengths to deliver modern capabilities.

FAQs

What if users make typos in semantic search?

You can improve prompts, preprocess input, and handle “no results” gracefully.

Is semantic search better than Elasticsearch?

They solve different problems. Elasticsearch excels at keyword filtering. Embeddings excel at meaning-based retrieval. Many teams combine both.

Does Rails prevent prompt injection?

Rails prevents SQL injection when parameterized correctly. Prompt injection requires output validation and strict execution boundaries.

Do I need Ollama for this setup?

No. Ollama is used in the demo for local development. Any provider with embedding and chat APIs can work.

Building a team that works with these tools? BEON.tech helps US companies hire senior Ruby on Rails developers from Latin America who work in your time zone.

Verified author
Luis Payan
Written by Luis Payan Senior Ruby on Rails Engineer

Luis Payan Montoya is a senior Ruby on Rails engineer from Mexico with about 8 years of web development experience, also working with PostgreSQL, Sidekiq, React and Node.js. He studied Computer Systems Engineering at the Instituto Tecnológico de Ciudad Juárez and has worked with BEON.tech since 2023. He writes about building well-structured Rails applications and bringing AI capabilities into production workflows.

Expertise
Ruby on RailsHerokuSidekiqPostgreSQLPHPJavaScriptHTMLCSSLaravelNode.jsAngularReactSassBootstrapPWAResponsive Design

Ready to build your team in Latin America?

Let us connect you with pre-vetted senior developers who are ready to make an impact.

Get started

Explore our next webinars

Software Engineering

API Testing With Postman and Charles Proxy

APIs power almost every modern application. Whether you’re creating users, retrieving data, updating records, or validating purchases, APIs handle the communication between client and server. In this workshop, Jesús Fiora walks through the fundamentals of API testing and demonstrates how to validate API behavior using two powerful tools: 🎥 Watch the Full Webinar Prefer to…

Jesus Figueroa May 5, 2026 4 min read
Software Engineering

RESTful APIs With Django REST Framework

APIs are the backbone of modern applications. In this webinar, Matheus walks through the fundamentals of what an API is, the key principles behind REST, and how to implement production-ready patterns using Django REST Framework (DRF). You’ll learn how RESTful APIs work end-to-end, how to design clean endpoints, and how DRF helps with authentication, permissions,…

Matheus Reis Eidt May 5, 2026 6 min read
Software Engineering

AI Document Search With LangChain and NotebookLM

AI is changing how we interact with information. One of the most practical shifts is how we can now ask questions directly to our documents: PDFs, books, manuals, and other unstructured sources. Without manually searching page by page. In this webinar, Matias Bustamante walks through a hands-on tour of three different approaches to querying PDFs…

Matias Bustamante May 5, 2026 6 min read
Hiring engineers? Talk to an expert. Talk to an expert