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

# Should Retrieve • AI Agent SDK

> should_retrieve: Determine if retrieval should be performed for a query.

# should\_retrieve

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**RetrievalConfig**](../classes/RetrievalConfig) class in the [**retrieval\_config**](../modules/retrieval_config) module.

Determine if retrieval should be performed for a query.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def should_retrieve(query: str, force: bool, skip: bool) -> bool
```

## Parameters

<ParamField query="query" type="str" required={true}>
  The user query
</ParamField>

<ParamField query="force" type="bool" required={false} default="False">
  Force retrieval regardless of policy
</ParamField>

<ParamField query="skip" type="bool" required={false} default="False">
  Skip retrieval regardless of policy
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if retrieval should be performed
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/rag/retrieval_config.py#L286">
  `praisonaiagents/rag/retrieval_config.py` at line 286
</Card>
