reflection-injection

Inject relevant past reflections into agent context before new iterations.

175|26|Updated Aug 14, 2025
One-click install
npx skills add https://github.com/jmagly/aiwg --skill reflection-injection-jmagly
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reflection-injection
Source: https://github.com/jmagly/aiwg/tree/main/agentic/code/addons/ralph/skills/reflection-injection
Command: npx skills add https://github.com/jmagly/aiwg --skill reflection-injection-jmagly

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This skill prevents AI agents from repeating past errors by automatically injecting relevant lessons learned from previous iterations or similar past tasks into the current context.

Core Features & Use Cases

  • Episodic Memory Injection: Loads and injects past reflections into the agent's context before each new iteration.
  • Contextual Relevance Filtering: Filters reflections based on task type, error type, or file/module similarity to ensure only pertinent information is injected.
  • Use Case: When an agent fails to fix a bug, this skill ensures it doesn't make the same mistake again by reminding it of what went wrong and what was tried before.

Quick Start

Use the reflection-injection skill to apply past lessons learned to the current task.

Frequently Asked Questions about reflection-injection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop my AI agent from repeating past errors in iterative loops?

To stop an AI agent from repeating past errors, you can inject relevant past reflections into its context before each new iteration. This provides persistent, context-aware learning by filtering previous failures based on task similarity and error types.

How does contextual relevance filtering work for agent memory injection?

Contextual relevance filtering for agent memory injection works by matching past reflections against the current context using task type, error type, and file or module similarity. This ensures only pertinent lessons learned are loaded into the agent context.

What is the best way to implement self-correction in agentic loops?

The best way to implement self-correction in agentic loops is to use episodic memory injection. By loading and summarizing past experiences when retrying after errors, the agent receives the context needed to avoid previous mistakes and adjust its approach.

Do I need a specific framework to enable agent learning from previous iterations?

No specific framework is required to enable agent learning from previous iterations. The mechanism works by injecting filtered past reflections directly into the agent context, making it compatible with any agentic loop requiring memory and self-correction capabilities.

When should I use episodic memory injection in my agent workflow?

You should use episodic memory injection in your agent workflow specifically when starting new iterations or retrying after errors. It satisfies the need for persistent learning by summarizing past experiences to prevent the agent from making the same mistake again.