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

# Chunking • Rust AI Agent SDK

> Chunking: Chunking utility.

# Chunking

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

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

Chunking utility.

## Fields

| Name     | Type             | Description |
| -------- | ---------------- | ----------- |
| `config` | `ChunkingConfig` | -           |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new(config: ChunkingConfig) -> Self
```

Create a new chunking utility

**Parameters:**

| Name     | Type             |
| -------- | ---------------- |
| `config` | `ChunkingConfig` |

### `chunk`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn chunk(&self, text: &str) -> Vec<String>
```

Chunk text into smaller pieces

**Parameters:**

| Name   | Type   |
| ------ | ------ |
| `text` | `&str` |

## Source

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

***

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