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

# Learn Protocol • AI Agent SDK

> LearnProtocol: Protocol for learning store implementations.

# LearnProtocol

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

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

Protocol for learning store implementations.

Enables custom backends (file, SQLite, Redis, MongoDB, etc.)
while maintaining a consistent interface.

## Methods

<CardGroup cols={2}>
  <Card title="add()" icon="function" href="../functions/LearnProtocol-add">
    Add a new entry to the store.
  </Card>

  <Card title="search()" icon="function" href="../functions/LearnProtocol-search">
    Search entries by query.
  </Card>

  <Card title="list_all()" icon="function" href="../functions/LearnProtocol-list_all">
    List all entries.
  </Card>

  <Card title="get()" icon="function" href="../functions/LearnProtocol-get">
    Get entry by ID.
  </Card>

  <Card title="update()" icon="function" href="../functions/LearnProtocol-update">
    Update an existing entry.
  </Card>

  <Card title="delete()" icon="function" href="../functions/LearnProtocol-delete">
    Delete an entry.
  </Card>

  <Card title="clear()" icon="function" href="../functions/LearnProtocol-clear">
    Clear all entries.
  </Card>
</CardGroup>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
class RedisLearnStore:
        def add(self, content: str, metadata=None) -> Dict[str, Any]:
            # Store in Redis
            return {"id": "...", "content": content}
        
        def search(self, query: str, limit: int = 10) -> List[Dict[str, Any]]:
            # Search Redis
            return []
        
        def list_all(self, limit: int = 100) -> List[Dict[str, Any]]:
            return []
        
        def delete(self, entry_id: str) -> bool:
            return True
        
        def clear(self) -> int:
            return 0
```

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/memory/learn/protocols.py#L15">
  `praisonaiagents/memory/learn/protocols.py` at line 15
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Agent Learn" icon="graduation-cap" href="/docs/docs/concepts/agent-learn" />

  <Card title="Learn Configuration" icon="gear" href="/docs/docs/configuration/learn-config" />
</CardGroup>
