Skip to main content
Make your agent smarter over time — it learns from every conversation and applies those insights automatically.
The user shares preferences in chat; the agent stores learnings and applies them on the next turn.

Quick Start

1

Simple Usage

Enable learning with a boolean — the agent captures persona and insights by default:
2

With LearnConfig

Choose what to learn and how to store it:
3

With Database Backend


How It Works


Learning Modes

mode="propose" is defined in the SDK but not yet implemented — it behaves the same as disabled until the approval workflow is added. Do not use it in production.

Configuration Options

LearnConfig SDK Reference

Full parameter reference for LearnConfig
Precedence ladder:
What the agent can learn: Learning mode:
propose mode is defined in the SDK but not yet implemented. Setting mode="propose" currently behaves the same as "disabled".
Storage backend:

Full list of options, types, and defaults — LearnConfig

Common Patterns

Pattern 1 — Persona learning for personalized responses

Shared learning across agents:
Nudge-based self-improvement: instructions=“You are a writing assistant.”, learn=LearnConfig(persona=True, insights=True, mode=“agentic”), ) response = agent.start(“I prefer formal British English in all my documents.”) print(response)

Best Practices

The default settings (persona=True, insights=True) cover most use cases. Only add patterns=True or decisions=True when you need those specific learning types — they add overhead per turn.
The default file backend is great for development and local agents. For production, switch to sqlite (single-node) or redis/mongodb (multi-node or high throughput).
For long-lived agents, set max_entries (e.g., max_entries=1000) and retention_days (e.g., retention_days=30) to prevent the learning store from growing indefinitely.
Shared learning means all agents read and write to the same store. This is powerful for multi-agent coordination but can cause unexpected behavior if different agents learn conflicting patterns.

Learning Retention

How learned data persists between sessions

Advanced Memory

Full memory system configuration

Learn Skill

Agent skill learning system

Self Improve

Agent self-improvement mechanisms