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

> RetrievalPolicy: Retrieval policy for RAG

# RetrievalPolicy

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

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

Retrieval policy for RAG

## Fields

| Name         | Type      | Description                            |
| ------------ | --------- | -------------------------------------- |
| `Always`     | `variant` | -                                      |
| `retrieve`   | `variant` | -                                      |
| `context`    | `variant` | -                                      |
| `default`    | `variant` | Always retrieve context                |
| `Always`     | `variant` | Always retrieve context                |
| `Never`      | `variant` | -                                      |
| `retrieve`   | `variant` | -                                      |
| `context`    | `variant` | -                                      |
| `Never`      | `variant` | Never retrieve context                 |
| `Retrieve`   | `variant` | -                                      |
| `only`       | `variant` | -                                      |
| `when`       | `variant` | -                                      |
| `needed`     | `variant` | -                                      |
| `OnDemand`   | `variant` | Retrieve only when needed              |
| `Retrieve`   | `variant` | -                                      |
| `based`      | `variant` | -                                      |
| `on`         | `variant` | -                                      |
| `similarity` | `variant` | -                                      |
| `threshold`  | `variant` | -                                      |
| `Threshold`  | `variant` | Retrieve based on similarity threshold |

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <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" />

  <Card title="Rust Criteria" icon="check-double" href="/docs/rust/criteria" />

  <Card title="Rust Policy" icon="file-shield" href="/docs/rust/policy" />
</CardGroup>
