Quick Start
Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
persona | bool | True | Learn user preferences and profile |
insights | bool | True | Capture observations and learnings |
thread | bool | True | Maintain session/conversation context |
patterns | bool | False | Store reusable knowledge patterns |
decisions | bool | False | Log decision-making process |
feedback | bool | False | Capture outcome signals |
improvements | bool | False | Store self-improvement proposals |
scope | str | LearnScope | "private" | Visibility scope (private, shared) |
store_path | str | None | None | Custom path for learning storage |
backend | str | LearnBackend | "file" | Storage backend (file, sqlite, redis, mongodb) |
mode | str | LearnMode | "disabled" | Learning extraction mode (disabled, agentic) |
max_entries | int | 0 | Maximum entries per store. 0 = unbounded (default, existing behaviour unchanged). When the cap is exceeded, the store prunes least-used / oldest entries on the next write or prune() call. Evicted entries are archived to a .archive.json sidecar. |
retention_days | int | 0 | Soft expiry in days. 0 = no time-based pruning (default). Entries older than this with no recent use become eligible for pruning. |
Both
max_entries and retention_days default to 0 (unbounded). Existing agents are unaffected unless you explicitly set these values. There is no silent eviction — entries are only pruned when a cap is set.Bounded Retention
Retention limits keep long-running agents healthy without losing data — evicted entries are saved to a.archive.json sidecar file next to the store, so nothing is permanently lost.
How pruning works
| Trigger | When |
|---|---|
| On write | Automatically when max_entries > 0 and the cap is exceeded |
On prune() call | Manually, for one-off cleanup |
<store>.archive.json (e.g., persona.archive.json).
Manual pruning
Common Patterns
Pattern 1: Full Learning Profile
Pattern 2: Shared Team Learning
Pattern 3: Compliance-Ready Agent
Best Practices
Leave defaults for most agents
Leave defaults for most agents
Both
max_entries and retention_days default to 0 (unbounded). Unless your agent runs for months or handles compliance requirements, the defaults are fine. Stores only grow with actual interactions.Cap long-running gateway agents
Cap long-running gateway agents
For agents that run continuously and interact with many users, set
max_entries=1000 to keep store files small and search fast. The archive sidecar preserves evicted entries if you need to audit them.Use retention_days for compliance
Use retention_days for compliance
For compliance requirements (e.g., GDPR, data minimization), set
retention_days to automatically make old entries eligible for pruning. Pair with max_entries for proactive pruning on every write.Use Private Scope by Default
Use Private Scope by Default
Keep learnings private unless you explicitly need shared team knowledge. This protects user data.
Restoring from archive
Restoring from archive
Evicted entries are never hard-deleted. Find the
.archive.json sidecar (same directory as the store file) to recover them. The archive is append-only JSON.Related
Bounded Learning
User-flow guide: retention caps, archival, and the prune API
Agent Learn
Learn about the Agent Learn concept

