Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .agent/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,27 @@ Cross-session SQLite FTS5 memory. Commands: `/remember {content}`, `/recall {que

**Full docs**: `memory/README.md`

### MANDATORY: Proactive Memory Triggers

**You MUST suggest `/remember` when you detect these patterns:**

| Trigger | Memory Type | Example |
|---------|-------------|---------|
| Solution found after debugging | `WORKING_SOLUTION` | "That fixed it! Want me to remember this?" |
| User states a preference | `USER_PREFERENCE` | "I'll remember you prefer tabs over spaces" |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example for USER_PREFERENCE ("I'll remember you prefer tabs over spaces") is a statement of action, whereas other examples are phrased as questions (e.g., "should I save it?", "want me to remember why?"). To maintain consistency with the other examples and the goal of suggesting an action to the user, it would be better to phrase this as a question as well.

Suggested change
| User states a preference | `USER_PREFERENCE` | "I'll remember you prefer tabs over spaces" |
| User states a preference | `USER_PREFERENCE` | "You prefer tabs over spaces. Should I remember that?" |

| Workaround discovered | `WORKING_SOLUTION` | "This workaround worked - should I save it?" |
| Failed approach identified | `FAILED_APPROACH` | "That didn't work - remember to avoid this?" |
| Architecture decision made | `DECISION` | "Good decision - want me to remember why?" |
| Tool configuration worked | `TOOL_CONFIG` | "That config worked - save for next time?" |

**Format**: After detecting a trigger, suggest:

```text
Want me to remember this? /remember {concise description}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This proactive /remember suggestion format differs from the “Required Response Format” in .agent/scripts/commands/remember.md, which can create conflicting agent instructions; consider standardizing on one template.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

```
Comment thread
coderabbitai[bot] marked this conversation as resolved.

**Do NOT wait for user to ask** - proactively offer to remember valuable learnings.

## Inter-Agent Mailbox

TOON-based async communication between parallel agent sessions.
Expand Down
69 changes: 60 additions & 9 deletions .agent/scripts/commands/remember.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,72 @@ AI: Storing memory:
1. Confirm 2. Change type 3. Edit 4. Cancel
```

## Auto-Remember Triggers
## Auto-Remember Triggers (MANDATORY)

AI assistants should proactively suggest `/remember` when:
AI assistants **MUST** proactively suggest `/remember` when detecting these patterns:

1. A solution is found after debugging
2. User explicitly states a preference
3. A workaround is discovered for a tool limitation
4. An architecture decision is made
5. A failed approach is identified
### Conversation Pattern Detection

| User Says | Trigger Type | Memory Type |
|-----------|--------------|-------------|
| "that fixed it", "it works now", "solved" | Solution found | `WORKING_SOLUTION` |
| "I prefer", "I like", "always use", "never use" | Preference stated | `USER_PREFERENCE` |
| "don't do X", "X doesn't work", "avoid X" | Failed approach | `FAILED_APPROACH` |
| "let's go with", "decided to", "we'll use" | Decision made | `DECISION` |
| "the trick is", "workaround", "hack" | Workaround found | `WORKING_SOLUTION` |
| "configure X as", "set X to", "X needs Y" | Tool config | `TOOL_CONFIG` |

### Required Response Format

When a trigger is detected, immediately offer:

```text
That worked! Want me to remember this for future sessions?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The first line of the required response format, "That worked!", is specific to a solution being found. However, the examples that follow correctly demonstrate that this opening phrase should be contextual (e.g., "Got it!", "Noted."). To avoid the agent using "That worked!" in inappropriate situations, consider making this line in the template more generic. "Got it." is a good, neutral alternative.

Suggested change
That worked! Want me to remember this for future sessions?
Got it. Want me to remember this for future sessions?


/remember {concise, actionable description}

(Reply 'y' to confirm, or edit the description)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prompt says to “Reply 'y' to confirm”, but the documented /remember confirmation flow above uses a numbered menu (1. Confirm, etc.), so this instruction may lead users to respond incorrectly.

Other Locations
  • .agent/scripts/commands/remember.md:148
  • .agent/scripts/commands/remember.md:158
  • .agent/scripts/commands/remember.md:168

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

```

### Examples

**After fixing a bug:**
```text
AI: That fixed it! Want me to remember this solution for future sessions?
/remember {suggested content}
User: Adding --legacy-peer-deps fixed the npm install
AI: That worked! Want me to remember this for future sessions?

/remember Use --legacy-peer-deps flag when npm install fails with peer dependency conflicts

(Reply 'y' to confirm, or edit the description)
```

**When user states preference:**
```text
User: I always use pnpm instead of npm
AI: Got it! Want me to remember this preference?

/remember User prefers pnpm over npm for package management

(Reply 'y' to confirm)
```

**After failed approach:**
```text
User: That approach with setTimeout didn't work at all
AI: Noted. Want me to remember to avoid this approach?

/remember Avoid using setTimeout for async coordination - use proper async/await or Promises instead

(Reply 'y' to confirm)
```
Comment on lines +151 to +169
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's an inconsistency in the examples regarding the user's ability to edit a memory. The "Required Response Format" (line 136) and the "After fixing a bug" example correctly include (Reply 'y' to confirm, or edit the description). However, the examples for user preferences (line 158) and failed approaches (line 168) omit the "or edit the description" part. For consistency and to ensure the user is always aware of all their options, this should be included in all examples.


### Do NOT Wait

- Do NOT wait for user to explicitly ask to remember
- Do NOT skip the suggestion if the learning seems minor
- DO suggest immediately when pattern is detected
- DO make the suggestion concise and actionable

## Storage Location

Memories are stored in SQLite with FTS5 for fast search:
Expand Down
27 changes: 23 additions & 4 deletions .agent/scripts/commands/session-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,41 @@ Verify aidevops best practices:
| TODO tracking | Tasks logged appropriately | Recommended |
| Quality checks | Linters run before commit | Recommended |

### Step 4: Identify Knowledge to Capture
### Step 4: Auto-Distill Session Learnings

Look for learnings that should be preserved:
**MANDATORY**: Run session distillation to automatically extract and store learnings:

```bash
~/.aidevops/agents/scripts/session-distill-helper.sh auto
```

This will:
1. Analyze git commits for patterns (fixes, features, refactors)
2. Extract learnings with appropriate types (ERROR_FIX, WORKING_SOLUTION, etc.)
3. Store them to memory automatically

### Step 5: Identify Additional Knowledge to Capture

After auto-distill, look for learnings that may have been missed:

1. **Corrections Made**: Did the AI make mistakes that were corrected?
2. **New Patterns**: Were new approaches discovered?
3. **Tool Issues**: Did any tools not work as expected?
4. **User Preferences**: Did the user express preferences?

For each learning, suggest where to document:
For each additional learning, suggest:

```text
/remember {concise description of learning}
```

Comment on lines +70 to +75
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add blank lines around the fenced block.

Codacy flags fenced blocks without blank lines before/after. Insert blank lines around the ```text block to keep the documentation lint-clean.

🧰 Tools
🪛 GitHub Check: Codacy Static Code Analysis

[notice] 71-71: .agent/scripts/commands/session-review.md#L71
Fenced code blocks should be surrounded by blank lines

🤖 Prompt for AI Agents
In @.agent/scripts/commands/session-review.md around lines 70 - 74, Add a blank
line before and after the fenced code block that starts with "```text" and
contains the "/remember {concise description of learning}" line in the session
review content; locate the fenced block (the ```text block and its inner line
"/remember {concise description of learning}") and insert one empty line above
the opening ```text and one empty line below the closing ``` to satisfy the lint
rule.

Or document in:
Comment on lines +70 to +76
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The structure here, with /remember followed by "Or document in:", is a bit ambiguous for an agent. It's not clear if /remember is the default and the list items are alternatives, or if the agent should choose. Clarifying this logic would lead to more consistent behavior. Consider rephrasing to indicate that /remember should be the primary suggestion, unless the learning is better suited for one of the other documentation forms.

For example, you could rephrase lines 70 and 75:

  • Line 70: For each additional learning, suggest capturing it with:
  • Line 75: If the learning is better suited for other forms of documentation (e.g., an agent improvement idea), suggest one of the following instead:

- Agent improvements → `@agent-review`
- Code patterns → Code comments or docs
- User preferences → `memory/` files
- Temporary workarounds → TODO.md

### Step 5: Session Health Assessment
### Step 6: Session Health Assessment

Determine recommendation:

Expand Down