Skip to main content
skill CX Codex

cognee:recall — Claude Code skill: knowledge graph search

cognee:recall is a Claude Code skill that searches a Cognee knowledge graph for entities, decisions, events and relationships. It uses semantic, graph-traversal and lexical search to add results to agent context.

MIT ★ 328 updated 2026-10-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add coco-research/coco --skill cognee:recall -a claude-code
Open on GitHub

What cognee:recall does

The skill runs search against a Cognee knowledge base using three strategies: semantic (by meaning), graph-based (by entity relationships) and lexical (by keywords). It returns decisions, tasks, entities and events with relevance scores, then formats them as context the agent can reference when reasoning about past decisions or module dependencies.

Three slash-commands inside: /cognee-recall:search for standard search, /cognee-recall:context to inject results into the system prompt, and /cognee-recall:graph to explore an entity's neighborhood in the graph. Search type is picked automatically (FEELING_LUCKY) or set manually — GRAPH_COMPLETION for queries like "who owns X", TEMPORAL for time-based lookups, CODING_RULES for code patterns.

Requires a running Cognee API instance, defaulting to http://localhost:8000. The address is set via the COGNEE_BASE_URL environment variable. Search can target one project dataset or span multiple — the skill fetches the list via /api/v1/datasets.

What it helps with

  • retrieve past architectural decisions on a topic
  • understand dependencies between modules and services
  • recall who owns a task or component
  • gather context from multiple projects before answering
  • map relationships around a specific entity

Example prompts for the agent

  • Search the knowledge graph for everything about authentication
  • Show connections for the Auth Service entity
  • Recall rate limiting decisions from all projects

How to install cognee:recall

1Skills CLI (Vercel)

npx skills add coco-research/coco --skill cognee:recall -a claude-code

2Manually: put the files in place

~/.claude/skills/cognee-recall/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cognee-recall/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cognee:recall

How to install cognee:recall in Claude Code?

Run npx skills add coco-research/coco --skill cognee-recall -a claude-code, then check ~/.claude/skills/cognee-recall/SKILL.md.

What does cognee:recall do?

The skill searches entities, decisions, tasks and events in a Cognee knowledge graph using semantic, graph-traversal and lexical search, then injects the results into agent context for decision-making.

What API does cognee:recall need?

It needs a running Cognee API instance, by default at http://localhost:8000. The address is set via the COGNEE_BASE_URL environment variable.

Source text

SKILL.md · MIT
---
name: cognee:recall
description: "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."
---

# /cognee-recall — Search & Recall from Knowledge Graph

Semantic, graph-traversal, and lexical search across Cognee's knowledge graph. Finds entities, decisions, events, and their relationships — then injects relevant results as agent context for informed decision-making.

## Quick Reference

```bash
COGNEE="${COGNEE_BASE_URL:-http://localhost:8000}"
DATASET="my-project"

# Semantic search (auto-selects best strategy)
curl -s -X POST "$COGNEE/api/v1/search" \
  -H "Content-Type: application/json" \
  -d '{"query": "authentication decisions", "datasets": ["my-project"], "search_type": "FEELING_LUCKY", "top_k": 10}' | jq .

# Graph completion search (relationship-aware)
curl -s -X POST "$COGNEE/api/v1/search" \
  -H "Content-Type: application/json" \
  -d '{"query": "who reports to Alice", "datasets": ["my-project"], "search_type": "GRAPH_COMPLETION", "top_k": 10}' | jq .

# Recall with context injection (adds system prompt)
curl -s -X POST "$COGNEE/api/v1/recall" \
  -H "Content-Type: application/json" \
  -d '{"query": "rate limiting", "datasets": ["my-project"], "top_k": 10, "only_context": true}' | jq .

# Cross-project search
curl -s -X POST "$COGNEE/api/v1/search" \
  -H "Content-Type: application/json" \
  -d '{"query": "auth decisions", "datasets": ["project-a", "project-b", "project-c"], "search_type": "FEELING_LUCKY"}' | jq .
```

## Search Types

Cognee supports multiple search strategies. Use `FEELING_LUCKY` for auto-selection (recommended), or specify one:

| Type | Best for |
|------|---------|
| `FEELING_LUCKY` | Auto-selects best strategy (default, recommended) |
| `GRAPH_COMPLETION` | Relationship-heavy queries ("who owns X", "what depends on Y") |
| `GRAPH_COMPLETION_COT` | Complex reasoning with chain-of-thought |
| `GRAPH_COMPLETION_CONTEXT_EXTENSION` | Expanding context around a node |
| `GRAPH_SUMMARY_COMPLETION` | Summarization of graph neighborhood |
| `RAG_COMPLETION` | Retrieval-augmented generation |
| `TRIPLET_COMPLETION` | Entity-relationship-entity patterns |
| `CHUNKS` | Raw chunk retrieval |
| `CHUNKS_LEXICAL` | Keyword/lexical matching |
| `SUMMARIES` | Pre-computed summaries |
| `NATURAL_LANGUAGE` | Free-form natural language queries |
| `TEMPORAL` | Time-based queries |
| `CODING_RULES` | Code-specific patterns |

## Sub-commands

### /cognee-recall search — Run a semantic/graph search

**Procedure:**

1. Ask the user what they're looking for (or use the provided query).
2. Determine the best search type based on the query:
   - Queries about relationships → `GRAPH_COMPLETION`
   - General "what do we know" → `FEELING_LUCKY`
   - Time-based ("last week", "in Q2") → `TEMPORAL` if available
   - Code-related → `CODING_RULES`
3. Detect which datasets to search:
   - Default: current project dataset
   - If user mentions another project: include its dataset
   - Use `/cognee status` to list available datasets
4. Execute search:

```bash
COGNEE="${COGNEE_BASE_URL:-http://localhost:8000}"

curl -s -X POST "$COGNEE/api/v1/search" \
  -H "Content-Type: application/json" \
  -d "{
    \"query\": \"$QUERY\",
    \"datasets\": $DATASETS_JSON,
    \"search_type\": \"$SEARCH_TYPE\",
    \"top_k\": $TOP_K
  }" | jq .
```

5. Present results:

```
COGNEE RECALL — "$QUERY"
==================================================
Found N results across M datasets

[1] DECISION: Use JWT for API auth (2026-06-30)
    Context: Stateless, works with existing infra
    Dataset: my-project | Score: 0.94

[2] ENTITY: Auth Service — depends_on → PlatformHub
    Description: Authentication and authorization service
    Dataset: my-project | Score: 0.87

[3] TASK: Set up JWT middleware (open, priority 1)
    Assigned to: Alice Chen
    Dataset: my-project | Score: 0.82

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

### /cognee-recall context — Inject results as agent context

Same as search, but formats results for direct injection into the agent's context window. Use this before making architectural decisions or when context from past sessions is needed.

**Procedure:**

1. Run search as above.
2. Format results as a compact context block:

```
[COGNEE CONTEXT INJECTION — {timestamp}]
Query: "{original_query}"
Dataset(s): {dataset_names}

Relevant knowledge:
• DECISION ({date}): {text} — {context} [relevance: {score}]
• ENTITY: {name} ({type}) — {description} [relevance: {score}]
• TASK: {text} ({status}) — assigned to {assignee} [relevance: {score}]
• EVENT: {title} ({date}, {type}) — {summary} [relevance: {score}]

Use this context to inform your response. Cite specific decisions and entities where relevant.
```

3. The agent then uses this context transparently in its reasoning.

### /cognee-recall graph — Explore entity neighborhood

Explore the graph around a specific entity to understand its relationships.

```bash
COGNEE="${COGNEE_BASE_URL:-http://localhost:8000}"

# First, get the dataset ID
DATASET_ID=$(curl -s "$COGNEE/api/v1/datasets" | jq -r '.[] | select(.name=="my-project") | .id')

# Get the full graph
curl -s "$COGNEE/api/v1/datasets/$DATASET_ID/graph" | jq .
```

Present as a relationship map:

```
ENTITY GRAPH — "Auth Service" (my-project)
==================================================
                      ┌──────────────────┐
                      │   Auth Service   │
                      │   (system)       │
                      └───┬──────────┬───┘
                          │          │
              depends_on  │          │ owns
                          │          │
                   ┌──────▼──┐  ┌───▼──────────┐
                   │Platform │  │ JWT Middleware│
                   │Hub      │  │ (module)      │
                   │(module) │  └───────────────┘
                   └─────────┘

Related decisions:
  • Use JWT for API auth (2026-06-30) — relates to Auth Service

Related tasks:
  • Set up JWT middleware (open) — assigned to Alice Chen
  • Update API docs (open) — assigned to unassigned
```

### /cognee-recall cross-project — Search across multiple projects

Search for related knowledge across all available datasets.

```bash
COGNEE="${COGNEE_BASE_URL:-http://localhost:8000}"

# Get all dataset names
DATASETS=$(curl -s "$COGNEE/api/v1/datasets" | jq -r '[.[].name] | join(",")')

# Cross-project search
curl -s -X POST "$COGNEE/api/v1/search" \
  -H "Content-Type: application/json" \
  -d "{
    \"query\": \"$QUERY\",
    \"datasets\": [$DATASETS_JSON],
    \"search_type\": \"FEELING_LUCKY\",
    \"top_k\": 15
  }" | jq .
```

Present results grouped by dataset:

```
CROSS-PROJECT RECALL — "$QUERY"
==================================================
Found N results across M datasets

my-project (5 results):
  [1] DECISION: Use JWT for API auth — 0.94
  [2] ENTITY: Auth Service — 0.87
  ...

e-and-c (3 results):
  [1] DECISION: Stakeholder role for external users — 0.91
  [2] ENTITY: External Review System — 0.84
  ...

optimize (2 results):
  [1] DECISION: Migration to pgvector — 0.78
  ...
```

## Behavior Rules

### Proactive recall triggers
Automatically run `/cognee-recall search` when:
- User asks "what do we know about X" or "what did we decide about Y"
- User starts a new task that references past work ("continue working on auth")
- User makes a decision that might conflict with past decisions
- Before architectural or design discussions that would benefit from context

### Relevance threshold
Only show results with relevance score > 0.5 by default. If fewer than 3 results exceed threshold, tell the user: "Only {N} low-relevance results found. Try a broader query."

### Context injection discipline
- Inject context **before** reasoning about a decision, not after.
- Cite specific decisions/entities from the graph in responses: "Based on the June 30 decision to use JWT for API auth [Cognee]..."
- Never fabricate — if the graph has no relevant data, say so.

### Session-aware recall
If Cognee supports sessions, tag recalls with a session ID for better multi-turn context:

```bash
SESSION_ID="coco-$(date +%s)"

curl -s -X POST "$COGNEE/api/v1/search" \
  -H "Content-Type: application/json" \
  -d "{
    \"query\": \"$QUERY\",
    \"datasets\": [\"$DATASET\"],
    \"search_type\": \"FEELING_LUCKY\",
    \"top_k\": 10
  }" | jq .
```

## Fallback Behavior

If Cognee is unreachable:
1. Check if Brain is available: look for `project_brain.db` in current or parent directories
2. If available: "Cognee is not running. Using Brain for this query instead." Run equivalent `/brain context --search "query"`
3. If neither available: "No memory backend available. Start Cognee with `cognee server start` or initialize Brain with `/brain init`."

## Prerequisites

Cognee must be running and the project dataset must exist (created via `/cognee init`).

```bash
# Verify
curl http://localhost:8000/health
curl http://localhost:8000/api/v1/datasets | jq '.[].name'
```

© coco-research · MIT · coco-research/coco

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set82

The whole set →
mcp-specialist mcp-specialist — a subagent for building and configuring MCP servers in Claude Code. Handles architecture design, transport layer implementation, tool and resource setup, and connection troubleshooting against the MCP 2025-06-18 spec. CX Codex ★ 328repo stars gradient-text-sweep gradient-text-sweep guides Claude Code in animating gradients inside text via background-clip: text and GSAP. Fits title card sweeps, karaoke word reveals, and hue crossfades. CX Codex +1 ★ 328repo stars ai-marketing-videos ai-marketing-videos is a Claude Code skill for product promos, ad creatives, and explainers using video and voice models. It combines scenes with a voice track. CX Codex +1 ★ 328repo stars fix A slash command for debugging: takes a bug report or failing test, traces the root cause, writes a regression test, and applies the fix. CX Codex +1 ★ 328repo stars browser-automation browser-automation enables agents to navigate URLs, fill web forms, interact with elements, and take screenshots. CX Codex +1 ★ 328repo stars workflow-routing The workflow-routing skill chooses between Superpowers and GSD based on project state and task scope. It runs before other skills or GSD commands when both systems are installed. CX Codex +1 ★ 328repo stars theme-crossfade-morph theme-crossfade-morph is a Claude Code rule for whole-scene theme changes: it re-skins the background, type, radii, icons and logos in about 0.3 s while one anchor element stays fixed. CX Codex +1 ★ 328repo stars clone-website clone-website replicates target web pages into a self-contained single-file HTML prototype without build tools. Handy when you need to inspect or recreate UI layouts quickly. CX Codex +1 ★ 328repo stars

Project sponsors

Companies that keep this analytics open