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

# Retrieval Config • Rust AI Agent SDK

> RetrievalConfig: Unified retrieval configuration (Agent-first).

# RetrievalConfig

> Defined in the [**RAG**](../modules/rag) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Unified retrieval configuration (Agent-first).

## Fields

| Name            | Type                | Description                  |
| --------------- | ------------------- | ---------------------------- |
| `enabled`       | `bool`              | Enable RAG                   |
| `rag`           | `RAGConfig`         | RAG configuration            |
| `sources`       | `Vec&lt;String&gt;` | Knowledge sources            |
| `auto_retrieve` | `bool`              | Auto-retrieve on every query |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create a new RetrievalConfig

### `enable`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn enable(mut self) -> Self
```

Enable retrieval

### `source`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn source(mut self, source: impl Into<String>) -> Self
```

Add a source

**Parameters:**

| Name     | Type                      |
| -------- | ------------------------- |
| `source` | `impl Into&lt;String&gt;` |

### `rag`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn rag(mut self, config: RAGConfig) -> Self
```

Set RAG config

**Parameters:**

| Name     | Type        |
| -------- | ----------- |
| `config` | `RAGConfig` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/rag/mod.rs#L294">
  `praisonai/src/rag/mod.rs` at line 294
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />

  <Card title="Rust Retrieval" icon="search" href="/docs/rust/retrieval" />

  <Card title="Rust Query" icon="magnifying-glass" href="/docs/rust/query" />

  <Card title="Rust Evaluation" icon="gavel" href="/docs/rust/evaluation" />
</CardGroup>
