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

# Top Chunks • Rust AI Agent SDK

> top_chunks: Get top chunks by score

# top\_chunks

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

> This is a method of the [**RetrievalResult**](../classes/RetrievalResult) class in the [**rag**](../modules/rag) module.

Get top chunks by score

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def top_chunks(&self, n: usize) -> Vec<&ContextChunk>
```

## Parameters

<ParamField query="n" type="usize" required={true}>
  No description available.
</ParamField>

### Returns

<ResponseField name="Returns" type="Vec<&ContextChunk>">
  The result of the operation.
</ResponseField>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Chunking" icon="scissors" href="/docs/rust/chunking" />

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