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

# indexing • AI Agent SDK

> Incremental Indexing Infrastructure for PraisonAI Agents.

# indexing

<Badge color="blue">AI Agent</Badge>

Incremental Indexing Infrastructure for PraisonAI Agents.

Provides:

* CorpusStats: Statistics about indexed corpus
* IndexResult: Result of indexing operation
* IgnoreMatcher: .praisonignore pattern matching
* FileTracker: File hash/mtime tracking for incremental updates

No heavy imports - only stdlib.

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents.knowledge import indexing
```

## Classes

<CardGroup cols={2}>
  <Card title="CorpusStats" icon="brackets-curly" href="../classes/CorpusStats">
    Statistics about an indexed corpus.
  </Card>

  <Card title="IndexResult" icon="brackets-curly" href="../classes/IndexResult">
    Result of an indexing operation.
  </Card>

  <Card title="IgnoreMatcher" icon="brackets-curly" href="../classes/IgnoreMatcher">
    Matcher for .praisonignore patterns.
  </Card>

  <Card title="FileTracker" icon="brackets-curly" href="../classes/FileTracker">
    Track file hashes and modification times for incremental indexing.
  </Card>
</CardGroup>

## Functions

<CardGroup cols={2}>
  <Card title="estimate_tokens_simple()" icon="function" href="../functions/estimate_tokens_simple">
    Simple token estimation (\~4 chars per token).
  </Card>
</CardGroup>

### Constants

| Name                  | Value                                                                                   |
| --------------------- | --------------------------------------------------------------------------------------- |
| `STRATEGY_THRESHOLDS` | `{10: 'direct', 100: 'basic', 1000: 'hybrid', 10000: 'reranked', 100000: 'compressed'}` |
| `DEFAULT_STRATEGY`    | `'hierarchical'`                                                                        |
