Back to Blog
head

1 minute read

RAG and NLQ in Generative AI: How natural language queries transform data analytics

Saša Mehmedagić

Software Engineer

At a recent FridayTalk, our software engineer, Saša Mehmedagić, presented an overview of an innovative AI Assistant developed and successfully deployed for one of our clients.

Saša demonstrated how Retrieval-Augmented Generation (RAG) and Natural Language Query (NLQ) in Generative AI empower users to perform data analytics with natural language and conversational inputs.

The technology behind the AI Assistant

At the beginning, Saša detailed the technical architecture, explaining how the feature translates a user’s question into a secure and executable database query. The core of the system is built on a serverless Generative AI architecture on AWS Lambda, powered by Anthropic’s Claude models via Amazon Bedrock.

Outlining a multi-step flow, Saša demonstrated how a user’s question is first converted into a structured JSON query plan, which is then validated and executed securely by the backend. The retrieved data is subsequently passed to a second language model to generate a concise, formatted, and user-friendly answer.

Overcoming prompt engineering and security challenges

Furthermore, Saša also discussed the key prompt engineering challenges in Generative AI,  encountered during development, including resolving ambiguity in user requests (such as relative timeframes), enforcing domain-specific business logic, and implementing essential security guardrails to protect data privacy and prevent unauthorized actions.

Simplifying integration through MCP

Looking toward the future, our software engineer introduced the Model Context Protocol (MCP), framing it as a potential “USB-C for AI.” He explained MCP as one of the emerging AI integration standards that simplifies how models connect to tools and data sources.

This talk shows how combining RAG and NLQ in Generative AI can revolutionize data analytics and AI integration.

Explore more of our projects, stories, and tech insights on our Blog.

head

Saša Mehmedagić

Software Engineer

Saša Mehmedagić is a full-stack developer specializing in TypeScript frameworks, such as Angular and React, as well as Node.js and Serverless backend solutions. AWS-certified and cloud-native by design, he builds scalable systems with a strong focus on performance and maintainability.

With years of experience in the automotive industry, Saša contributes to both the architecture and implementation of robust platforms. His clean code mindset, DevOps know-how, and end-to-end expertise make him a valuable asset to the team.

Related posts.