cognee: Skill for Claude Code

.agents/skills/cognee-custom-graph-models/SKILL.md

cognee-custom-graph-models is a skill for Claude Code, Codex from topoteretes/cognee. It costs 74 tokens per session (2,404 once invoked), scanned A, original, Apache-2.0.

A guide to defining the types of things and relationships in a Cognee knowledge graph. A knowledge graph stores information as connected items, such as people, roles, and reporting relationships.

In plain words
What is it for?
Use it to define custom node and relationship classes, control how items are identified and merged, and build a graph model from a JSON schema.
Why use it?
It avoids relying on Cognee's generic graph shape when your application needs specific fields, links, or identity rules. It also helps explain duplicate nodes, missing links, and search behaviour.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is topoteretes/cognee's own configuration. It tells Claude Code and Codex how to work on cognee itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cognee configures →

About the project

Cognee is an AI memory platform that stores information in a self-hosted knowledge graph so agents can retain context across sessions. It ingests data, connects related information, and helps agents retrieve it for reasoning and actions. The catalogue includes skills and instructions that extend agent workflows around Cognee.

topoteretes/cognee · 33,094 stars · on GitHub · cognee.ai

Reuse

Borrowing it

Nothing to install: this file belongs to topoteretes/cognee. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/topoteretes/cognee/main/.agents/skills/cognee-custom-graph-models/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/topoteretes/cognee

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cognee-custom-graph-models

README.md
[![agentmods](https://agentmods.dev/badge/skills/topoteretes/cognee/cognee-custom-graph-models/github.svg)](https://agentmods.dev/skills/topoteretes/cognee/cognee-custom-graph-models)
Your own site
<a href="https://agentmods.dev/skills/topoteretes/cognee/cognee-custom-graph-models"><img src="https://agentmods.dev/badge/skills/topoteretes/cognee/cognee-custom-graph-models/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cognee-custom-graph-models

Your own site · 80×15
<a href="https://agentmods.dev/skills/topoteretes/cognee/cognee-custom-graph-models"><img src="https://agentmods.dev/badge/skills/topoteretes/cognee/cognee-custom-graph-models.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,404 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.02404
Opus 5.5 $0.00030 $0.00962
Sonnet 5.5 $0.00015 $0.00481
Haiku 4.5 $0.00007 $0.00240

Measured 21d ago against content hash d0c7267f20d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cognee-custom-graph-models scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/cognee-custom-graph-models/SKILL.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Custom graph models

By default cognee extracts a generic KnowledgeGraph of entities and relationships. Pass your own model with graph_model= and the LLM fills your node and edge types instead.

from typing import Annotated, Literal
import cognee
from cognee.low_level import DataPoint, Edge, FromIdentity


class Role(DataPoint):
    name: str
    metadata: dict = {"index_fields": ["name"], "identity_fields": ["name"]}


class Person(DataPoint):
    name: str
    is_a: Annotated[Role, FromIdentity()] | None = None  # reference by name
    reports_to: list[Edge["Person", "Person"]] = []  # edge owned by Person
    metadata: dict = {"index_fields": ["name"], "identity_fields": ["name"]}


class PeopleGraph(DataPoint):  # the root the LLM fills
    people: list[Person]
    friends_with: list[Edge[Person, Person]] = []
    family: list[Edge[Person, Person, Literal["married_to", "sibling_of"]]] = []
    metadata: dict = {"index_fields": [], "transparent": True}


await cognee.remember(text, graph_model=PeopleGraph, custom_prompt="Extract every person...")

Full example: examples/guides/custom_graph_model.py.

Use it

Nodes: DataPoint classes

Every node type subclasses DataPoint (from cognee.low_level import DataPoint). Its fields become:

  • Node properties: scalars, strings, dicts, and anything that is not a DataPoint.
  • Edges named after the field: a field holding a DataPoint or a list of DataPoints. members: list[Person] becomes members edges.

dict[str, Person], sets and plain tuples are stored as properties, not edges.

Identity and search: metadata

Key What it does
identity_fields The node id is derived from these field values (normalized: lowercased, spaces to _, apostrophes removed). The same entity from two chunks or two runs becomes one node.
index_fields Each field gets a vector collection named <ClassName>_<field>, so recall can find the node.
transparent The node is not stored; its children take its place. Use it for a root container like PeopleGraph.

Read the full file on GitHub · 202 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago Changed d0c7267f20d9
  2. 1mo ago First seen · 202 lines · 74 tokens per session scan A 42aa7c99300a

Subscribe to this mod's changes

cognee-custom-graph-models is a skill published in the GitHub repository topoteretes/cognee (33,094 stars, last pushed today), licensed Apache-2.0. It adds 74 tokens to every session and 2,404 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-30.

Related

cognee-custom-graph-models compared with skills from other repositories

cognee-custom-graph-models next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cognee-custom-graph-modelstopoteretes/cogneeSkill33ktodayApache-2.0A74Claude Code, Codex
openmemoryCaviraOSS/OpenMemorySkill4.6k19d agoApache-2.0A96Claude Code, Codex
yesmem-configcarsteneu/yesmemSkill463d agoApache-2.0A82Claude Code, Codex
goodmem:helpPAIR-Systems-Inc/goodmem-claude-code-pluginSkill92d agoMITA46Claude Code
memseek-remembermemseekai/memseekSkill11yesterdayApache-2.0A24Claude Code
memseek-explainmemseekai/memseekSkill11yesterdayApache-2.0A25Claude Code
memseek-searchmemseekai/memseekSkill11yesterdayApache-2.0A22Claude Code