# Retrieval-augmented generation (RAG)

> Retrieval-augmented generation (RAG) is a technique in which an AI system first searches a set of documents for passages relevant to a question, then gives those passages to a language model so the answer is based on that source material.

Also called: RAG, retrieval augmented generation, chat with your documents, AI knowledge base.

Documents are split into short passages and converted into numerical representations called embeddings, which are stored in a vector database. When someone asks a question, the system finds the passages closest in meaning, adds them to the prompt, and asks the language model to answer using that text. A well-built system also shows which documents the answer came from.

A general AI model knows nothing about your price list, policies, or client files, and retraining a model on them is costly and slow. RAG lets a business use its own documents with an existing model and change the answers simply by updating the documents. Typical uses are an internal assistant for staff questions and a customer chatbot grounded in approved content.

RAG reduces invented answers but does not eliminate them, and it can only be as good as the documents behind it. Outdated or contradictory files produce bad answers. The system must respect permissions so staff cannot retrieve documents they are not allowed to open. Scanned PDFs and complex tables often need extra preparation. We build RAG assistants on cloud or self-hosted models, depending on how sensitive the data is.

## Where we do this work

- [Custom AI agents](https://techpitsolutions.systems/services/custom-ai-agents)
- [Private local AI](https://techpitsolutions.systems/services/private-local-ai)
- [AI chatbots](https://techpitsolutions.systems/services/chatbots)

## See also

- [AI agent](https://techpitsolutions.systems/glossary/ai-agent): An AI agent is software that uses a large language model to work toward a goal by deciding which steps to take, calling tools such as a search, a CRM, or a calendar, and acting on the results with limited human input.
- [Local LLM (self-hosted language model)](https://techpitsolutions.systems/glossary/local-llm): A local LLM is a large language model that runs on hardware a business controls, such as its own computer or server, instead of on an AI vendor's cloud service, so prompts and documents stay within that environment.
- [Data protection laws](https://techpitsolutions.systems/glossary/data-protection-laws): Data protection laws are the rules that govern how organizations collect, use, store, and share personal information. Examples include the EU and UK GDPR, California's CCPA, Canada's PIPEDA, Australia's Privacy Act, and New Zealand's Privacy Act.

---

Source: https://techpitsolutions.systems/glossary/rag

TechPit Solutions · Run by AI, backed by real people. A remote team working with businesses in the US, UK, Canada, Australia, New Zealand and Europe. Email info.techpit.co@gmail.com, WhatsApp +92 344 3360585. Book a 15-minute call: https://techpitsolutions.systems/contact
