Skip to content

RAG Overview

Understanding how Retrieval-Augmented Generation (RAG) works on the fifthelement.ai platform.


Overview

Retrieval-Augmented Generation (RAG) combines the power of large language models with your organization's knowledge base. Instead of relying solely on the LLM's training data, RAG retrieves relevant documents from your knowledge repositories and provides them as context — enabling the agent to give accurate, fact-based responses grounded in your specific data.


How RAG Works

The RAG pipeline on fifthelement.ai follows this flow:

  1. Ingest — Documents are uploaded or crawled into a Knowledge Repository
  2. Process — Documents are parsed, chunked, and converted into vector embeddings
  3. Store — Embeddings are stored in a Vector Store (Cognitive Search)
  4. Retrieve — When a user asks a question, the Retrieval Tool searches the vector store for the most relevant chunks
  5. Generate — The LLM receives the retrieved context along with the user's question and generates a grounded response

Knowledge Repositories

Knowledge Repositories are the containers that store and organize your documents for RAG. Each repository is backed by a Vector Store and optionally a Batch Model for processing.

Knowledge Repositories Page

Creating a Knowledge Repository

Create Knowledge Repository Modal

  1. Navigate to Knowledge from the top navigation
  2. Click "Create Knowledge Repository"
  3. Configure the repository settings:
Field Required Description
Repository Name Yes A descriptive name for the repository
Repository Type Yes Knowledge (stores documents for RAG and vector search) or Memory (used by the Context Memory Tool for persistent agent memory)
Vector Store Yes Select a configured Vector Store
Batch Model No Select a Batch Model for document processing (summaries, metadata extraction)
  1. Click "Save"

Adding Documents

Once a repository is created, add documents using the Add Document(s) button. The platform supports three categories of ingestion:

Category Methods
Crawl Website, CSV URL Import, Confluence, SharePoint/OneDrive, Human Assisted
Upload Folder (Auto OCR), Folder (No OCR), Folder (Force OCR), Plain Text
API Add documents programmatically via API

For detailed instructions, see Document Ingestion and Web Crawling.


Document Management

Document Status

When batch processing is enabled for a repository, documents move through processing stages:

Status Description
Processing Document is being parsed, embedded, and indexed
Ready Document is indexed and available for retrieval
Failed Processing encountered an error

Document Locks

Documents can be locked with keywords to restrict access during retrieval. Only users whose roles have matching document keys can access results from locked documents. This enables role-based document-level security.

Managing Documents

From the repository documents page you can:

  • Search documents by name
  • Filter by Document Status and Document Locks
  • Edit document metadata and locks
  • View document content
  • Delete documents
  • Update Locks All — bulk update locks across documents

Connecting RAG to Agents

To enable RAG for an agent, you need to connect the knowledge repository through the agent's tools:

  1. Navigate to Agent Settings > Tools
  2. Add a Retrieval tool — this performs vector search against the repository
  3. Alternatively, add a Context tool with Knowledge Repository selected as the context source

The Retrieval tool searches the vector store for relevant document chunks based on the user's query and provides them to the LLM as context for generating responses.