> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Learning Modes

> Control when and how agents learn.

Learning modes control when and how a Learning Machine captures information. Each store can use a different mode.

| Mode        | How it works                                                                                | Tradeoff                                               |
| ----------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| **Always**  | Extraction runs automatically in the background, without waiting for the response to finish | One extraction call for each enabled Always-mode store |
| **Agentic** | Agent receives tools and decides what to save                                               | May miss implicit information                          |
| **Propose** | Agent is instructed to propose learnings and wait for confirmation                          | Confirmation depends on model compliance               |

## Always Mode

Extraction happens automatically in the background. No agent tools involved.

<Note>
  Extraction starts concurrently with the model call, not after it. It sees the conversation up to the current user message, not the assistant's response or tool calls from that same turn.
</Note>

```python theme={null}
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.learn import LearningMachine, LearningMode, UserProfileConfig
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    db=PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai"),
    learning=LearningMachine(
        user_profile=UserProfileConfig(mode=LearningMode.ALWAYS),
    ),
)

# Profile info extracted automatically - no tool calls visible
agent.print_response(
    "I'm Alice Chen, but please call me Ali.",
    user_id="alice@example.com",
)
```

Best for: User Profile, User Memory, Session Context, Entity Memory

## Agentic Mode

The agent receives tools and decides when to save.

```python theme={null}
from agno.learn import LearningMachine, LearningMode, UserProfileConfig

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    db=db,
    learning=LearningMachine(
        user_profile=UserProfileConfig(mode=LearningMode.AGENTIC),
    ),
)

# Agent decides to call update_profile tool
agent.print_response(
    "Remember that I prefer dark mode interfaces.",
    user_id="alice@example.com",
)
```

Best for: Learned Knowledge, Decision Log

### Tools by Store

| Store             | Tools                                                                                                                          |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| User Profile      | `update_profile`                                                                                                               |
| User Memory       | `update_user_memory`                                                                                                           |
| Entity Memory     | `search_entities`, `create_entity`, `update_entity`, `add_fact`, `update_fact`, `delete_fact`, `add_event`, `add_relationship` |
| Learned Knowledge | `search_learnings`, `save_learning`                                                                                            |
| Decision Log      | `log_decision`, `record_outcome`, `search_decisions`                                                                           |

## Propose Mode

The agent proposes learnings. The user must confirm before saving.

```python theme={null}
from agno.learn import LearningMachine, LearningMode, LearnedKnowledgeConfig

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    db=db,
    learning=LearningMachine(
        knowledge=knowledge,
        learned_knowledge=LearnedKnowledgeConfig(mode=LearningMode.PROPOSE),
    ),
)

# Agent proposes, user confirms
agent.print_response(
    "That's a great insight about API rate limits - we should remember that.",
    user_id="alice@example.com",
)
```

Propose mode is enforced through system prompt instructions, not application code. The `save_learning` tool stays available throughout the run, so confirmation depends on the agent following its instructions rather than a code-level approval gate.

Note: Propose mode is currently intended for Learned Knowledge.

<Warning>
  Do not use Propose mode as the sole approval control for high-stakes, regulated, or compliance-sensitive workflows. Enforce required approval in application code before persisting a learning.
</Warning>

Best for: Low-risk learned knowledge that benefits from prompt-guided review

## Combining Modes

Use different modes for different stores:

```python theme={null}
from agno.learn import (
    LearningMachine,
    LearningMode,
    UserProfileConfig,
    UserMemoryConfig,
    LearnedKnowledgeConfig,
)

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    db=db,
    learning=LearningMachine(
        user_profile=UserProfileConfig(mode=LearningMode.ALWAYS),     # Automatic
        user_memory=UserMemoryConfig(mode=LearningMode.ALWAYS),       # Automatic
        learned_knowledge=LearnedKnowledgeConfig(mode=LearningMode.AGENTIC),  # Agent-driven
    ),
)
```

## Defaults by Store

| Store             | Default mode                                                  | Reason                                                                       |
| ----------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| User Profile      | Always                                                        | Names and preferences should be captured consistently                        |
| User Memory       | Always                                                        | Observations accumulate passively                                            |
| Session Context   | Always                                                        | Session state needs continuous tracking                                      |
| Entity Memory     | Always                                                        | Continuous extraction captures entity facts/events from normal conversations |
| Learned Knowledge | Agentic                                                       | Agent decides what insights are worth saving                                 |
| Decision Log      | Always (`DecisionLogConfig()`), Agentic (`decision_log=True`) | Supports both automatic logging and explicit logging workflows               |

## Choosing a Mode

| Scenario                                  | Mode    |
| ----------------------------------------- | ------- |
| Capture user names and preferences        | Always  |
| Build user memory automatically           | Always  |
| Track session progress                    | Always  |
| Agent-driven knowledge capture            | Agentic |
| Build entity knowledge graphs             | Always  |
| Audit agent decisions                     | Agentic |
| Prompt-guided review of learned knowledge | Propose |
