Skip to content

Cognee Database Migrations

Guides an agent through cognee's database migrations: auto-runs, checking and repairing migration state, and moving data.

Stars
33,002
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an AI coding agent how cognee, an open-source memory tool for AI apps, upgrades and repairs its own databases. It explains that two migration chains run automatically (relational table changes and graph/vector data rewrites), how to check their status with cognee-cli commands, how to recover when a failed migration blocks writes, and how to export, back up, or import memory data. It also lists rules for contributors, such as never hand-typing Alembic revision IDs.

Great for

  • Developers running cognee in production who need to upgrade, roll back, or repair a database
  • Contributors authoring a new Alembic schema revision or data migration in the cognee codebase
  • Teams moving a dataset between cognee instances or importing memory from Mem0, Zep, Letta or LangMem

Skip it if

  • Simple users who only call cognee's add and search functions; migrations run on their own and this skill is not needed (no reason to act on it)
  • Moving an entire deployment from one database backend to another: the skill states no tool exists for this, and attempting it manually risks data loss
  • Handling COGX archives that contain permissions.json: these include password hashes and must be treated as secrets, so sharing them carelessly is risky

Try asking

  • “Check the migration state of my cognee database and tell me if any dataset has a failed migration”
  • “Writes to my cognee dataset are blocked by a failed migration; help me find the error and repair it”
  • “Back up my cognee dataset to a COGX archive and restore it on another instance”
  • “Write a new Alembic revision for a schema change I made to the cognee users table”
Step-by-step guide: how to use Cognee Database MigrationsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    cognee-migrations.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip cognee-migrations.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip cognee-migrations.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Run cognee-cli current before any upgrade or downgrade to see the stamped revision and the last failure
  • Back up your database before running downgrade or stamp, since these rewrite data or stored revisions
  • Treat any COGX archive exported with include_permissions=True as a secret because it contains password hashes

What's inside

  • SKILL.md

Redistributed unmodified from topoteretes/cognee under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.