> ## 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 Result • Rust AI Agent SDK

> RAGResult: Result of a RAG query.

# RAGResult

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

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

Result of a RAG query.

## Fields

| Name                 | Type                  | Description                     |
| -------------------- | --------------------- | ------------------------------- |
| `answer`             | `String`              | Generated answer                |
| `citations`          | `Vec&lt;Citation&gt;` | Citations used in the answer    |
| `context`            | `ContextPack`         | Context chunks used             |
| `tokens_used`        | `usize`               | Token usage                     |
| `processing_time_ms` | `u64`                 | Processing time in milliseconds |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(answer: impl Into<String>, context: ContextPack) -> Self
```

Create a new RAG result

**Parameters:**

| Name      | Type                      |
| --------- | ------------------------- |
| `answer`  | `impl Into&lt;String&gt;` |
| `context` | `ContextPack`             |

### `add_citation`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn add_citation(&mut self, citation: Citation) -> ()
```

Add a citation

**Parameters:**

| Name       | Type       |
| ---------- | ---------- |
| `citation` | `Citation` |

### `citation_count`

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

Get the number of citations

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/rag/mod.rs#L130">
  `praisonai/src/rag/mod.rs` at line 130
</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" />
</CardGroup>
