ddflow_memory
Store lessons and decisions, search or recall past context, and link related records so agents reuse prior knowledge instead of repeating mistakes.
Instructions
Lessons, memories, recall and record links. Set action; required arguments in brackets: lesson_verify, lesson_add(title), lesson_search(query), recall(query), similar(text), dupes, link(subject,relation,target), add(text), list, forget(id,reason).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Stable id you choose. Referenced by `supersedes`, by commit messages and by the reconstruction; a generated id cannot be cited in advance. | |
| all | No | Include forgotten memories, with why they were forgotten. | |
| how | No | How to apply or detect it. | |
| why | No | Why it is true / what went wrong. | |
| item | No | Only the pairs this record is in. | |
| kind | No | Comma-separated subset of the configured kinds to look in: bug,task,phase,lesson,decision,research,memory. Default: all of them. | |
| rule | No | The rule in full. | |
| tags | No | Comma-separated tags, e.g. 'gpu,machine'. | |
| text | No | The title or summary of the record you are about to file. | |
| floor | No | Minimum score to report (default: [dedupe].show_floor). | |
| globs | No | Comma-separated globs to scan for `pattern`. Default: every tracked file. | |
| limit | No | At most this many (default: all). | |
| query | No | Rank by relevance to this instead of by recency. | |
| title | No | The rule as a one-line statement. | |
| action | Yes | What to do; see the tool description for each action's arguments. | |
| reason | No | Why, recorded with the link. | |
| target | No | The record it is related to. | |
| pattern | No | A regex naming the mistake in CODE. Scans now and stores WHICH sites match, so `ddflow_lesson_verify` can name those that reappear. Prefer it to a remembered rule when mechanical: a count says 'worse', never 'which'. Refused if it does not compile. | |
| seen_in | No | Comma-separated item ids where this was hit. What makes a lesson checkable later instead of merely memorable. | |
| sources | No | Comma-separated subset: decisions,lessons,memories,research,bugs,items,prompts. Default: all. | |
| subject | No | The record being related (the duplicate, for a merge). | |
| summary | No | The lesson in ONE paragraph, for a reader who will not open the full rule. Rendered into docs/ddflow/LESSONS-SUMMARY.md. | |
| as_agent | No | Subagent name, this call only. | |
| relation | No | Answer to a 'possible duplicate' refusal: new | extends:ID | duplicate_of:ID | related:ID | merge_into:ID. Omit at first. | |
| max_chars | No | Total budget for the answer. The point of a budget is that recall is called at the START of work, where a long answer costs the context the work itself needs. | |
| open_only | No | Only pairs where both records are still live (the dedupe_sweep pass). | |
| check_only | No | Dry run: write nothing, return the `candidates`. | |
| supersedes | No | Comma-separated lesson ids this replaces. The old one is retired, not deleted: the corpus stops growing without losing what was once believed. |