Skip to content
Skills Library
AI & agents · Tool integration

memory

/memory

Use when Codex should remember, recall, search, improve, or forget information using Cognee.

Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Use when Codex should remember, recall, search, improve, or forget information using Cognee.

Original author description

Use when Codex should remember, recall, search, improve, or forget information using Cognee.

How it works

  1. Rules
  2. Add And Build
  3. Recall And Search
  4. Improve Memory
  5. Forget
Original SKILL.md headings · 218 lines, 1,389 words
SKILL.md preview
---
name: memory
description: Use when Codex should remember, recall, search, improve, or forget information using Cognee.
---

# Cognee Memory

Use this skill when the user asks Codex to use Cognee as memory, add facts or
documents, search a knowledge graph, recall prior context, or improve existing
memory.

## Rules

- **Server first.** Every operation below goes to the running Cognee server over
  HTTP, through the plugin's own scripts. That is the authoritative path in both
  local and cloud mode.
- **`cognee-cli` is a last resort, not an alternative.** It is reachable only on a
  machine holding a cognee **source checkout**: `scripts/cognee-cli.sh` exits 64
  anywhere else, and in cloud mode the plugin's venv is never built at all. Use it
  only when the server is genuinely unreachable *and* that checkout exists. Unsure
  which mode you are in? `python3 "${CODEX_PLUGIN_ROOT}/scripts/doctor.py" --json`
  reports `mode`, `server_url` and `reachable` without importing cognee.
- **Empty CLI output is never proof of absence.** Ground-truth against the server
  before concluding anything (see *The server is the source of truth* below).
- Choose a clear dataset name with `-d` or `--dataset-name`; ask only if the dataset boundary is genuinely ambiguous.
- Do not ingest secrets, credentials, `.env` files, private keys, token dumps, or unrelated generated artifacts.
- Before destructive commands such as `forget`, `delete`, or `--everything`, get explicit user confirmation.

## Add And Build

**Server-first (one-step ingestion):**

```bash
${CODEX_PLUGIN_ROOT}/scripts/cognee-remember.sh "<text>" --node-set user_context
```

Use `--node-set project_docs` for project/code content, `--node-set agent_actions` for agent notes.

To store a **file** under its real filename (so code files ride the zero-LLM code path instead of being ingested as prose), pass `--file`:

```bash
${CODEX_PLUGIN_ROOT}/scripts/cognee-remember.sh --file src/payments.py --node-set project_docs
```

For a whole repository (cross-file calls/imports, impact analysis), use the **codebase** skill instead. The script POSTs directly to `/api/v1/remember`. A `{"ok": true}` response means the server accepted the data. An error response means the server rejected or failed the request — check `COGNEE_API_KEY` and server logs; do **not** re-run or conclude the data wasn't stored without confirming against the server.

**Background by default + eventual consistency**: the wrapper submits with `run_in_background=true` (so a large cognify never holds one request open past the cloud's ~10-min request ceiling). The POST returns once the work is **enqueued**, with `dataset_id` and `pipeline_run_id`; `status: "running"` means *submitted, not yet in the permanent graph*. The graph is queryable only after the cognify pipeline **completes**; until then a search will not find the new content.

By default the wrapper then waits a short, bounded time (`COGNEE_REMEMBER_WAIT_SECONDS`, default `8`) polling `/api/v1/datasets/status` and adds `"queryable": true|false` + `"wait_outcome"` to the result. `queryable: true` means it's now in the graph and an immediate recall will find it. If `queryable: false`, check `wait_outcome`: `"timeout"` means it's still processing (recall later — not an error), `"errored"` means the cognify failed (check server logs), `"unknown"` means completion couldn't be confirmed (e.g. an older server without the status route). Set `COGNEE_REMEMBER_WAIT_SECONDS=0` to skip the wait, or `COGNEE_REMEMBER_BACKGROUND=false` for a fully synchronous, immediately-queryable write (small content only — large content risks the request ceiling).

**Fallback only — server unreachable:**

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" remember <text-or-path> -d <dataset-name>
```

For staged work there is no HTTP equivalent, so it is available **only** with a
cognee source checkout. Prefer the one-step server path above; mention this
limitation rather than switching to the CLI when no checkout exists:

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" add <text-or-path> -d <dataset-name>
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" cognify -d <dataset-name>
```

For long processing:

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" remember <text-or-path> -d <dataset-name> --background
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" cognify -d <dataset-name> --background
```

## Recall And Search

**Server-first (authoritative) — use the wrapper:**

```bash
${CODEX_PLUGIN_ROOT}/scripts/cognee-search.sh "<question>" 10 --graph
```

It resolves the endpoint, the session and the API key the way the hooks do
(launch record → `COGNEE_API_KEY` → the auto-minted `api_key.json`), so it
authenticates correctly in **both** local and cloud mode. `--graph` is the default and may be
omitted; memory is read from the knowledge graph (and the code graph via `--code`)
only — the session cache is written, never searched.

An empty result from the server is authoritative — the server searched and found
nothing.

**Do not hand-roll the `curl` with `-H "X-Api-Key: ${COGNEE_API_KEY:-}"`.** In
local mode that variable is empty — the key is minted into
`~/.cognee-plugin/api_key.json` and never exported to your shell — so the request
401s and looks like a server problem when nothing is wrong. When you genuinely
need the raw endpoint (to pass `node_name`, say), resolve the credentials first,
in the **same** shell invocation:

```bash
eval "$(${CODEX_PLUGIN_ROOT}/scripts/cognee-forget.sh env)" && \
curl -s -X POST "${COGNEE_BASE_URL}/api/v1/recall" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: ${COGNEE_API_KEY}" \
  -d '{"query": "<question>", "top_k": 10, "only_context": true, "scope": ["graph"]}'
```

A `401` after that resolver means the key really is wrong for that server; a
`401` without it means nothing.

**Fallback only — server unreachable:**

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" recall "<question>" -d <dataset-name> -f pretty
```

These search modes have no HTTP equivalent, so they are available **only** with a
cognee source checkout. They are not a reason to leave the server path: if no
checkout exists, say the mode is unavailable and use the server search above.

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" search "<question>" -d <dataset-name> -t GRAPH_COMPLETION -f pretty
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" search "<exact passage or citation need>" -d <dataset-name> -t CHUNKS -k 10 -f pretty
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" search "<code question>" -d <dataset-name> -t CODE -k 10 -f pretty
```

### Not found in the active dataset? Offer another one

Search is scoped to this session's **active** dataset. When the server answers
with an authoritative empty list (or the per-prompt memory header injected an
"Other Cognee datasets you can search" block), the information may live in
another dataset the user can read. Do **not** switch datasets for that — a
switch retires the session. Offer a one-off search instead:

1. List the candidates (every readable dataset, the active one excluded;
   read-only datasets are searchable and included). Skip this when the hook's
   hint block already names them:

   ```bash
   python3 "${CODEX_PLUGIN_ROOT}/scripts/list-datasets.py" --others
   ```

   The JSON has `current` (`{name, id, ids}`) and `datasets`
   (`[{name, id, owner_id, current}]`).

2. Codex has no interactive picker outside plan mode, so present a **numbered
   list** of the dataset names and ask the user to reply with a number, a name,
   or "no". Only ask when the user is actually trying to recall something — an
   ordinary prompt with no memory match needs no picker.

3. Run the graph-only search on the chosen dataset **by UUID** (a name only
   resolves among datasets this identity owns), answer from it, and say which
   dataset the results came from:

   ```bash
   ${CODEX_PLUGIN_ROOT}/scripts/cognee-search.sh "<question>" 10 --graph --dataset-id <id>
   ```

   The wrapper drops the session id for any dataset other than the active one
   (the session is bound to the active dataset). The active dataset, the Cognee session and where writes
   go are untouched. If the user then wants that dataset for the rest of the
   session, use the **cognee-switch-datasets** skill.

### The server is the source of truth

`cognee-cli` is a thin client over the running Cognee server and can print **empty stdout even when content exists** (a serialization quirk). So:
- **Never conclude "not found" from an empty/clean CLI run.** Confirm against the server directly — this is authoritative.
- **Do not re-run the same CLI search to "retry."** One server answer is authoritative.
- Omit `-d <dataset>` to search **all** your datasets; restricting to one dataset can miss content that lives in another.

## Improve Memory

**Server-first (session → graph sync):**

```bash
python3 "${CODEX_PLUGIN_ROOT}/scripts/sync-session-to-graph.py"
```

**Fallback only — server unreachable:**

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" improve -d <dataset-name>
```

Bridge session feedback or Q&A into the graph:

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" improve -d <dataset-name> -s <session-id>
```

For targeted enrichment:

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" improve -d <dataset-name> --node-name <entity-name>
```

## Forget

When the user asks to forget or delete something from memory, follow the
**cognee-forget** skill — it walks the full guided flow: sync the live session,
find the dataset id, judge candidate documents by raw content (grouped by
session), confirm, then delete each match through the wrapper:

```bash
${CODEX_PLUGIN_ROOT}/scripts/cognee-forget.sh sync
${CODEX_PLUGIN_ROOT}/scripts/cognee-forget.sh datasets
${CODEX_PLUGIN_ROOT}/scripts/cognee-forget.sh data <dataset_id>
${CODEX_PLUGIN_ROOT}/scripts/cognee-forget.sh raw <dataset_id> <data_id>
${CODEX_PLUGIN_ROOT}/scripts/cognee-forget.sh forget <dataset_id> <data_id>
```

The wrapper always authenticates (env → `~/.cognee/.env` → the auto-minted
local `api_key.json`) and prints an `HTTP <status>` trailer per call. Deletion
is irreversible — use the narrowest scope possible and confirm first.

**Fallback only — server unreachable:**

```bash
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" forget --dataset <dataset-name> --data-id <data-uuid>
"${CODEX_PLUGIN_ROOT}/scripts/cognee-cli.sh" forget --dataset <dataset-name>
```

Avoid the CLI's `forget --everything` unless the user explicitly asks to delete
all Cognee data.

Versions

RepositoryScoreLicence
This page · topoteretes/cognee-integrations100Apache-2.0
rjmurillo/ai-agents100MIT
rjmurillo/ai-agents100MIT
topoteretes/cognee-integrations100Apache-2.0
topoteretes/cognee-integrations100Apache-2.0
thebtf/engram100MIT
stxrmik/antigravity-plus100MIT
boshu2/agentops100Apache-2.0
yonatangross/orchestkit100MIT

Database snapshot: 13.11.2026 · package version 32379598be16 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cognee-forget
    Forget data stored in Cognee memory. Use when the user asks to forget, delete, or remove something from memory (e.g. "forget what we talked about tennis", "delete that from memory"). Finds the documents in the current dataset whose raw content matches what the user wants forgotten and deletes them.
  • 100cognee-forget
    Forget data stored in Cognee memory. Use when the user asks to forget, delete, or remove something from memory (e.g. "forget what we talked about tennis", "delete that from memory"). Finds the documents in the current dataset whose raw content matches what the user wants forgotten and deletes them.
  • 90cognee:recall
    Use when the user says 'cognee recall', 'search memory', 'what do we know about', 'find related', or 'graph search'. Runs semantic, graph, and lexical search across the Cognee knowledge graph and injects results as agent context.
  • 90cognee:store
    Use when the user says 'cognee store', 'push to cognee', 'save to graph', 'remember this' or 'log this decision', or when session decisions must be stored. Writes entities, decisions and events over POST /api/v1/remember.
  • 100recall-memory
    Use Recall to retain user preferences and project facts across sessions, correct remembered facts, or inspect why a memory is believed. Applies when the user asks to remember, recall, correct, or forget something, or when relevant saved context is needed for the current task.
  • 100using-terse-memory
    Durable agent memory in the TERSE `memory` namespace - remember / forget / recall / durable notes / cross-session facts. Use when the user says remember, forget, don't forget, save this for later, what do you remember, keep track of everything, or when a preference, decision, or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.