aiwg
Version:
Cognitive architecture for AI-augmented software development with structured memory, ensemble validation, and closed-loop correction. FAIR-aligned artifacts, 84% cost reduction via human-in-the-loop, standards adopted by 100+ organizations.
70 lines (50 loc) • 2.28 kB
Markdown
Use this template to inject past reflections into agent context before each iteration.
```
You have attempted this task {{trial_count}} times. Here are your reflections:
{{
- **Outcome**: {{this.outcome}}
- **Reflection**: {{this.reflection}}
- **Strategy Change**: {{this.strategy_change}}
{{/each}}
Based on these reflections:
1. Do NOT repeat actions that previously failed
2. Apply the most recent strategy change
3. If you notice you are stuck in a loop (repeating the same approach), try a fundamentally different approach
4. After this iteration, reflect on what you learned
```
## Usage
The `reflection-injection` skill fills this template with:
- `trial_count`: Current iteration number
- `reflections`: Array of k=5 most recent reflections from `.aiwg/ralph/reflections/`
```
You have attempted this task 3 times. Here are your reflections:
- **Outcome**: failure
- **Reflection**: The login function throws when token is null. Need to add null check.
- **Strategy Change**: Add null check at function entry before processing token.
- **Outcome**: failure
- **Reflection**: Null check added but refresh token path also fails. Token refresh needs same guard.
- **Strategy Change**: Apply null checks to both access and refresh token paths.
- **Outcome**: partial
- **Reflection**: Both token paths now handle null but test expects specific error message format.
- **Strategy Change**: Match error message format to test expectations: "Token required" not "Invalid token".
Based on these reflections:
1. Do NOT repeat actions that previously failed
2. Apply the most recent strategy change
3. If you notice you are stuck in a loop (repeating the same approach), try a fundamentally different approach
4. After this iteration, reflect on what you learned
```
## References
- @agentic/code/addons/ralph/schemas/reflection-memory.json - Reflection schema
- @.aiwg/ralph/docs/reflection-memory-guide.md - Guide
- @.aiwg/research/findings/REF-021-reflexion.md - Research foundation