Agent skill

Cognee CLI Memory Commands

by topoteretes in topoteretes/cognee

Drives cognee from the terminal with remember, recall, forget and improve memory commands, dataset and config management and database migrations.

Apache-2.0Auto-check: notesAgent Workflows

Install Cognee CLI Memory Commands

skills CLI
$ npx skills add topoteretes/cognee --skill cognee-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install topoteretes/cognee cognee-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/topoteretes/cognee.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/cognee-cli .claude/skills/cognee-cli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cognee-cli
GitHub stars
32k
Used in
1 other repo
Token cost
~2.2k tokens
SKILL.md length
766 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Drives cognee from the terminal with remember, recall, forget and improve memory commands, dataset and config management and database migrations.

  • Storing documents or text in cognee memory from the terminal
  • SKILL.md covers Core flow, Session memory and enrichment, Legacy / lower-level commands and Management, plus 2 more sections
  • Calls uv and python; needs LLM_API_KEY
  • Querying cognee memory with recall and choosing a search type

What it does

The skill covers cognee-cli, which ships with the cognee package and needs LLM_API_KEY configured as the SDK does. The memory commands are the main interface. Remember ingests text, files, folders or URLs and builds the graph in one step, with a dataset name option, a background mode and a --dry-run that estimates LLM token cost. Recall queries the graph with dataset, top-k and session filters, and forget removes data by dataset, dataset ID, data ID or everything.

It warns that forget --all deletes every dataset immediately and does not ask for confirmation, unlike the legacy delete --all, and that --memory-only drops the graph and vectors but keeps the raw files so the data can be rebuilt. Recall accepts 10 of the SDK's 20 search types through --query-type and defaults to HYBRID_COMPLETION, while the rest are SDK-only. Session entries are currently written from the SDK and not the CLI. Migration commands such as upgrade, downgrade and stamp are covered too.

When your agent uses it

  • Storing documents or text in cognee memory from the terminal
  • Querying cognee memory with recall and choosing a search type
  • Removing a dataset or its graph while keeping the raw files
  • Running cognee database migrations

Example prompts

  • “Remember everything in ./docs under a dataset called my_project.”
  • “Do a dry run of remembering ./notes first so I can see the token cost.”
  • “Recall what we know about the billing service, using graph completion.”
  • “Forget the my_project dataset but keep the raw files so I can rebuild it.”

Requirements

  • cognee installed, with cognee-cli available
  • LLM_API_KEY configured

What it can do on your machine

Read from SKILL.md and the folder at commit b57cca1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • LLM_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cognee CLI Memory Commands loads about 2.2k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 766 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:95
    y> <value>          # set + persist to ./.env in the cwd
  • NoteMentions a .env fileSKILL.md:148
    config set`/`config unset` write to the `.env` file in whatever directory
  • NoteMentions a .env fileSKILL.md:151
    - **Which `.env` actually wins is not always the cwd one.** At import, cognee
  • NoteMentions a .env fileSKILL.md:154
    checkout (`uv pip install -e .`) a `.env` at the repo root therefore shadows
  • NoteMentions a .env fileSKILL.md:155
    the `.env` in the directory you ran from — and because `override=True`, it
  • NoteMentions a .env fileSKILL.md:158
    ainst different settings, move the repo `.env` aside, or set
  • NoteMentions a .env fileSKILL.md:160
    `python -c` the cwd `.env` does win, because dotenv falls back to the cwd

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from topoteretes/cognee at commit b57cca1, republished under its Apache-2.0 licence (© topoteretes). 766 words, ~2,204 tokens.

Download SKILL.mdSave it as .claude/skills/cognee-cli/SKILL.md (or your agent's skills folder).
name
cognee-cli
description
Use when the user wants to drive cognee from the terminal with cognee-cli — remember/recall/forget/improve memory commands, managing datasets and config, or database migrations.

Use the cognee CLI

cognee-cli ships with the package (entry point in cognee/cli/_cognee.py; each command lives in cognee/cli/commands/). Every command has --help for its flags, but only a few (demo, memify, eval, serve, push, upgrade, downgrade, stamp, and search with one CODE example) include usage examples — for the memory commands use the examples in this file. Needs LLM_API_KEY configured, same as the SDK.

Core flow

The memory commands are the primary surface as of cognee 1.x:

bash
cognee-cli remember "Your text here"         # also accepts file paths / URLs
cognee-cli remember ./docs --dataset-name my_project
cognee-cli recall "Your question"            # query the graph
cognee-cli recall "keyword" --query-type CHUNKS
cognee-cli forget --all                      # wipe local state

remember is ingest + graph build in one step (add + cognify under the hood); --background/-b runs the cognify stage in the background, and --dry-run estimates LLM tokens/cost without ingesting. recall takes --datasets/-d, --top-k/-k (default 10), and --session-id/-s.

forget targets --dataset, --dataset-id, --data-id (needs a dataset), or --everything/--all — one unified command replacing the older delete and empty-dataset paths. --memory-only (with a dataset) drops the graph and vectors but keeps the raw files, so the data can be rebuilt.

forget --all does not ask for confirmation. It deletes every dataset immediately, even on a non-interactive stdin. The legacy delete --all prompts Delete ALL data from cognee? [y/N] first, so switching to forget silently drops that safety net — script it with care.

--query-type accepts 10 of the SDK's 20 SearchType values — the list in cognee/cli/config.py:SEARCH_TYPE_CHOICES: HYBRID_COMPLETION, GRAPH_COMPLETION, RAG_COMPLETION, CHUNKS, CHUNKS_LEXICAL, SUMMARIES, CODE, CYPHER, GRAPH_REPORT, SKILLS. The rest (TEMPORAL, TRIPLET_COMPLETION, GRAPH_COMPLETION_COT, AGENTIC_COMPLETION, NATURAL_LANGUAGE, …) are SDK-only, e.g. cognee.recall(q, query_type=SearchType.TEMPORAL).

When --query-type is omitted the CLI uses HYBRID_COMPLETION (DEFAULT_SEARCH_TYPE), whereas the SDK's cognee.recall() auto-routes between search types. --top-k defaults to 10 on the CLI and 15 in the SDK.

Session memory and enrichment

Session entries are currently written from the SDK — cognee.remember(..., session_id="chat_1") — not the CLI (cognee-cli remember has no session flag). The CLI side of session memory is reading and bridging:

bash
cognee-cli recall "question" -s chat_1       # session cache first: without -d/-t
                                             # this searches the session directly
cognee-cli sessions get                      # retrieve session Q&A history
cognee-cli improve -d my_project -s chat_1   # bridge session content into the graph
cognee-cli improve -d my_project             # enrich/index the graph (no session)
cognee-cli feedback ...                      # attach feedback to results

improve also takes --node-name, --feedback-alpha (learning rate in (0, 1]; default IMPROVE_FEEDBACK_ALPHA, 0.1), --build-global-context-index, --build-truth-subspace (both opt-in stages; the truth subspace needs -s), and --background/-b. It prints one line per stage — name, status (completed / already_completed / skipped / errored) and the skip reason (e.g. no_session_ids, lock_held, triplet_embedding_disabled). remember/improve build their graphs through cognify(), so cognify-level settings (e.g. CONTRADICTION_DETECTION=true) apply to them too.

Legacy / lower-level commands

add, cognify, search, memify, and delete still ship and are what the memory commands call underneath. Use them only to drive a single stage in isolation; prefer remember/recall/forget/improve otherwise.

bash
cognee-cli add "text" && cognee-cli cognify  # what `remember` does in one step
cognee-cli search "question"                 # `recall` minus routing/scope/session sources
cognee-cli memify -d my_project              # custom extraction/enrichment tasks
cognee-cli delete --all                      # superseded by `forget --all`

Management

bash
cognee-cli datasets list                     # dataset operations
cognee-cli config get [key] [--show-secrets] # view one/all settings (API keys masked by default)
cognee-cli config set <key> <value>          # set + persist to ./.env in the cwd
cognee-cli config unset <key>                # reset a key to its default (also persisted)
cognee-cli -ui                               # launch API server + UI (see cognee-server skill)
cognee-cli serve --url http://localhost:8000 # connect CLI/SDK to a running instance

Database migrations

cognee has two migration chains: the relational schema (Alembic, in cognee/alembic/) and the graph/vector data chain (slugs registered in cognee/modules/migrations/registry.py). Both run automatically — at API server startup and on the first write (remember, add, cognify, improve, …) in an SDK/CLI process — unless ENABLE_AUTO_MIGRATIONS=false. So you rarely need these commands; they are for inspecting state, disabled auto-migration, and rollbacks. There is no migrate command.

bash
cognee-cli current                    # stamped revision per database (per dataset
                                      # with access control on)
cognee-cli history                    # the data-migration chain, newest first
cognee-cli upgrade                    # relational to head, then data chain to head
cognee-cli upgrade <slug>             # data chain up to and including <slug>
cognee-cli upgrade --alembic <rev>    # pin the relational (Alembic) target
cognee-cli downgrade <slug|base>      # REWRITES DATA; revision is required,
                                      # prompts unless --force; --dataset <uuid>
                                      # (repeatable) limits it
cognee-cli stamp <head|base|slug>     # set the stored revision WITHOUT running
                                      # anything; prompts unless --force;
                                      # --dataset <uuid> (repeatable) limits it

The positional revision is always a data-chain slug; the relational target goes through --alembic. downgrade leaves the relational schema alone unless you pass --alembic. upgrade runs even when ENABLE_AUTO_MIGRATIONS=false. --alembic-path (or COGNEE_ALEMBIC_PATH) points at a custom Alembic scripts directory.

Show full SKILL.md (279 more words)Show less

Gotchas

  • The CLI initializes cognee lazily; the first command in a fresh environment is slow (DB + model setup), later ones are fast.
  • remember (and add) without --dataset-name targets the default dataset main_dataset; recall/search operate across your accessible datasets unless a dataset is given.
  • forget refuses to run bare — pass --dataset, --dataset-id, --data-id (with a dataset), or --everything/--all.
  • Session commands (recall -s, sessions get, improve -s) require CACHING=true (the default) — with it off, session reads return nothing and SDK session writes raise. To cut read latency and token cost while keeping session memory, cognee-cli config set AUTO_FEEDBACK false — by default cognee makes one structured-output LLM call per answered query to self-tune its memory.
  • memify requires one of the arguments -d/--dataset-name --dataset-id
  • config set/config unset write to the .env file in whatever directory you run the command from (creating it if missing). config reset (reset all keys) is still not implemented.
  • Which .env actually wins is not always the cwd one. At import, cognee calls dotenv.load_dotenv(override=True), which resolves relative to the cognee package location, not your working directory. In a source/editable checkout (uv pip install -e .) a .env at the repo root therefore shadows the .env in the directory you ran from — and because override=True, it also beats variables you exported. Symptom: config set appears to do nothing, or the CLI connects to a backend you thought you had overridden. To test against different settings, move the repo .env aside, or set values programmatically after import (cognee.config.set_*). (Under python -c the cwd .env does win, because dotenv falls back to the cwd when __main__ has no __file__ — which is why the same command can behave differently as a script vs. -c.)

© topoteretes, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/cognee-cli of topoteretes/cognee.

Open the folder on GitHubat commit b57cca1

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in topoteretes/cognee, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Cognee CLI Memory Commands next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cognee CLI Memory Commands compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cognee CLI Memory Commands this skilltopoteretes/cognee32k1 repos~2.2kAutomated safety check: NotesApache-2.0
Ogham Recallogham-mcp/ogham-mcp115—~1kAutomated safety check: PassMIT
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: PassApache-2.0
Using LWC Memory and Graphssickn33/agentic-awesome-skills47k1 repos~2kAutomated safety check: PassApache-2.0
Ogham Maintainogham-mcp/ogham-mcp115—~1.1kAutomated safety check: PassMIT
Memoryautomateyournetwork/netclaw675—~1.2kAutomated safety check: PassApache-2.0

Similar skills

  • Ogham Recall

    ogham-mcp/ogham-mcp

    Smart retrieval from Ogham shared memory. An agent skill from ogham-mcp/ogham-mcp.

    115 GitHub stars~1k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Adds structured long-term memory to OpenClaw agents, built automatically from sessions, with tools the agent calls to recall facts, summaries and decisions.

    17k GitHub stars~2k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check passed
  • Using LWC Memory and Graphs

    sickn33/agentic-awesome-skills

    Keeps project decisions, research and verified results available across coding-agent sessions through LWC memory, a document Wiki graph and a CodeGraph code index.

    47k GitHub starsUsed in 1 repo~2k tokens
    Agent WorkflowsAuto-check passed
  • Ogham Maintain

    ogham-mcp/ogham-mcp

    Admin and maintenance workflows for Ogham shared memory. An agent skill from ogham-mcp/ogham-mcp.

    115 GitHub stars~1.1k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Memory

    automateyournetwork/netclaw

    NetClaw's native persistent memory (spec 033) — structured facts with temporal validity, semantic search across past sessions, decision logging, and entity relationships, backed by SQLite + ChromaDB…

    675 GitHub stars~1.2k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Trusty Memory

    bobmatnyc/claude-mpm

    Persistent memory palace system with hierarchical storage (palace/wing/room/closet/drawer), progressive retrieval (L0-L3), and temporal knowledge graph for cross-session context

    155 GitHub stars~2k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed

More from topoteretes/cognee

All 19 skills in this repo
  • Cognee Docker Setup

    topoteretes/cognee

    Runs the Cognee AI memory platform in Docker, from a one-file prebuilt image to a full compose stack with UI, MCP server, Postgres and Neo4j.

    32k GitHub starsUsed in 1 repo~901 tokens
    Auto-check: notes
  • Install and Run Cognee

    topoteretes/cognee

    Installs the cognee AI memory library in a Python environment, sets the LLM key and gets a first remember and recall script running with the Python SDK.

    32k GitHub starsUsed in 1 repo~1k tokens
    Auto-check: notes
  • Cognee Community Packages

    topoteretes/cognee

    Guide to using and contributing cognee community packages: database adapters, data-source connectors, custom tasks and retrievers, and Keywords AI observability.

    32k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Cognee Custom Graph Models

    topoteretes/cognee

    Defines the shape of cognee's knowledge graph with graph_model: DataPoint node classes, identity and index fields, typed edges and fixes for duplicated nodes.

    32k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Cognee Custom Pipelines

    topoteretes/cognee

    Shows how to write custom cognee tasks, chain them into pipelines, store custom DataPoints and run enrichment over the existing graph.

    32k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Cognee Forget

    topoteretes/cognee

    Removes data from cognee memory with forget(), finding the right dataset and document first and choosing between one document, a dataset or only the graph and vector memory.

    32k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Questions about Cognee CLI Memory Commands

What does Cognee CLI Memory Commands do?

Drives cognee from the terminal with remember, recall, forget and improve memory commands, dataset and config management and database migrations. The skill covers cognee-cli, which ships with the cognee package and needs LLM_API_KEY configured as the SDK does. The memory commands are the main interface.

When should I use Cognee CLI Memory Commands?

Cognee CLI Memory Commands fits situations like: storing documents or text in cognee memory from the terminal; querying cognee memory with recall and choosing a search type; removing a dataset or its graph while keeping the raw files; running cognee database migrations.

How do I install Cognee CLI Memory Commands in Claude Code?

Run `npx skills add topoteretes/cognee --skill cognee-cli -a claude-code`. Or copy the skill folder (.agents/skills/cognee-cli in topoteretes/cognee) into .claude/skills/cognee-cli in your project. Claude Code loads it when a task matches its description.

How do I install Cognee CLI Memory Commands in Codex?

Run `npx skills add topoteretes/cognee --skill cognee-cli -a codex`. Or copy the skill folder (.agents/skills/cognee-cli in topoteretes/cognee) into .agents/skills/cognee-cli in your project. Codex loads it when a task matches its description.

Can I use Cognee CLI Memory Commands in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add topoteretes/cognee --skill cognee-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cognee-cli, .gemini/skills/cognee-cli, .github/skills/cognee-cli and .opencode/skills/cognee-cli in your project.

What does Cognee CLI Memory Commands need to run?

Going by SKILL.md and its folder, Cognee CLI Memory Commands needs the command-line tools its instructions call (uv and python) and credentials named LLM_API_KEY. Our summary lists: cognee installed, with cognee-cli available; LLM_API_KEY configured.

Does Cognee CLI Memory Commands access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Cognee CLI Memory Commands safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Cognee CLI Memory Commands use?

Cognee CLI Memory Commands is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cognee CLI Memory Commands use?

About 2.2k tokens (SKILL.md is roughly 8.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cognee CLI Memory Commands?

Skills that share tags, products or a category with Cognee CLI Memory Commands: Ogham Recall (ogham-mcp/ogham-mcp, 115 stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars), Using LWC Memory and Graphs (sickn33/agentic-awesome-skills, 47k stars) and Ogham Maintain (ogham-mcp/ogham-mcp, 115 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cognee CLI Memory Commands?

topoteretes (a GitHub organization) maintains it in topoteretes/cognee, which has 31,575 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 7, 2026.

Source: topoteretes/cognee on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.