kdeps-memory-rules
v1.6.0kdeps memory-rules: rules
set memory / shelf memory
PurposeHow the agent's memory store files what it saves: entry types by key, the graph links between them, which tool results it captures, and what reads as done or resolved.
LLM context: none - kdeps uses it without sending it to the model
Where it runs
Part of the memory set, used in workflow and agent mode. How the agent's memory store files what it saves: entry types by key, the graph links between them, which tool results it captures, and what reads as done or resolved.
- the agent saves a memory or a tool returns
- kdeps types the entry by its key and links it to its parent type
- the tool is in capture_toolsmemory/rules
- its result is captured
- the memory block flags open errors and resumes from unfinished work
Loaded by: kdeps (agent loop), kdeps new, kdeps run, kdeps install, kdeps list, kdeps uninstall, kdeps update, kdeps upgrade
In the code: kdeps (agent loop)agent.UseProjectAssetsagent.initMemoryRules
Install
A kdeps asset: installed with the first-run profile that includes its set, or the first time a command needs it, and updated without a new release.
Pin a version with kdeps install memory/rules@<version>.
Contents
- default_type
- note
- focus_min_stem
- 3
- search_min_word
- 2
types:
- prefix: "tool:"
type: tool_result
- prefix: "thinking:"
type: thinking
- equals: last_action
type: action
- equals: last_files
type: file
- contains:
- prompt
- goal
- task
type: prompt
- contains:
- purpose
- why
- reason
type: purpose
- contains:
- progress
- wip
- in_progress
type: progress
- contains:
- status
- state
type: status
- contains:
- decision
- decided
type: decision
- contains:
- preference
- prefer
- like
type: preference
- contains:
- error
- fail
- bug
type: error
- contains:
- file
- path
- dir
type: file
- contains:
- context
- env
- config
type: context
- contains:
- result
- output
- done
type: result
parents:
purpose: prompt
progress: result
tool_result: progress
result: tool_result
action: tool_result
status: result
file: result
decision: result
error: tool_result
context: prompt
preference: prompt
fact: result
note: result
capture_tools:
- write_file
- edit_file
- bash_exec
- read_file
- search_local
- sql_query
- http_request
- web_search
- web_scraper
- wikipedia
resume:
- progress
- status
- result
low_signal:
- note
- fact
status_done:
not:
- not done
- not complete
- not finished
- incomplete
- unfinished
- in progress
- in-progress
- pending
- todo
- to do
- wip
- blocked
- failed
markers:
- done
- complete
- finished
- success
- shipped
- merged
- cancelled
- canceled
- abandoned
- wontfix
- won't fix
error_resolved:
not:
- reopened
- not fixed
- not resolved
- still failing
- still broken
- regressed
markers:
- resolved
- fixed
- closed
- no longer
- not an issue
- works now
- wontfix
- won't fix
- cancelled
- canceled
- abandoned
reply_capture:
action_verbs:
- Added
- Fixed
- Changed
- Updated
- Created
- Removed
- Deleted
- Set
- Configured
- Installed
- Built
- Deployed
- Refactored
- Migrated
- Patched
- Resolved
action_min: 5
action_max: 200
file_verbs:
- Edited
- Modified
- Created
- Read
- Wrote
tool_line: ^(tool:[a-z_]+):\s*(.+)$
key_value_line: ^([A-Z][A-Z_]{2,40}):\s*(.+)$
line_value_max: 500
focus_stopwords:
- this
- that
- with
- from
- have
- what
- when
- where
- which
- would
- could
- should
- about
- your
- please
- into
- then
- the
- and
- for
- are
- was
- you
- can
- how
- why
- who
- has
- had
- but
- not
- its
- out
- all
- any
- one
- two
- now
- see
- off
- per
- via
- let
- did
- our
- yes
- too
focus_weights:
key_weight: 2
structural_bonus: 1
version: 1.6.0
# How the agent's memory store files what it saves: the type it gives an
# entry, the entry it links each to, which tool results it captures, and
# what it reads as a finished status or a resolved error.
# An entry's type, from its key. The first rule that matches wins; an entry
# no rule matches is a note.
types:
- {prefix: "tool:", type: tool_result}
- {prefix: "thinking:", type: thinking}
- {equals: last_action, type: action}
- {equals: last_files, type: file}
- {contains: [prompt, goal, task], type: prompt}
- {contains: [purpose, why, reason], type: purpose}
- {contains: [progress, wip, in_progress], type: progress}
- {contains: [status, state], type: status}
- {contains: [decision, decided], type: decision}
- {contains: [preference, prefer, like], type: preference}
- {contains: [error, fail, bug], type: error}
- {contains: [file, path, dir], type: file}
- {contains: [context, env, config], type: context}
- {contains: [result, output, done], type: result}
default_type: note
# A new entry links to the newest entry of its parent type (else the newest
# entry): the graph the model sees in its memory block. prompt is the root.
parents:
purpose: prompt
progress: result
tool_result: progress
result: tool_result
action: tool_result
status: result
file: result
decision: result
error: tool_result
context: prompt
preference: prompt
fact: result
note: result
# Tools whose results are captured into memory automatically.
capture_tools:
- write_file
- edit_file
- bash_exec
- read_file
- search_local
- sql_query
- http_request
- web_search
- web_scraper
- wikipedia
# The entry types a resumed session picks up from, best first; a status that
# reads as done is skipped.
resume: [progress, status, result]
# The low-signal types: entries of these types beyond memory-low-signal-limit
# (an event) are pruned, oldest first. Other types are never pruned by it.
low_signal: [note, fact]
# A status is done when it has one of markers and none of not. A marker with
# a space, hyphen or apostrophe matches as text; a short one (3 letters or
# fewer) as a whole word; a longer one as a word prefix.
status_done:
not: [not done, not complete, not finished, incomplete, unfinished, in progress, in-progress, pending, todo, to do, wip, blocked, failed]
markers: [done, complete, finished, success, shipped, merged, cancelled, canceled, abandoned, wontfix, "won't fix"]
# An error is resolved the same way: the newest unresolved one is flagged in
# the memory block.
error_resolved:
not: [reopened, not fixed, not resolved, still failing, still broken, regressed]
markers: [resolved, fixed, closed, no longer, not an issue, works now, wontfix, "won't fix", cancelled, canceled, abandoned]
# What the store reads from the model's reply, besides [MEMORY:] markers.
reply_capture:
# A line starting with one of these verbs (any case) records the rest of the
# line as last_action, when it is action_min to action_max characters long.
action_verbs: [Added, Fixed, Changed, Updated, Created, Removed, Deleted, Set, Configured, Installed,
Built, Deployed, Refactored, Migrated, Patched, Resolved]
action_min: 5
action_max: 200
# "<verb> [file] path" records the paths as last_files; these match as written.
file_verbs: [Edited, Modified, Created, Read, Wrote]
# Whole lines of the reply saved as entries, each a regular expression with
# two groups, the key and the value, matched per line. A value longer than
# line_value_max characters is not saved. key_value_line keys are lower-cased.
tool_line: '^(tool:[a-z_]+):\s*(.+)$'
key_value_line: '^([A-Z][A-Z_]{2,40}):\s*(.+)$'
line_value_max: 500
# Prompt words that say nothing about what to recall: ignored when a prompt is
# matched to memory (memory-focus-min-word sets the shortest word that counts).
# A word of at least focus_min_stem letters once its ending (-ing, -ed, -s) is
# removed is matched by that stem, so "billing" finds "bills".
focus_min_stem: 3
focus_stopwords: [this, that, with, from, have, what, when, where, which, would, could, should, about, your,
please, into, then, the, and, for, are, was, you, can, how, why, who, has, had, but, not, its, out, all,
any, one, two, now, see, off, per, via, let, did, our, "yes", too]
# How an entry is ranked against the prompt for the memory block: a prompt word
# found in the key scores key_weight, one found only in the value scores 1, and
# a match on a type outside low_signal adds structural_bonus.
focus_weights:
key_weight: 2
structural_bonus: 1
# memory_search drops the extra words of a many-word query shorter than this
# many characters; a one-character word matches almost every entry.
search_min_word: 2
Versions
| Version | Published | Status | Source |
|---|---|---|---|
| 1.5.0 | 11/21/2026 | active | GitHub v1.5.0 |
| 1.0.0 | 11/21/2026 | active | GitHub v1.0.0 |
| 1.1.0 | 11/21/2026 | active | GitHub v1.1.0 |
| 1.2.0 | 11/21/2026 | active | GitHub v1.2.0 |
| 1.3.0 | 11/21/2026 | active | GitHub v1.3.0 |
| 1.4.0 | 11/21/2026 | active | GitHub v1.4.0 |
| 1.6.0 | 11/21/2026 | active | GitHub v1.6.0 |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 1.6.0
- Published
- 11/21/2026