The Agent That Trains Its Replacement: Inside icarus-plugin

Moving beyond simple RAG, this Hermes extension uses a local Markdown filesystem to help AI agents evaluate their own work and automatically fine-tune their cheaper successors.

7 min read • View on GitHub • More from esaradev

A large robotic arm meticulously assembling a smaller, identical robotic arm on a wooden workbench, symbolizing model distillation.
Icarus treats every task as potential training data, turning expensive parent models into automated teachers for smaller successors.

Self-memory and replacement models for Hermes agents. Remember your work. Train your replacement.

esaradev, Project Author/Maintainer · esaradev/icarus-plugin
Key Takeaways

Building Wings to Escape the API

Most AI agent memory systems are built to solve amnesia. They use vector databases and retrieval-augmented generation to ensure the agent remembers what happened yesterday. Icarus operates on a completely different, much more ambitious thesis. An agent should not just remember its work. It should use its successful workflows to generate the training data needed to make itself obsolete.

Hedcut portrait of esaradev

It is an automated model distillation pipeline disguised as a memory plugin. Icarus turns expensive parent model API calls into training data for cheaper, faster, fine-tuned replacement models using tools like fabric_eval and fabric_switch_model.

The self-distilling loop: turning standard agent workflows into structured training data.

The Database is Just Markdown

Icarus rejects opaque vector embeddings. The author built the "Fabric" as a local directory of Markdown files with YAML frontmatter. This creates a Directed Acyclic Graph of memories. Humans can natively browse and edit this graph using Obsidian, establishing a seamless human-in-the-loop verification process.

FeatureStandard RAG MemoryIcarus Protocol Memory
StorageOpaque Vector EmbeddingsPlaintext Markdown & YAML
Human AuditabilityRequires querying a DBNatively readable in Obsidian
Relational MappingNearest-neighbor proximityExplicit DAG (review_of, revises)
End GoalBetter prompt contextAutomated dataset generation
A close-up of a traditional metal filing cabinet drawer pulled open with runic tabs, where a plain typewritten paper file is being pulled out.
By treating the file system as an explicit graph, Icarus grounds the abstract concept of agent memory into a highly auditable, human-readable structure.

The Autonomous Observer

The elegance of Icarus lives in its hooks. Instead of relying on the LLM to remember to call a save tool, a background observer silently watches the agent in hooks.py.

It monitors token overlap to detect topic shifts, triggering automatic recall. It uses regex to scan assistant responses for successful outcomes, automatically flagging them for the training pipeline without distracting the agent with explicit tool schemas.

The End of the Goldfish Era

Contextualizing Icarus within the broader landscape of agent development reveals a shift. Simply doing work should automatically generate the data needed to make that work cheaper and faster in the future. We are moving from prompt engineering to automated model distillation.

A split scene showing loose papers flying into a pit on the left, and neatly pinned, interconnected papers on a corkboard on the right.
Standard context windows act as bottomless pits for valuable workflows. Icarus pins those workflows to a structured web, turning fleeting actions into permanent assets.