NashTech Blog

Meet AgenticRAG: A Smart Interface to Akka Agentic AI – Part 1

Table of Contents
Hi! How may I help you?

In our previous blog series Akka Agentic AI: Secret to Planning a Perfect Trip, we built our first fully autonomous trip/activity planner using Akka Agentic AI. It’s a nice way to develop a fully autonomous application which can work and adapt to Users’ preferences without human intervention.

However, an agentic application has few flaws embedded into its design:

  • It can handle only transactional tasks (e.g., booking, payments, planning) which needs strict pre-defined workflows
  • It needs structured data, since transactional tasks cannot work with unstructured data
  • Last but not the least, performance is key, so that it can replace Non-Agentic APIs

To overcome these challenges, Akka Agentic AI has another tool in it’s toolbox. It’s called RAG, short for Retrieval-Augmented Generation. It can work with both – unstructured/structured data, provides better contextual responses, and it can scale to wide variety of tasks without needing a pre-defined workflow.

What is RAG?

RAG has a very useful design. It combines retrieval of knowledge base from a vector database (e.g., Mongo Atlas, pgvector (Postgres Vector)) with a Large Language Model (like GPT, Gemini) to generate contextual responses.

This article will guide us through building a Retrieval-Augmented Generation (RAG) chat agent called AgenticRAG. This RAG application will have an AI Agent that will use latest Akka Agentic AI documentation as its knowledge base to answer queries from different User(s). To begin with, we will start with a very simple agent that streams responses from a LLM.

Add the AskAkkaAgenticAI Agent

As seen in previous articles, system message provides system-level instructions to the AI model and establishes its role. Next, the user message (question) represents the specific query, instruction, or input that needs to be processed by the model to generate a response.

Note: To stream the response to the client (User) via SSE (server-sent events) we are using StreamEffect.

Create an Endpoint

Time to ask Question!

1. Set OpenAI API Key as environment variable

2. Start the service locally

3. Use curl/postman to call the Endpoint

Since, the response is streamed, hence it is visible incrementally, instead of the entire response ready at once.

Next Steps

Each time a user submits a query to the agent, the AskAkkaAgenticAiAgent agent streams responses from a LLM (OpenAI/GPT). But a better approach would be perform a semantic search over a vector database which can provide a better contextual response. To populate the vector database with all the knowledge that we want to make available to the agent, we will be exploring Knowledge Indexing feature in upcoming blogs, hence, stay tuned 🙂

Further Reading

Picture of Himanshu Gupta

Himanshu Gupta

Himanshu Gupta is a Principal Architect passionate about building scalable systems, AI‑driven solutions, and high‑impact digital platforms. He enjoys exploring emerging technologies, writing technical articles, and creating accelerators that help teams move faster. Outside of work, he focuses on continuous learning and sharing knowledge with the tech community.

Leave a Comment

Your email address will not be published. Required fields are marked *

Suggested Article

Scroll to Top