trw_learn
Persist engineering discoveries with context and tags to share knowledge across AI agents, preventing repeated mistakes.
Instructions
Persist a non-obvious discovery so future agents inherit the finding.
Use when:
You just found a root cause, gotcha, or durable pattern worth remembering.
Capture it the moment you validate an approach that prevents repeated mistakes.
You hit an architecture constraint that is not obvious from reading the code.
Only record learnings that:
prevent repeated mistakes,
change future implementation/debugging/review behavior,
are specific enough to recall later. Routine observations ("I read the file", "the test passed") degrade recall quality.
Required:
summary: one-line headline.
detail: full finding with context, symptoms, and why it matters.
Recommended:
tags: keywords for trw_recall filtering. Accepts a JSON list (
["a","b"]) OR a comma/whitespace-separated string ("a,b c").impact: 0.0-1.0; high values surface more often.
Advanced (auto-detected if omitted):
shard/source/client/model/type/domain/phase/team/protection metadata.
scope: write-tier override (PRD-CORE-185). "auto" (default) routes portable learnings to the machine-local user tier when a user-scope store is present, else the project tier; "project"/"user" force it. Most learnings need only summary and detail. Adding tags and impact improves recall precision. All other fields are auto-detected.
Output: LearnResultDict with {id: str, status: "saved"|"deduped"|"error", dedup_match?: dict, ceremony_hint?: str}.
See Also: trw_recall, trw_learn_update
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| type | No | pattern | |
| scope | No | auto | |
| detail | No | ||
| domain | No | ||
| impact | No | ||
| expires | No | ||
| summary | No | ||
| evidence | No | ||
| model_id | No | ||
| shard_id | No | ||
| task_type | No | ||
| assertions | No | ||
| confidence | No | unverified | |
| nudge_line | No | ||
| source_type | No | agent | |
| team_origin | No | ||
| phase_origin | No | ||
| client_profile | No | ||
| phase_affinity | No | ||
| protection_tier | No | normal | |
| source_identity | No | ||
| consolidated_from | No |