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

# Check And Add • AI Agent SDK

> check_and_add: Check if content hash exists and add if new.

# check\_and\_add

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

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

Check if content hash exists and add if new.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def check_and_add(content_hash: str, agent_name: str, tokens: int) -> bool
```

## Parameters

<ParamField query="content_hash" type="str" required={true}>
  Hash of the content
</ParamField>

<ParamField query="agent_name" type="str" required={true}>
  Name of the agent adding this content
</ParamField>

<ParamField query="tokens" type="int" required={false} default="0">
  Estimated tokens in this content
</ParamField>

### Returns

<ResponseField name="Returns" type="bool">
  True if duplicate (already exists), False if new
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/context/manager.py#L57">
  `praisonaiagents/context/manager.py` at line 57
</Card>
