Skip to main content
Agent Learn enables agents to capture and recall patterns, preferences, and insights from interactions, improving future responses through persistent learning stores.

Quick Start

1

Simple Shorthand (Recommended)

The easiest way to enable Agent Learn:
learn=True is a top-level Agent parameter — peer to memory=. It auto-creates a minimal memory backend if needed.
2

With Specific Capabilities

3

All 7 Stores (Full Learning)


How It Works

Auto-Injection: When learn=True is enabled, learned context is automatically injected into the agent’s system prompt before each response. No manual wiring needed!

What Gets Injected

When learn=True is enabled, the agent’s system prompt automatically includes a “Learned Context” section with:
Each section only appears if the corresponding store is enabled AND contains data. Thread context is excluded from injection as it’s session-specific.

Learning Stores

Agent Learn organizes knowledge into specialized stores:

Configuration Options


CLI Commands

Manage learning data via the command line:

Show Status

Show Learned Entries

Add Learning Entry

Search Learnings

Clear Learnings


Common Patterns

Personal Assistant with Memory

Team Knowledge Base

Feedback-Driven Learning


Active Learning Tools

For agents that need explicit control over what they learn and recall, use the store_learning and search_learning tool functions — the Learn system counterparts to store_memory / search_memory.

store_learning

Store a learning entry in the agent’s learn system.

search_learning

Search previously stored learnings.
These tools use Injected[AgentState] — the learn_manager is automatically provided at runtime. No manual wiring needed.

Best Practices

Keep scope="private" (default) when storing user-specific preferences or sensitive information. Use scope="shared" only for team knowledge that should benefit all agents.
Start with the default stores (persona, insights, thread) and enable additional stores (patterns, decisions, feedback, improvements) as your use case requires them.
Use retention_days for stores that capture temporal patterns. Thread context often benefits from 7-30 day retention to avoid clutter.
Keep auto_consolidate=True to automatically merge and summarize learnings over time, preventing store bloat.

Agent Train

Active iterative training

Learn vs Train

Compare passive learning vs active training

Memory

Understanding agent memory systems

Knowledge

RAG and knowledge retrieval