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

> Extract learnings after each turn and inject them into the next.

`learn` extracts durable learnings after each turn and folds them back into the next system prompt.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    T[💬 turn] --> X[🧠 extract learnings]
    X --> I["📌 inject Learned Insights"]
    I --> N[💬 next turn]

    classDef turn fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef step fill:#189AB4,stroke:#7C90A0,color:#fff

    class T,N turn
    class X,I step
```

## Quick Start

<Steps>
  <Step title="Enable agentic learning">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    import { Agent } from 'praisonai';

    const agent = new Agent({ instructions: 'Assist the user', learn: 'agentic' });
    await agent.chat('Remember I prefer metric units');
    await agent.chat('How tall is Everest?'); // answer respects the learned preference
    ```

    `learn: true` is the same as `learn: 'agentic'`.
  </Step>

  <Step title="Propose instead of applying">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    const agent = new Agent({ instructions: 'Assist', learn: 'propose' });
    ```
  </Step>
</Steps>

***

## Modes

| Mode         | Behaviour                                                  |
| ------------ | ---------------------------------------------------------- |
| `'agentic'`  | Extracts and applies learnings automatically.              |
| `'propose'`  | Extracts learnings as proposals rather than applying them. |
| `'disabled'` | Off (same as omitting `learn`).                            |

## Injection and nudges

After a turn, the manager extracts learnings and injects a `Learned Insights` block into the next system prompt. Two fields on `LearnConfig` add periodic reminders:

| Field               | Default | Effect                                                 |
| ------------------- | ------- | ------------------------------------------------------ |
| `nudgeInterval`     | `0`     | Turns between `[System nudge]` reminders (0 disables). |
| `nudgeMinToolIters` | `3`     | Minimum tool iterations before a nudge fires.          |

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { Agent } from 'praisonai';

const agent = new Agent({
  instructions: 'Assist',
  learn: { mode: 'agentic', nudgeInterval: 5, nudgeMinToolIters: 3 },
});
```

<Note>
  An unsupported `learn` value disables learning with a warning rather than throwing — e.g. `learn: 'sometimes'` logs `Unsupported learn= value "sometimes"; ... Learning disabled.`
</Note>

## Reading the manager

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { Agent } from 'praisonai';

const agent = new Agent({ instructions: 'x', learn: 'agentic' });
console.log(agent.getLearnManager()); // the lazily-built manager, or undefined
```

## Related

<CardGroup cols={2}>
  <Card title="Self Improve" icon="wand-magic-sparkles" href="/docs/features/self-improve">
    Skill review turns
  </Card>

  <Card title="Agent" icon="robot" href="/docs/js/agent">
    Constructor options
  </Card>
</CardGroup>
