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

# Context Chunk • Rust AI Agent SDK

> ContextChunk: A single context chunk.

# ContextChunk

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

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

A single context chunk.

## Fields

| Name       | Type                | Description           |
| ---------- | ------------------- | --------------------- |
| `content`  | `String`            | Chunk content         |
| `source`   | `String`            | Source document       |
| `score`    | `f32`               | Relevance score       |
| `index`    | `usize`             | Chunk index in source |
| `metadata` | `HashMap&lt;String` | Metadata              |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(content: impl Into<String>, source: impl Into<String>, score: f32) -> Self
```

Create a new context chunk

**Parameters:**

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

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/rag/mod.rs#L98">
  `praisonai/src/rag/mod.rs` at line 98
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Context Management" icon="layer-group" href="/docs/rust/context-management" />

  <Card title="Rust Token Management" icon="coins" href="/docs/rust/token-management" />

  <Card title="Rust Chunking" icon="scissors" href="/docs/rust/chunking" />

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