RAG
Retrieval-Augmented Generation
A technique that extends an LLM with dynamic search across company documents — the answer is generated by combining retrieved context with a generative model.
What is RAG?
RAG (Retrieval-Augmented Generation) is an architectural pattern that combines a large language model (LLM) with dynamic search across company documents and data. Instead of the model answering only from what it learned during training (which leads to “hallucinations” and outdated information), RAG first finds relevant passages in internal documents and then sends them to the model as context for generating the answer.
Technical RAG architecture:
- Indexing — documents are split into smaller chunks (typically 200–500 words)
- Vectorisation (embeddings) — each chunk is converted into a numerical vector
- Storage — vectors are stored in a vector database (Pinecone, Qdrant, pgvector)
- Query — the user’s question is also converted into a vector
- Retrieval — the top-K most similar chunks are found
- Generation — the LLM generates an answer with context from the retrieved chunks
In a B2B context, RAG solves questions like “where is that travel expense policy?” or “what prices have we charged company XYZ over the last 3 years?” — the answer comes directly from company documents, with a citation of the source.
When it is used
RAG is a key technology for:
- Company chatbots answering from internal documents
- Semantic search across contracts, policies, wikis
- Support automation — the first line responds based on the knowledge base
- Large archive analysis (right-to-erasure GDPR audits)
See the Files module, the Contracts module, and the AI page.
Related terms
- AI Agent — an agent often uses RAG as one of its tools. See /en/glossary/ai-agent.
- MCP — protocol for connecting a RAG system to an agent. See /en/glossary/mcp.
- OCR — scanned documents must be OCR’d before RAG indexing. See /en/glossary/ocr.
In Modulario
Modulario uses RAG over documents in the Files and Contracts modules — anyone who needs an answer simply asks a question in natural language and the system responds with links to specific documents. Indexing happens automatically after a file is uploaded.
Modulario’s internal RAG infrastructure guarantees that customer data is never used to train models and never leaves EU infrastructure. The customer can see which documents the AI drew from, and can restrict sources via RBAC or ReBAC.
Related terms
AI Agent
A software system built on an LLM that autonomously resolves tasks — planning steps, using tools and calling APIs to achieve a given goal.
MCP
An open protocol from Anthropic for standardised connection of AI assistants to external tools, data and services.
OCR
Technology for recognising text from images or scanned documents — converts pixel data into text that can be further processed.
Workflow automation
Technology that chains individual tasks and applications into automated processes — without human intervention for routine steps.
API
An interface through which different software systems communicate — in B2B SaaS typically a REST API or GraphQL over HTTPS.
Related Modulario modules
Implementing RAG in your company?
Modulario covers most B2B processes modularly — deploy only what you need now and grow gradually. Book a free consultation.
Book a consultation