What is Learning?
Learning extracts insights from agent executions and stores them in a readable markdown file. You can then review these learnings and incorporate the best ones back into your agent instructions - creating a human-in-the-loop improvement cycle.Recommended Workflow
The default workflow keeps you in control:- Enable extraction - Set
evaluate: trueto capture learnings - Run your agent - Learnings accumulate in
{agent-name}.learnings.md - Review periodically - Check the learnings file for valuable insights
- Update instructions - Copy the best learnings into your agent file
blog-writer.learnings.md. If you see a valuable pattern like “use specific time estimates for each tip”, add it to your Guidelines section permanently.
Auto-Apply (Optional)
If you want hands-off improvement, enableapply: true:
- Up to 10 learnings are appended to your agent instructions each run
- The agent adapts without manual intervention
- Less control, but more autonomous
Start with manual review (
apply: false) until you trust the quality of extracted learnings. Then consider enabling auto-apply for mature agents.Configuration Options
| Option | Type | Description |
|---|---|---|
evaluate | true or string | Extract learnings after execution. Use true or a custom evaluation prompt. |
apply | boolean | Auto-inject stored learnings in future runs. Default: false. |
file | string | Custom file path for storing learnings (relative to agent file). |
Storage
Learnings are stored in{agent-name}.learnings.md next to your agent file:
How Extraction Works
After execution (whenevaluate: true):
- LLM evaluates the execution result
- Extracts 0-3 high-confidence learnings (≥0.8 threshold)
- Deduplicates against existing learnings (60% word overlap)
- Stores in markdown format
How Application Works
On next run (whenapply: true):
- Loads up to 10 learnings from storage
- Appends them to your agent instructions as a
## Learned Guidelinessection - Tracks which learnings were applied (for analytics)
Learning Categories
Learnings are categorized for context:- tip - General best practices
- warning - Things to avoid
- pattern - Successful approaches
- tool-usage - How to use specific tools
- error-fix - Solutions to known errors
Storage Format
Learnings are stored as readable markdown:Custom Evaluation Prompts
Pass a string toevaluate for domain-specific extraction:
Example: Manual Review Workflow
blog-writer.learnings.md:
Best Practices
Review before auto-apply
Run with
apply: false first to verify learning quality before enabling auto-injectionCurate your instructions
The best learnings should become permanent parts of your agent file
Use custom prompts
Tailor extraction to your domain with custom evaluation prompts
Share across agents
Use
file to point multiple agents at shared learnings