Back to News Hub
🔗n8n Blog
June 26, 2026
AI Automation

Build Self-Improving Agent Skills with cognee and n8n

Overview

When a review run falls short, this workflow catches it and proposes a fix to the skill, then writes the improved instructions back once you approve the diff. This Verified Node Spotlight is a guest post written by Vasilije Marković, CEO and Founder, cognee. Claude Code and other agent skill files are easy to write and easier to neglect.

Key Takeaways

  • You create skills for code review, tests, migrations, API conventions, and at first everything works.

    The agent follows the instructions, the reviews come back useful, so you keep extending the library.

  • When a review run scores below a threshold, the workflow records the feedback, asks cognee to propose a rewrite, routes that proposal through an approval gate in n8n, and, only after approval, writes the change back to the skill, with a before/after diff you can inspect, post to Slack, or attach to a pull request.

    There are a few ways to run this: Pick the one that fits how you work.

  • If you self-host n8n, use your own cognee server to keep everything in-house.

    Building with the cognee SDK: This build calls the cognee Python SDK directly ( , , ) from a small runner, wired into n8n through Execute Command nodes.

  • Both paths can run fully on your own infrastructure using self-hosted n8n, a self-hosted cognee server, and a local LLM and embedding model.
  • What you will build The visual workflow takes a sub-threshold-scoring agent run and turns it into a reviewable, approvable update to a Markdown skill file.
Build Self-Improving Agent Skills with cognee and n8n

You create skills for code review, tests, migrations, API conventions, and at first everything works. The agent follows the instructions, the reviews come back useful, so you keep extending the library. Then the project moves on and the skill files don't.

A skill that was indispensable a few months ago is now missing a critical check - it never got updated, because manually auditing a growing pile of Markdown instruction files is exactly the kind of task nobody picks up under deadline pressure. This tutorial builds a maintenance loop for those skills. When a review run scores below a threshold, the workflow records the feedback, asks cognee to propose a rewrite, routes that proposal through an approval gate in n8n, and, only after approval, writes the change back to the skill, with a before/after diff you can inspect, post to Slack, or attach to a pull request.

There are a few ways to run this: Pick the one that fits how you work. Visual building in the n8n editor (start here): Every cognee step - ingest, review, propose, review the diff, apply - is an operation on the cognee verified node, and n8n handles the scoring, the approval gate, and the diff. No Python, no shell, no scripts to write: import the template, connect it to a cognee server, and run.

For more details please read the original article at n8n Blog.

Continue Learning

Originally published by n8n Blog
Read the original

Comments

Sign in to join the conversation