> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc-redirect-agent-platform-overview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Learning Machines

> Agents that learn and improve with every interaction.

Agno turns agents into learning machines by combining them with Learning Stores. Learning Stores are persistent backends that capture user profiles, memories, and knowledge over time.

```python theme={null}
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    db=SqliteDb(db_file="tmp/agents.db"),
    learning=True,
)
```

One line. Your agent now remembers users and improves over time.

## Learning Stores

Each store captures a different type of knowledge:

| Store                 | What it captures                                          | Scope        |
| --------------------- | --------------------------------------------------------- | ------------ |
| **User Profile**      | Structured facts (name, role, preferences)                | Per user     |
| **User Memory**       | Unstructured observations from conversations              | Per user     |
| **Session Context**   | Goals, plans, and progress for the current session        | Per session  |
| **Entity Memory**     | Facts about external things (companies, projects, people) | Configurable |
| **Learned Knowledge** | Insights that transfer across users                       | Configurable |
| **Decision Log**      | Decisions with reasoning for auditing and learning        | Per agent    |

Stores can be enabled individually or combined. Each implements the same protocol: `recall`, `process`, `build_context`, `get_tools`.

## Learning Modes

Control how and when the agent learns:

| Mode        | How it works                                        |
| ----------- | --------------------------------------------------- |
| **Always**  | Extraction runs automatically after each response   |
| **Agentic** | Agent receives tools and decides what to save       |
| **Propose** | Agent proposes learnings, you approve before saving |

## Namespaces

Some stores support configurable sharing scope via `namespace`:

| Namespace  | Who can access                                            |
| ---------- | --------------------------------------------------------- |
| `"user"`   | Only the current user                                     |
| `"global"` | Everyone (default)                                        |
| Custom     | Explicit grouping (e.g., `"engineering"`, `"sales_west"`) |

## Maintenance

The Curator keeps memories healthy:

```python theme={null}
lm = agent.get_learning_machine()

# Remove memories older than 90 days
lm.curator.prune(user_id="alice", max_age_days=90)

# Remove duplicates
lm.curator.deduplicate(user_id="alice")
```

## Guides

<CardGroup cols={2}>
  <Card title="Get Started" icon="rocket" iconType="duotone" href="/learning/quickstart">
    Enable learning in your agents
  </Card>

  <Card title="Learning Stores" icon="database" iconType="duotone" href="/learning/stores/intro">
    Configure storage backends
  </Card>

  <Card title="Learning Modes" icon="sliders" iconType="duotone" href="/learning/learning-modes">
    Control how and when agents learn
  </Card>

  <Card title="Custom Schemas" icon="code" iconType="duotone" href="/learning/custom-schemas">
    Extend stores with custom fields
  </Card>
</CardGroup>

## Resources

* [Example: Personal Assistant](/cookbook/learning/personal-assistant)
* [Example: Support Agent](/cookbook/learning/support-agent)
