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

# Capture Pattern • AI Agent SDK

> capture_pattern: Capture a reusable knowledge pattern.

# capture\_pattern

Method

> This is a method of the [**LearnManagerProtocol**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/LearnManagerProtocol.md) class in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

Capture a reusable knowledge pattern.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def capture_pattern(pattern: str, pattern_type: str) -> Optional[Dict[str, Any]]
```

## Parameters

**pattern** `str` *required*

No description available.

**pattern\_type** `str` (default: 'general')

No description available.

### Returns

**Returns** `Optional[Dict[str, Any]]`

The result of the operation.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/memory/learn/protocols.py#L227)
>
> `praisonaiagents/memory/learn/protocols.py` at line 227


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.