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

# Auto RAG Agent • Rust AI Agent SDK

> AutoRagAgent: Auto RAG agent for automatic RAG setup

# AutoRagAgent

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

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

Auto RAG agent for automatic RAG setup

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph LR
    input["Input Data"] --> agent["Agent: AutoRagAgent"]
    agent --> output["Output Result"]
    style agent fill:#8B0000,color:#fff
    style input fill:#8B0000,color:#fff
    style output fill:#8B0000,color:#fff
```

## Fields

| Name      | Type                | Description      |
| --------- | ------------------- | ---------------- |
| `config`  | `AutoRagConfig`     | Configuration    |
| `sources` | `Vec&lt;String&gt;` | Document sources |
| `indexed` | `bool`              | Indexed          |

## Methods

### `new`

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

Create a new AutoRAG agent

**Parameters:**

| Name     | Type            |
| -------- | --------------- |
| `config` | `AutoRagConfig` |

### `add_source`

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

Add a document source

**Parameters:**

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

### `add_sources`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn add_sources(&mut self, sources: impl IntoIterator<Item = impl Into<String>>) -> ()
```

Add multiple sources

**Parameters:**

| Name      | Type                        |
| --------- | --------------------------- |
| `sources` | `impl IntoIterator&lt;Item` |

### `index`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn index(&mut self) -> Result<(), String>
```

Index documents

### `query`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn query(&self, query: &str) -> Result<Vec<String>, String>
```

Query the RAG system

**Parameters:**

| Name    | Type   |
| ------- | ------ |
| `query` | `&str` |

### `is_indexed`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn is_indexed(&self) -> bool
```

Check if indexed

### `sources`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn sources(&self) -> &[String]
```

Get sources

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/parity/specialized.rs#L436">
  `praisonai/src/parity/specialized.rs` at line 436
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Agent" icon="robot" href="/docs/rust/agent" />

  <Card title="Rust Overview" icon="book-open" href="/docs/rust/overview" />

  <Card title="Rust Quickstart" icon="rocket" href="/docs/rust/quickstart" />

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

  <Card title="Rust Autonomy" icon="wand-magic-sparkles" href="/docs/rust/autonomy" />
</CardGroup>
