> ## 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.

# Context

The **Context System** in Avigrah defines how AI agents access and use information.

It ensures that every AI response is grounded in **relevant, structured, and real-time data**, rather than relying only on generic model knowledge.

***

## What is Context?

Context is the **data layer that powers AI decision-making**.

It provides agents with:

* Business data
* Historical records
* Real-time signals
* Structured knowledge

Without context, AI generates generic outputs.\
With context, AI generates **accurate, actionable, and domain-specific insights**.

***

## Types of Context in Avigrah

Avigrah supports multiple context sources, each designed for a specific purpose.

***

## 1. Integration Context (Live Systems)

Integration context connects AI directly to external systems.

Examples include:

* CRM systems (e.g., Salesforce)
* E-commerce platforms
* Internal business tools

***

### How it works

* Data is fetched directly from connected systems
* AI agents can query live operational data
* Context reflects the current state of the business

***

### Use Cases

* Customer activity analysis
* Sales pipeline insights
* Operational decision-making

***

## 2. Standard RAG Context (Retrieval Layer)

This is the **retrieval-based context system** used for unstructured and semi-structured data.

It works by:

* Storing vectorized data in a vector database
* Retrieving relevant information during AI execution
* Providing contextual grounding for responses

For detailed understanding, refer to:

**Standard RAG System Page**

***

### Use Cases

* Document understanding
* Knowledge base querying
* Historical data reasoning

***

## 3. Lakehouse Context (Structured Data)

Lakehouse context provides AI with access to **structured, stored datasets**.

This includes:

* Processed pipeline data
* Tabular datasets
* Historical records

***

### How it works

* Data is stored in a structured format
* AI agents query this data directly
* Enables precise and deterministic analysis

***

### Use Cases

* Analytics and reporting
* Aggregations and trends
* Financial and operational insights

***

## 4. Redis Cache Context (Fast Access Layer)

Cache context is used for **low-latency, high-frequency data access**.

It stores:

* Recently accessed data
* Frequently used signals
* Intermediate results

***

### How it works

* Data is temporarily stored in cache
* AI agents can access it instantly
* Reduces repeated computation and latency

***

### Use Cases

* Real-time recommendations
* Session-based interactions
* High-speed decision systems

***

## How Context Works Together

Avigrah does not rely on a single context source.

Instead, it combines multiple layers:

* **Integrations** → Live operational data
* **RAG** → Retrieved knowledge
* **Lakehouse** → Structured datasets
* **Cache** → Fast access memory

AI agents dynamically use these sources based on the task.

***

## Context Selection (Agent-Level)

Each AI agent is configured to use specific context sources.

This ensures:

* Relevant data is used for each task
* No unnecessary data exposure
* Better performance and accuracy

***

## Why Context Matters

The quality of AI outputs depends entirely on context.

A strong context system ensures:

### Accuracy

Responses are grounded in real data

***

### Relevance

Outputs match the business scenario

***

### Speed

Cached and structured data improves response time

***

### Reliability

Consistent context leads to consistent outputs

***
