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

# Corpus Stats • AI Agent SDK

> CorpusStats: Statistics about an indexed corpus.

# CorpusStats

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

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

Statistics about an indexed corpus.

Used for strategy selection and monitoring.

Attributes:
file\_count: Number of files in corpus
chunk\_count: Number of chunks created
total\_tokens: Estimated total tokens
indexed\_at: Timestamp of last indexing
path: Path to corpus root
strategy\_recommendation: Recommended retrieval strategy

## Properties

<ResponseField name="file_count" type="int">
  No description available.
</ResponseField>

<ResponseField name="chunk_count" type="int">
  No description available.
</ResponseField>

<ResponseField name="total_tokens" type="int">
  No description available.
</ResponseField>

<ResponseField name="indexed_at" type="Optional[str]">
  No description available.
</ResponseField>

<ResponseField name="path" type="Optional[str]">
  No description available.
</ResponseField>

## Methods

<CardGroup cols={2}>
  <Card title="from_directory()" icon="function" href="../functions/CorpusStats-from_directory">
    Create CorpusStats from directory scan.
  </Card>

  <Card title="strategy_recommendation()" icon="function" href="../functions/CorpusStats-strategy_recommendation">
    Recommend retrieval strategy based on corpus size.
  </Card>
</CardGroup>

<Accordion title="Internal & Generic Methods">
  * **from\_dict**: Create from dictionary.
  * **to\_dict**: Convert to dictionary.
</Accordion>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/knowledge/indexing.py#L42">
  `praisonaiagents/knowledge/indexing.py` at line 42
</Card>
