Skip to content

Commit 1a89afd

Browse files
authored
feat(memory): Migrate DISCOVERIES.md references to Kuzu memory backend (#1961)
All CI checks passing. Migrates DISCOVERIES.md to Kuzu memory backend. - 114 lines discoveries.py adapter - 251 lines comprehensive tests (11 passing) - 14 documentation files updated - Graceful fallback when memory unavailable Closes #1959
1 parent 1c523c2 commit 1a89afd

File tree

16 files changed

+423
-46
lines changed

16 files changed

+423
-46
lines changed

.claude/agents/amplihack/core/reviewer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Fix: [Minimal solution]
146146
- Implement minimal solution
147147
- Add regression test
148148
- Document the issue
149-
- Update DISCOVERIES.md if novel
149+
- Store discovery in memory if novel
150150

151151
## Review Output Format
152152

@@ -324,7 +324,7 @@ gh pr comment 123 --body "LGTM! All issues addressed"
324324
- **Minimal changes**: Fix only what's broken
325325
- **Root cause**: Address the cause, not symptoms
326326
- **Add tests**: Prevent regression
327-
- **Document**: Update DISCOVERIES.md for novel issues
327+
- **Document**: Store discoveries in memory for novel issues
328328
- **Simplify**: Can the fix make things simpler?
329329
330330
## Remember

.claude/agents/amplihack/specialized/amplifier-cli-architect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ async def coordinate_agents(task: str) -> Dict:
440440
- **Workflow**: Map decisions to multi-step workflow
441441
- **Priorities**: Explicit requirements > implicit preferences > philosophy > defaults
442442
- **Execution**: Support parallel execution where decisions are independent
443-
- **Knowledge**: Update DISCOVERIES.md with learnings
443+
- **Knowledge**: Store learnings in memory via discoveries adapter
444444

445445
## Success Metrics
446446

.claude/agents/amplihack/specialized/fix-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Execute all 22 steps of DEFAULT_WORKFLOW:
200200

201201
**Step 21: Documentation Updates**
202202

203-
- Update DISCOVERIES.md if needed
203+
- Store discovery in memory if needed
204204
- Document fix pattern for future reference
205205
- Update related documentation
206206

.claude/agents/amplihack/workflows/amplihack-improvement-workflow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Redundancy Check:
145145
- [ ] No security warnings
146146
- [ ] No philosophy violations
147147
- [ ] Documentation updated
148-
- [ ] DISCOVERIES.md updated if novel
148+
- [ ] Discoveries stored in memory if novel
149149

150150
## Complexity Justification
151151

@@ -301,9 +301,9 @@ security_issues: [count]
301301
time_to_complete: [duration]
302302
```
303303
304-
### Update DISCOVERIES.md
304+
### Store Discoveries in Memory
305305
306-
When patterns emerge:
306+
When patterns emerge, use `store_discovery()` from `amplihack.memory.discoveries`:
307307

308308
```markdown
309309
## Improvement Pattern Discovered

.claude/skills/cascade-workflow/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ What's Missing:
261261
- Adjust timeouts based on success rates
262262
- Improve secondary approaches if frequently used
263263
- Update tertiary if inadequate
264-
- Document learnings in `.claude/context/DISCOVERIES.md`
264+
- Store learnings in memory using `store_discovery()` from `amplihack.memory.discoveries`
265265

266266
**Optimization Criteria:**
267267

.claude/skills/debate-workflow/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ Counter: [Additional evidence or reasoning]
349349
- Document full debate transcript
350350
- Include all perspective arguments
351351
- Record synthesis and final decision
352-
- Add to `.claude/context/DISCOVERIES.md`
352+
- Store in memory using `store_discovery()` from `amplihack.memory.discoveries`
353353
- Update relevant architecture docs
354354

355355
**Decision Record Template:**

.claude/skills/investigation-workflow/SKILL.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Verification: Examine reflection logs, trace message processing
250250

251251
**Tasks**:
252252

253-
- **Update .claude/context/DISCOVERIES.md** with key insights
253+
- **Store discoveries in memory** using `store_discovery()` from `amplihack.memory.discoveries`
254254
- **Update .claude/context/PATTERNS.md** if reusable patterns found
255255
- Create or update relevant documentation files
256256
- Add inline code comments for critical understanding
@@ -275,14 +275,14 @@ Verification: Examine reflection logs, trace message processing
275275

276276
**Success Criteria**:
277277

278-
- DISCOVERIES.md updated with investigation results
278+
- Discoveries stored in memory for future reference
279279
- Relevant documentation files updated
280280
- Knowledge is discoverable by future investigators
281281
- No information loss
282282

283283
**Deliverables**:
284284

285-
- Updated DISCOVERIES.md
285+
- Discoveries stored in memory
286286
- Updated PATTERNS.md (if applicable)
287287
- Updated project documentation
288288
- Optional: GitHub issues for improvements
@@ -294,7 +294,7 @@ Verification: Examine reflection logs, trace message processing
294294

295295
1. **Resume at Step 4** (Research and Design) with the knowledge gained from investigation
296296
2. **Or resume at Step 5** (Implement the Solution) if the investigation already provided clear design guidance
297-
3. **Use investigation findings** from DISCOVERIES.md and session logs to inform design decisions
297+
3. **Use investigation findings** from memory (via `get_recent_discoveries()`) and session logs to inform design decisions
298298

299299
**Example Hybrid Workflow**:
300300

@@ -304,7 +304,7 @@ User: "/ultrathink investigate how authentication works, then add OAuth support"
304304
Phase 1: Investigation
305305
→ Run INVESTIGATION_WORKFLOW.md (6 phases)
306306
→ Complete understanding of existing auth system
307-
Document findings in DISCOVERIES.md
307+
Store findings in memory via discoveries adapter
308308
309309
Phase 2: Development
310310
→ Transition to DEFAULT_WORKFLOW.md
@@ -407,7 +407,7 @@ Track these metrics to validate workflow effectiveness:
407407

408408
- **Message Count**: Target 30-40% reduction vs. ad-hoc (to be validated)
409409
- **Investigation Time**: Track time to completion
410-
- **Knowledge Reuse**: How often DISCOVERIES.md prevents repeat work
410+
- **Knowledge Reuse**: How often memory retrieval prevents repeat work
411411
- **Completeness**: Percentage of investigations with full documentation
412412
- **User Satisfaction**: Clear understanding achieved
413413

@@ -416,7 +416,7 @@ Track these metrics to validate workflow effectiveness:
416416
- **Scope first, explore second** - Define boundaries before diving in
417417
- **Parallel exploration is key** - Deploy multiple agents simultaneously in Phase 3
418418
- **Verify understanding** - Test your hypotheses in Phase 4
419-
- **Capture knowledge** - Always update DISCOVERIES.md in Phase 6
419+
- **Capture knowledge** - Always store discoveries in memory in Phase 6
420420
- **This workflow optimizes for understanding, not implementation**
421421

422422
When in doubt about investigation vs. development:

.claude/skills/knowledge-extractor/SKILL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version: 1.0.0
44
description: |
55
Extracts key learnings from conversations, debugging sessions, and failed attempts.
66
Use at session end or after solving complex problems to capture insights.
7-
Automatically suggests updates to: DISCOVERIES.md (learnings), PATTERNS.md (reusable solutions), new agent creation (repeated workflows).
8-
Ensures knowledge persists across sessions.
7+
Stores discoveries in memory (via amplihack.memory.discoveries), suggests PATTERNS.md updates, and recommends new agent creation.
8+
Ensures knowledge persists across sessions via Kuzu memory backend.
99
---
1010

1111
# Knowledge Extractor Skill
@@ -251,7 +251,7 @@ Extract and structure knowledge:
251251
Place knowledge in correct locations:
252252

253253
```
254-
DISCOVERIES.mdNew discovery at end of file
254+
MemoryStore discovery using store_discovery() from amplihack.memory.discoveries
255255
PATTERNS.md → New pattern in appropriate section
256256
Agent → Create in .claude/agents/amplihack/specialized/
257257
```
@@ -426,12 +426,12 @@ Before finalizing an extraction, verify:
426426

427427
## Integration with System
428428

429-
### DISCOVERIES.md Lifecycle
429+
### Discovery Memory Lifecycle
430430

431-
1. **Extraction**: Added to DISCOVERIES.md during session
432-
2. **Visibility**: Immediately available to all agents
433-
3. **Action**: Agents can reference when solving similar problems
434-
4. **Prevention**: Prevents repeating same mistakes
431+
1. **Extraction**: Stored in memory via `store_discovery()` during session
432+
2. **Visibility**: Retrieved by `get_recent_discoveries()` at session start
433+
3. **Action**: Agents can query memory when solving similar problems
434+
4. **Prevention**: Prevents repeating same mistakes across sessions
435435
5. **Evolution**: Updated when better solution found
436436

437437
### PATTERNS.md Lifecycle
@@ -455,7 +455,7 @@ Before finalizing an extraction, verify:
455455
### Impact 1: Prevent Wasted Debugging Time
456456

457457
**Without knowledge extraction**: Repeat same 45-minute debugging process
458-
**With extraction**: Reference DISCOVERIES.md, fix in 10 minutes
458+
**With extraction**: Retrieve from memory, fix in 10 minutes
459459

460460
### Impact 2: Faster Solution Discovery
461461

.claude/skills/n-version-workflow/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Selection Criteria Applied:
195195
- Document all N implementations generated
196196
- Explain selection rationale in detail
197197
- Capture insights from rejected versions
198-
- Update `.claude/context/DISCOVERIES.md` with patterns learned
198+
- Store patterns learned in memory using `store_discovery()` from `amplihack.memory.discoveries`
199199
- Include comparison matrix for future reference
200200
201201
## Trade-Offs

.claude/skills/philosophy-compliance-workflow/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ A successful philosophy review:
396396

397397
- `.claude/runtime/logs/<session>/philosophy_review_<timestamp>.md`
398398
- Link in commit message if fixes applied
399-
- Update `.claude/context/DISCOVERIES.md` with patterns learned
399+
- Store patterns learned in memory using `store_discovery()` from `amplihack.memory.discoveries`
400400

401401
## Remember
402402

0 commit comments

Comments
 (0)