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

# RAG Builder • Rust AI Agent SDK

> RAGBuilder: Builder for RAG

# RAGBuilder

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

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

Builder for RAG

## Fields

| Name      | Type                   | Description |
| --------- | ---------------------- | ----------- |
| `config`  | `RAGConfig`            | -           |
| `model`   | `Option&lt;String&gt;` | -           |
| `sources` | `Vec&lt;String&gt;`    | -           |

## Methods

### `config`

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

Set the configuration

**Parameters:**

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

### `model`

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

Set the model

**Parameters:**

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

### `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;` |

### `build`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn build(self) -> Result<RAG>
```

Build the RAG pipeline

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust RAG" icon="magnifying-glass" href="/docs/rust/rag" />

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

  <Card title="Rust Vector Store" icon="database" href="/docs/rust/vector-store" />

  <Card title="Rust Chunking" icon="scissors" href="/docs/rust/chunking" />

  <Card title="Rust Agent UI" icon="display" href="/docs/rust/agent-ui-agui" />
</CardGroup>
