Manage learned patterns. Patterns capture learnings from development — process improvements, technical discoveries, and architectural decisions.
Add a new pattern to memory.
Argument Description CONTENTPattern description (required )
Flag Short Description --context-cContext keywords (comma-separated) --type-tPattern type: codebase, process, architecture, technical. Default: process --from-fStory/session where learned --scope-sMemory scope: global, project, personal. Default: personal --memory-dir-mMemory directory path (overrides scope)
rai pattern add " HITL before commits " -c " git,workflow "
# Add a technical pattern with source
rai pattern add " Use capsys for stdout tests " -t technical -c " pytest,testing "
# Add with source reference
rai pattern add " BFS reuse across modules " -t architecture --from S2.3
Record a reinforcement signal for a pattern. Called at story-review to indicate whether a pattern was applied (1), not relevant (0), or contradicted (-1). Vote 0 (N/A) does not count toward the evaluation total.
Argument Description PATTERN_IDPattern ID to reinforce, e.g. PAT-E-183 (required )
Flag Short Description --vote-vVote: 1 (applied), 0 (N/A), -1 (contradicted) (required ) --from-fStory ID for traceability --scope-sMemory scope: global, project, personal. Default: project --memory-dir-mMemory directory path (overrides scope)
rai pattern reinforce PAT-E-183 --vote 1 --from RAISE-170
rai pattern reinforce PAT-E-151 --vote 0 --from RAISE-170
rai pattern reinforce PAT-E-094 --vote -1 --from RAISE-170
Promote a pattern from personal scope to project scope. Moves the pattern entry from personal patterns.jsonl to project patterns.jsonl. The pattern ID is preserved.
Argument Description PATTERN_IDPattern ID to promote, e.g. PAT-E-123 (required )
Flag Short Description --memory-dir-mMemory directory path (overrides default)
rai pattern promote PAT-E-123
See also: rai graph query , rai signal emit-work