Logo vun Xskill Self Improving Object

Xskill Self Improving Object

Communautéit
AnthonyAlcaraz
xskill-self-improving-object

Turn execution traces into knowledge that improves without retraining. Two Ch7 primitives compose: XSkill dual-stream extraction distills EXPERIENCES (action-level: what worked or failed for one tool call) and SKILLS (task-level: a multistep pattern that solves a category of task) from the execution graph. Cognee then treats each skill as a graph OBJECT that observes its own executions, computes its success rate, and rewrites itself via amendify() when it degrades. Routing selects skills by demonstrated success on the task pattern, not by description similarity. Use to give an agent memory of past failures (experiences alone cut tool errors 29.9% to 16.3%) and skills that track a changing environment. NOT for a static agent that never re-runs similar tasks (no traces to learn from), NOT for the raw execution graph itself (use the execution-graph skill, which is the substrate this consumes).

Iwwersiicht

EditeurAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Skill-Nummxskill-self-improving-object
Stären
29
Forks
9
Matgeliwwert Fichieren
2
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum AnthonyAlcaraz op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Xskill Self Improving Object an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/self-evolution/xskill-self-improving-object
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills.git /tmp/agentic-graph-rag-skills
mkdir -p .claude/skills
cp -r /tmp/agentic-graph-rag-skills/skills/self-evolution/xskill-self-improving-object .claude/skills/xskill-self-improving-object
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Xskill Self Improving Object an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Xskill Self Improving Object automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Xskill Self Improving Object net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

XSkill Self-Improving Graph Objects

Overview

The improvement mechanisms earlier in Ch7 (prompt refinement, SEAL data generation, fine-tuning) all modify the agent itself. Knowledge augmentation is lighter: it accumulates knowledge from past executions and retrieves it at inference time, touching neither the model nor its prompts. The motivating measurement from the chapter: on the Kaggle GameArena chess benchmark, 78% of Gemini-2.5-Flash losses were illegal moves, rule violations rather than weak strategy. The agent kept repeating the same category of mistake because it had no memory of past failures.

XSkill (Jiang et al., 2026) extracts two complementary knowledge types from trajectories:

  • Experiences operate at the action level. Each execution node's input, action, and outcome becomes a candidate experience record. Experiences alone reduce tool errors from 29.9% to 16.3% (a 45% reduction).
  • Skills operate at the task level. The path from the root query node to a successful resolution node becomes a candidate multistep skill. Together with experiences, the average success rate rises from 33.6% to 40.3%.

Cognee closes the remaining gap: XSkill's skills are static artifacts. Cognee treats a skill as a first-class graph node (the SkillNode example) with execution records, a success rate, and an amendment history. Its four-stage pipeline is add (parse SKILL.md, compute content hash) then cognify (extract trigger phrases and complexity) then search (route by which skill SUCCEEDS at similar tasks) then learn (log an observation per execution). When a skill degrades, amendify() rewrites it against the last 10 failures, validates the amendment against held-out records, and rolls back on failure.

When to Use

  • After an agent has accumulated execution traces and you want it to stop repeating avoidable mistakes without retraining
  • Environments that drift (a Kubernetes API change, a new CI/CD stage) where a static SKILL.md silently goes stale
  • Routing among several overlapping skills where description similarity picks the wrong one and demonstrated success should decide
  • Building the self-evolution loop on top of the execution-graph substrate

Phrases: "learn from past failures", "self-improving skill", "amendify", "route by success rate", "XSkill", "Cognee", "knowledge retirement", "dual-stream extraction".

When NOT to Use

  • One-shot agents that never see similar tasks again. No trace stream, nothing to distill.
  • The raw execution graph itself. That is the execution-graph skill; this skill consumes its output.
  • As a substitute for evaluation. This distills and routes knowledge; it does not score answer quality (use the Ch7 evaluation layers for that).
  • When the environment is fixed and the skill has a stable high success rate. amendify() will not fire and the machinery is dead weight.

Process

StepInputActionOutputVerification
1Execution nodes (id, task_type, action, context, outcome, caused_task_failure, neighbors)lib.extract_experiences(nodes)One AgentExperience per diverged nodeRoutine successes skipped; count equals diverged-node count
2Successful executions (id, task_type, path, preconditions)lib.extract_skills(execs, min_support=3)AgentSkill per task_type with a shared pathNo skill emitted below min_support; steps equal the common path
3skill_id + definition dictSkillGraph.add(skill_id, definition)Registered SkillNode (version 1, content_hash set)Node present; content_hash reproducible from definition
4skill_idSkillGraph.cognify(skill_id)trigger_phrases + complexity + content_hashTrigger phrases non-empty; complexity scales with step count
5task dict (description, pattern)SkillGraph.route(task)Best SkillNode or NoneRanked by success_rate_for(pattern), NOT similarity
6skill_id + task + outcome (+error)SkillGraph.learn(skill_id, task, outcome, error)Observation appendedSkillNode.executions grows; success_rate recomputes
7failure_thresholdSkillNode.amendify(0.6)True if amended, else FalseFires only below threshold AND on validation; version + content_hash change
8experiences + now_dayslib.retire_experiences(exps, now_days, decay_days=90)Weight per experienceAge > 90 days halves the weight
9SkillNodeslib.flag_stale_skills(skills, recent=10, floor=0.6)Flagged skill_idsSub-60% skill over recent 10 attempts flagged

Rationalizations

Agent rationalizationDocumented rebuttal
"Route by description similarity, it is simpler."Ch7 is explicit that this is the core architectural choice: "the graph selects skills by demonstrated performance, not description similarity." A newly added canary-deployment skill with successful executions must outrank a general deployment skill with a 40% failure rate on canary-specific tasks. Similarity picks the wrong one.
"Extract an experience from every node."Only nodes whose outcome diverged from expectation carry a lesson (the KnowledgeAccumulator example filters on outcome_diverged_from_expectation). A routine success teaches nothing; extracting it dilutes retrieval with noise.
"Emit a skill from any successful run."The chapter requires >= 3 executions sharing a common successful path before a skill is real (the KnowledgeAccumulator example: len(executions) >= 3). One run is an anecdote, not a pattern.
"Skip retirement, more knowledge is better."Ch7 names knowledge retirement as the critical design choice: experiences not revalidated within 90 days lose half their retrieval weight, and skills below 60% success over the most recent 10 attempts are flagged. Unretired knowledge serves stale lessons after the environment has moved.
"Let amendify() rewrite the skill whenever it fails."Every amendment must validate against held-out execution records before replacing the current version, and failed amendments roll back automatically (the SkillGraph amendment example). Rewriting on raw failure count reintroduces reward-hacking: the skill confirms its own bias instead of correcting it.

Red Flags

  • route() returns the higher-similarity skill instead of the higher-success one. The ranking key the whole design depends on has been swapped back to similarity.
  • A skill's version keeps climbing but success_rate never recovers. amendify() is validating against the same failures it is fitting to; the held-out set is not actually held out.
  • extract_experiences returns one record per node. The divergence filter is off; retrieval will be flooded with routine successes.
  • extract_skills emits a skill from two executions. min_support is not being enforced; an anecdote is being sold as a pattern.
  • Experiences never lose weight. Retirement is not running; the agent serves 90-day-old lessons against a changed environment.
  • content_hash does not change after amendify(). The definition was not actually rewritten; change detection is broken.

Non-Negotiable Verification

  1. Run the benchmark battery. python cli.py benchmark must report all gates passing: extract_experiences yields one experience per diverged node; extract_skills needs >= min_support; success_rate computes correctly; amendify() fires only below 0.6 and bumps version + changes content_hash (and rolls back on validation failure); route ranks by success_rate not similarity (canary vs general); flag_stale_skills flags a sub-60% skill; retire_experiences half-weights a >90-day experience.
  2. Run the DevOps scenario. python cli.py scenario devops-skill shows the general deployment skill with higher description similarity losing the route to the canary-deployment skill on demonstrated success.
  3. Verify CLI help. python cli.py --help exits 0 and prints this SKILL.md description.

Security Posture

  • Prompt injection. Lessons, amendment text, and trigger phrases come from execution traces and skill definitions. When those originate from untrusted tool outputs or user-supplied definitions, treat every string field as untrusted until validated: a malicious error or context could bias an amendment or a lesson. The heuristic extractors here do no instruction following; the LLM seams marked # TODO(production) are where an author-verifier separation and input sanitization must be added.
  • Data exfiltration. lib.py makes no network calls and performs no shell invocation. It reads only the paths passed on the CLI and prints results to stdout; the caller owns any downstream piping.
  • Privilege escalation. No shell, no eval, no dynamic import of trace content, no file writes outside the explicit --path inputs. amendify() mutates only the in-memory skill definition; persistence is the caller's decision, and the content_hash makes any change auditable.

Composition

  • Consumes the execution-graph skill (Ch7 the execution-graph example): the nodes and successful subgraphs it extracts from are execution-graph output.
  • Composes with the Ch7 evaluation layers, which score the outcomes that become experience and skill success labels.
  • Pairs with the intervention router: knowledge augmentation ("what the agent remembers from doing") sits beside prompt refinement ("what the agent is told to do") and fine-tuning ("what the agent knows how to do"); the router selects among them by failure type.

Source Attribution

Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien) Chapter 7 — Self-Evolution and Evaluation, the Inference-Time Knowledge Augmentation section (the KnowledgeAccumulator dual-stream extraction) and the Skills as Self-Improving Graph Objects section (Example 7-22, SkillNode / SkillGraph with amendify() and success-rate routing). Named sources: XSkill (Jiang et al., 2026) for dual-stream continual learning and the 29.9% to 16.3% / 33.6% to 40.3% figures; Cognee for the add-cognify-search-learn skill-as-graph-object pipeline and the 90-day / 60%-over-10 retirement rules.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Xskill Self Improving Object?

Turn execution traces into knowledge that improves without retraining. Two Ch7 primitives compose: XSkill dual-stream extraction distills EXPERIENCES (action-level: what worked or failed for one tool call) and SKILLS (task-level: a multistep pattern that solves a category of task) from the execution graph. Cognee then treats each skill as a graph OBJECT that observes its own executions, computes its success rate, and rewrites itself via amendify() when it degrades. Routing selects skills by demonstrated success on the task pattern, not by description similarity. Use to give an agent memory...

Firwat Xskill Self Improving Object op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Xskill Self Improving Object besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Xskill Self Improving Object an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/self-evolution/xskill-self-improving-object an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Xskill Self Improving Object benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Xskill Self Improving Object benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Xskill Self Improving Object domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Xskill Self Improving Object gratis?

Jo. De Skill gëtt vum AnthonyAlcaraz ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇