feat: Enhance memory management and promotion rules for Mattermost context and user prompts
This commit is contained in:
116
knowledge/agent-memory-rules.md
Normal file
116
knowledge/agent-memory-rules.md
Normal file
@@ -0,0 +1,116 @@
|
||||
# Agent Memory Rules
|
||||
|
||||
## Goal
|
||||
|
||||
Make workspace memory maintenance part of the agent's normal job, not a separate optional workflow.
|
||||
|
||||
---
|
||||
|
||||
## Default Agent Behavior
|
||||
|
||||
For any meaningful prompt, the agent should decide whether the interaction changes project memory.
|
||||
|
||||
This applies to:
|
||||
|
||||
- direct user prompts
|
||||
- Mattermost sync results
|
||||
- translated notes
|
||||
- standup generation
|
||||
- manager-update drafting
|
||||
- debugging discussions
|
||||
- corrections to previous understanding
|
||||
|
||||
The agent should not wait for a separate promotion command when the right update is already clear.
|
||||
|
||||
---
|
||||
|
||||
## What Counts As Memory-Worthy
|
||||
|
||||
Capture information automatically when it is:
|
||||
|
||||
- project-relevant
|
||||
- explicit enough to preserve safely
|
||||
- likely to matter in a future session
|
||||
- useful for standups, debugging, or supervisor communication
|
||||
|
||||
Examples:
|
||||
|
||||
- confirmed story creation, points, scope, or priority
|
||||
- confirmed reproduction constraints
|
||||
- newly clarified root cause framing
|
||||
- approved manager guidance that changes work direction
|
||||
- confirmed version, dependency, or rollout facts tied to current work
|
||||
- corrections to previously stored project context
|
||||
|
||||
---
|
||||
|
||||
## What The Agent Must Do
|
||||
|
||||
When new memory-worthy information appears, the agent should:
|
||||
|
||||
1. decide whether it is daily, current-state, durable, or decision-level context
|
||||
2. update the smallest correct set of files
|
||||
3. correct stale or conflicting existing statements
|
||||
4. answer the user using the refreshed context
|
||||
|
||||
Do not ask the user what to promote unless the ambiguity is real and material.
|
||||
|
||||
---
|
||||
|
||||
## File Selection
|
||||
|
||||
### `ai/logs/YYYY-MM-DD.md`
|
||||
|
||||
Default destination for:
|
||||
|
||||
- same-day progress
|
||||
- same-day findings
|
||||
- scoped reproduction notes
|
||||
- story and approval movement
|
||||
- context that is important now but may evolve later
|
||||
|
||||
### `ai/state/current.md`
|
||||
|
||||
Use when the fact changes the active work window, including:
|
||||
|
||||
- current priorities
|
||||
- currently active story scope
|
||||
- current blockers or debugging constraints
|
||||
- manager direction that changes the next few days of work
|
||||
|
||||
### `ai/context/project.md`
|
||||
|
||||
Use for durable project knowledge that should survive beyond the current work window.
|
||||
|
||||
### `ai/context/people/jeff.md`
|
||||
|
||||
Use only when a communication preference or manager expectation becomes stable enough to reuse repeatedly.
|
||||
|
||||
### `ai/context/decisions/*.md`
|
||||
|
||||
Use for explicit confirmed decisions with ongoing impact.
|
||||
|
||||
---
|
||||
|
||||
## What Not To Store
|
||||
|
||||
Do not store:
|
||||
|
||||
- tool failures
|
||||
- sync attempts
|
||||
- generic urgency messages
|
||||
- duplicate paraphrases of the same fact
|
||||
- weak guesses
|
||||
- operational chatter that does not change project understanding
|
||||
|
||||
---
|
||||
|
||||
## Correction Rule
|
||||
|
||||
If new information supersedes old memory:
|
||||
|
||||
- update the existing canonical file
|
||||
- do not leave stale and corrected versions side by side
|
||||
- preserve qualifiers if the fact is only partially confirmed
|
||||
|
||||
The agent should behave like a senior engineer maintaining project notes, not like a chat assistant accumulating transcripts.
|
||||
106
knowledge/memory-promotion-rules.md
Normal file
106
knowledge/memory-promotion-rules.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# Memory Promotion Rules
|
||||
|
||||
## Goal
|
||||
|
||||
Keep workspace memory current automatically without asking the user what to promote after every successful sync.
|
||||
|
||||
---
|
||||
|
||||
## Default Rule
|
||||
|
||||
When new Mattermost context is explicit, project-relevant, and high-confidence, promote it automatically.
|
||||
|
||||
Do not ask for promotion confirmation by default.
|
||||
|
||||
If a fact is ambiguous, skip it or keep it only in the daily log with appropriate qualifiers.
|
||||
|
||||
---
|
||||
|
||||
## File Selection
|
||||
|
||||
### Promote to `ai/logs/YYYY-MM-DD.md`
|
||||
|
||||
Use the daily log for:
|
||||
|
||||
- concrete same-day work updates
|
||||
- story creation, sizing, approval, and scope updates
|
||||
- manager-approved wording or root-cause framing tied to current work
|
||||
- confirmed version checks tied to active work
|
||||
- reproduction findings that are useful now but may still evolve
|
||||
|
||||
Daily logs are the default destination for most promoted Mattermost facts.
|
||||
|
||||
### Promote to `ai/state/current.md`
|
||||
|
||||
Use current state only for facts that materially affect active work over the next few days, such as:
|
||||
|
||||
- approved active story scope
|
||||
- confirmed current debugging constraints
|
||||
- current reproduction conditions that change how the work is approached
|
||||
- near-term priorities confirmed by manager communication
|
||||
|
||||
Do not copy every daily update into current state.
|
||||
|
||||
### Promote to `ai/context/project.md`
|
||||
|
||||
Use project context only for durable project knowledge that should survive beyond the current work window, such as:
|
||||
|
||||
- stable architecture constraints
|
||||
- recurring debugging truths
|
||||
- persistent testing limitations
|
||||
- enduring behavior of REST, GraphQL, XFlow, auth, or entry points
|
||||
|
||||
Do not promote story-specific daily movement into project context unless it changes durable project understanding.
|
||||
|
||||
### Promote to `ai/context/decisions/*.md`
|
||||
|
||||
Use decisions only for explicit confirmed decisions with medium or long-term impact.
|
||||
|
||||
---
|
||||
|
||||
## Do Not Promote
|
||||
|
||||
Do not record these as project memory:
|
||||
|
||||
- tooling activity
|
||||
- sync status
|
||||
- missing dependencies
|
||||
- empty inbox situations
|
||||
- reminders or urgency without project substance
|
||||
- unapproved drafts
|
||||
- generic chat noise
|
||||
|
||||
---
|
||||
|
||||
## Confidence Rules
|
||||
|
||||
Auto-promote when the signal is high-confidence, for example:
|
||||
|
||||
- Jeff explicitly approves something
|
||||
- a Jira story number, title, points, or scope is explicitly confirmed
|
||||
- a version is stated directly and tied to the active project
|
||||
- a reproduction condition is clearly stated with scope qualifiers
|
||||
|
||||
If confidence is mixed:
|
||||
|
||||
- prefer the daily log
|
||||
- preserve qualifiers such as "appears", "currently", or "for authenticated users"
|
||||
- avoid promoting to stable project context
|
||||
|
||||
---
|
||||
|
||||
## Example Policy
|
||||
|
||||
Given Mattermost updates like:
|
||||
|
||||
- PDIAP-15836 created and sized at 8 points
|
||||
- Jeff approved a story title
|
||||
- REST-removal scope was approved
|
||||
- XFlowViewMaker 0.5.0 is already in Fid4
|
||||
- AO DOB validation issue appears auth-only in TeenIdentityCheck
|
||||
|
||||
Automatic behavior should be:
|
||||
|
||||
- add all of them to today's log if they are relevant to today's work
|
||||
- promote only the currently actionable subset to `ai/state/current.md`
|
||||
- keep story-specific details out of `ai/context/project.md` unless they reveal a durable project rule
|
||||
Reference in New Issue
Block a user