> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avigrah.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Standard RAG System

The **Standard RAG (Retrieval-Augmented Generation) System** in Avigrah provides a structured way for AI agents to access and reason over large volumes of data.

It ensures that every AI response is grounded in **retrieved, relevant, and contextually accurate information**, rather than relying solely on model memory.

***

## What is RAG?

Retrieval-Augmented Generation (RAG) is a system where:

* Data is stored in a searchable format
* Relevant information is retrieved at runtime
* AI generates responses based on that retrieved context

This approach ensures that outputs are:

* Accurate
* Context-aware
* Aligned with your actual data

***

## How the Standard RAG System Works

The RAG system in Avigrah follows a structured pipeline:

**Data → Embedding → Vector Storage → Retrieval → AI Response**

***

### 1. Data Processing

Data from pipelines is:

* Cleaned and structured
* Converted into smaller chunks
* Prepared for embedding

This ensures that information is searchable and retrievable.

***

### 2. Embedding Model

Avigrah uses:

**all-MiniLM-L6-v2 (default)**

This model converts text into vector representations.

These vectors:

* Capture semantic meaning
* Enable similarity-based search
* Allow AI to retrieve relevant information even when queries are not exact matches

***

### 3. Vector Database

All embeddings are stored in:

**Qdrant Vector Database**

Qdrant enables:

* High-performance vector search
* Scalable storage of embeddings
* Fast retrieval during AI execution

***

### 4. Similarity Search

Avigrah uses:

**Cosine Similarity**

This method compares vectors based on their semantic closeness.

* Higher similarity → More relevant context
* Lower similarity → Less relevant

This ensures that AI retrieves the most meaningful data for each query.

***

### 5. Context Retrieval

When an AI agent executes:

* The query is converted into a vector
* Relevant data points are retrieved from Qdrant
* Top matching results are selected

This retrieved data becomes the **context for the AI response**.

***

### 6. AI Response Generation

The AI model receives:

* The user query
* Retrieved context from the vector database

It then generates a response that is:

* Grounded in actual data
* Contextually accurate
* Consistent with the underlying information

***

## Why This System Matters

The Standard RAG System solves one of the biggest limitations of AI systems:

### Hallucination

Without retrieval:

* AI guesses based on training data

With RAG:

* AI responds based on **actual retrieved data**

***

## Key Characteristics

### Semantic Search

Finds meaning, not just keywords

***

### Scalable Architecture

Handles large datasets efficiently

***

### Low Latency Retrieval

Optimized for fast response times

***

### Consistent Outputs

Same query → same context → reliable answers

***

## Where RAG is Used

The Standard RAG System is used for:

* Document understanding
* Knowledge base systems
* Historical data analysis
* Context-aware AI responses
* Retrieval-driven reasoning

***

## Integration with Pipelines

RAG is tightly integrated with data pipelines.

* Pipelines prepare and structure data
* Data is vectorized and stored in Qdrant
* AI agents query this data during execution

This ensures a **continuous flow from data → intelligence**.

***

## Default Configuration

Avigrah’s Standard RAG system is optimized out of the box:

* Embedding Model: all-MiniLM-L6-v2
* Vector Database: Qdrant
* Similarity Metric: Cosine Similarity

These defaults provide a balance of:

* Performance
* Accuracy
* Scalability

***

## Positioning

The Standard RAG System is the **core retrieval layer** of Avigrah.

It enables AI agents to move beyond static knowledge and operate on **real, dynamic, and structured data**.

This is what makes Avigrah’s AI systems:

* Reliable
* Context-aware
* Production-ready
