Swaran Soft
Enterprise AI

What Is RAG? Retrieval-Augmented Generation Explained for Enterprises

November 1, 20267 min readBy Yogesh Huja, Founder & CEO
What Is RAG? Retrieval-Augmented Generation Explained for Enterprises

What is RAG?

Large language models will answer questions about company leave policy. However, the answer may be incorrect.

This isn’t due to sloppiness. The reason is because your model has never seen your leave policy. The model only has knowledge available on the public internet, but your HR handbook may only be stored in an internal SharePoint system. Therefore it will make educated guesses.

How RAG works

RAG makes your model provide accurate answers by providing it with the correct documents to refer to. Just as with a new employee, we’d rather they looked up information, than guessed.

We’ve implemented RAG for HR, compliance and field staff across India. We learned some key lessons in doing so, and in this guide, we highlight what we wish every CTO knew before starting their first RAG project.

Overview of RAG

Imagine having a research assistant. They go to the library, find the 3 most important documents and write a concise answer (with page references).

RAG works in a similar way:

  • Question is asked: "What is the reimbursement limit for client travel in Tier-2 cities?"
  • The system searches through your documents (Policies, contracts, etc.) to identify a few relevant pieces of text.
  • This text is sent to the language model, along with the question.
  • The model writes a response to the question. A well designed system will also tell you which documents were used for each part of the response.

This is very straightforward. No additional training is required. No knowledge has been permanently embedded within the model. You’re essentially changing the exam to be open book.

Why RAG is preferable to fine-tuning in enterprises

Fine-tuning may seem like the best way to make AI ‘your own’. However, for most knowledge intensive tasks, RAG is better in almost all areas.

FactorRAGFine Tuning
Current AnswersUpdating a document means new answers are providedTraining must be run again
CitationsProvided automaticallyVery difficult to provide knowledge is merged into model
PermissionsCan be limited depending on userAll users receive the same knowledge from the model.
Initial CostLower (search and indexing required).Higher (GPU, preparation, multiple iterations)
Best forPolicies/Manuals/Contracts/Support KnowledgeStyle/Format of output

Although fine tuning can be useful in some scenarios (for example, if you want the model to be in a very specific format or classify text in your domain), if you want the model to provide correct answers based on your documents, RAG is a great place to start. Fine-tuning can be added at a later point.

Things to consider beyond proofs of concept

Building a basic proof of concept may take just a few hours. However, to gain trust across a 5000 person company requires some serious engineering. Projects often go wrong when considering these factors:

1. Poor quality documents

Documents may be scanned PDFs, split into tables over multiple pages, or have multiple versions of one policy (with 2 out of date). As this is what the model is working from, it can only be as good as it is given. In our experience, document quality and ownership have a much greater impact on whether the system works well than the choice of model. Someone needs to take ownership and state clearly which document is up to date and archive the others.

2. Poor chunking

Chunks of text are created from documents. If the chunks are too small the context of the text will be lost. If the chunks are too long, the model will return a large block of text with the answer somewhere inside. Good chunks are dependent on the structure of the document, and so should be separated into sections, heading, clauses etc. rather than character length.

3. Poor similarity search results

Semantics search is commonly used in RAG solutions to retrieve the best answer. While powerful, it may miss specific terms (such as policy numbers, part numbers and legal clauses). To resolve this issue, hybrid search can be used. This combines semantic search with keywords to give better results. Although not as exciting as choosing the model itself, this is very important!

4. Incorrect permission control

If the HR assistant gives salary band information to an intern, merely by asking in the right way, it is no longer just a chatbot – it’s a data breach. Correct permission controls must be enforced in the Retriever. This should be designed into the system from the start, as adding it in later can be a pain.

5. No quality metrics

‘It seems to work’ isn’t a metric. To ensure quality, create a test set of 100-200 real questions. Run these tests regularly, to ensure the correct document has been retrieved, and that the final answer accurately reflects the document. Not doing this means you’ll get into arguments based on anecdotes.

Common RAG use cases in Indian enterprises

Generally speaking, the best use cases for RAG will involve high volumes of documents, repeated queries, and people spending a long time searching for information which exists.

  • HR & Employee Services – Using MonaWork HR agent means queries can be resolved in under 4 minutes (down from 2 days). Around 70% of queries can be resolved over WhatsApp, without human intervention. The answers to most of these questions already existed in policy documents, but employees just couldn’t find them.
  • Compliance and Legal – People can query the system and immediately get the correct clause in circulars/contracts/regulatory updates. The citation is included.
  • Field/Plant – Queries can be made in Hindi/Tamil relating to maintenance procedures and an answer can be returned from an English manual.
  • Customer Support – Questions can be answered by agents (humans/AI) directly from real product documentation. This means fewer incorrect promises are being made to customers.

Data Sovereignty

Many enterprises in India will be concerned about data sovereignty. Normally, in a cloud based RAG system, documents (or pieces of documents) are sent to an external API every time a query is made. Within BFSI firms and hospitals this could cause major issues with compliance under the DPDP act and industry regulations.

However, this is not necessarily the case. By deploying the full RAG system internally (in a private cloud or data centre), using open source embedding models, a self-hosted vector DB and a local language model (using tools such as Ollama), and using Indian models (such as those on AI Kosh) to answer queries in regional languages, you can fully keep the data within your network.

The downside is that you’ll be responsible for managing the infrastructure. However, for many organisations, predictable costs and real peace of mind is much more valuable than convenience of using an API based system (paying per token).

Deployment Plan

You don’t need to spend 2 years deploying RAG. A sensible initial deployment can be achieved within the following schedule (similar to our 8 week pilot):

WeekTaskOutput
1-2Choose an area to implement RAG. Gather and clean documents. Define 150 test questions.Defined knowledge base and test set.
3-5Build ingestion, chunking, hybrid search, permissions, and response.Functional RAG system within your environment.
6-7Pilot with real users. Improve retrieval accuracy and prompt tuning.Test quality against test set.
8Launch with monitoring and feedback.Live system with improvement loop.

Start with a small area. Choose one department, set of documents and a clear measure of success. Implementing a useful HR policy assistant will teach you much more than implementing a huge enterprise knowledge brain which people have no trust in.

Summary

Using RAG means that generative AI can be made very useful with your own business knowledge. It provides answers supported by real documents, includes citations, and can respect permissions. It can even be deployed fully on infrastructure that you have control over.

The LLM itself is straightforward. The difficulty is in creating high quality documents, effective search and accurate measurement. If these are achieved, your teams will have a tool that they can really rely on.

Swaran Soft has been creating enterprise solutions for 25+ years. We currently deploy production RAG/Agentic AI on open source, hosted in India systems, with no vendor lock in.

Want to talk it through with us? We run a free 45-minute AI Pilot Assessment. Drop a line to info@swaransoft.com, or ring +91 9220-313-650 (India) | +971-50-9292-650 (UAE). You'll find more at www.swaransoft.com

Common questions

Free 45-minute AI Pilot Assessment

Share this article:
Yogesh Huja — Founder & CEO, Swaran Soft
Yogesh HujaFounder & CEO

AI Architect and Entrepreneur building India's Edge AI ecosystem. 25+ years in enterprise technology. Founder of Swaran Soft, Gignaati, and Copilots.in.

Published: ⏱ 7 min read