Cognee
Cognee is the open-source AI memory platform for agents. Give your AI agents persistent long-term memory across sessions with a self-hosted knowledge graph engine.
topoteretes · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add topoteretes/cogneeAbout this skill
name: cognee description: > Use this skill whenever the user asks about Cognee, AI memory, persistent agent memory, self-improving agents, agents learning from feednack, knowledge graphs, graph-based RAG, long-term memory for agents, short-term memory for agents, personalization, personas, temporal search, temporal knowledge graphs, ontology-based extraction, ontology grounding, feedback, Cypher search, natural-language graph search, chunk search, RAG search, cross-session memory, session feedback, feedback loops, session based memory, redis based memory, knowledge promotion. Also use when the user describes the workflow such as: "turn documents into a knowledge graph", "build memory from files", "search my graph", "extract entities and relations", "sync data into a graph", "update graph memory", "store memories for an agent", "help my agent learn over time", "visualize a knowledge graph built from documents", "let the agent learn", "adaptive agents", "personalized agents", "session based personalization", "find important ontologies", "find custom pydantic models", "isolate agentic behaviour", "add permission control to retrieval", "reduce context bloating".
Cognee
Use this skill for Cognee-specific Python API help and for mapping user goals to the right Cognee workflow.
When to apply this skill
Apply this skill whenever the user wants to do any of the following with Cognee:
- ingest text, files, URLs, repos, or datasets
- build or rebuild a knowledge graph
- search documents, chunks, summaries, triplets, or graph context
- choose a
SearchType - enrich an existing graph with
memify - define custom graph extraction models or
DataPointtypes - run custom task pipelines
- configure LLM, graph DB, vector DB, or storage settings
- tag and scope memory with
node_set/ NodeSets - build persistent memory for agents across sessions
- create feedback loops or self-improving agent workflows
- work with temporal extraction, ontologies, Cypher, or natural-language graph queries
- manage datasets, sessions, feedback, pruning, updates, or visualization
If the user’s intent is “store information in memory and query it later,” prefer Cognee’s core flow: add -> cognify -> search
Core workflow
import cognee
from cognee import SearchType
await cognee.add(
"Your text, file path, URL, or list of inputs",
dataset_name="main",
node_set=["default_memory"],
)
await cognee.cognify(datasets="main")
results = await cognee.search(
"What are the key insights?",
query_type=SearchType.GRAPH_COMPLETION,
datasets="main",
)
Default guidance
When helping with Cognee:
- Start with the simplest working path unless the user explicitly asks for advanced configuration.
- Prefer the standard workflow:
add(...)to ingestcognify(...)to build the graphsearch(...)to query it
- Treat Cognee APIs as async.
- Use
dataset_name/datasetsto keep work organized when the user has multiple sources. - Use
node_setwhen the user wants lightweight tagging, project scoping, per-user memory buckets, or subgraph filtering. - Recommend advanced features only when they match the task:
memify(...)for enriching an existing graphtemporal_cognify=Truefor time-aware extraction- custom graph models or
DataPointtypes for domain-specific extraction - custom pipelines for non-default task orchestration
- feedback loops for retrieval improvement
- visualization tools for graph inspection
Common tasks
Add data
Use cognee.add(...) for text, files, URLs, or mixed inputs.
await cognee.add("notes.md", dataset_name="research")
await cognee.add("https://example.com", dataset_name="research")
await cognee.add(["paper.pdf", "summary.txt"], dataset_name="research")
Use node_set when the user wants data grouped into logical memory buckets.
await cognee.add(
"Customer prefers concise weekly summaries and Slack delivery.",
dataset_name="customer_success",
node_set=["preferences", "customer_123", "weekly_reports"],
)
Build the graph
Use cognee.cognify(...) after ingestion.
await cognee.cognify(datasets="research")
Use these options when relevant:
await cognee.cognify(
datasets="research",
temporal_cognify=True,
chunk_size=1024,
custom_prompt="Extract companies, products, and partnerships.",
)
Search the graph
Use cognee.search(...) and pick the search mode that matches the request.
results = await cognee.search(
"What changed in Q1 2024?",
query_type=SearchType.TEMPORAL,
datasets="research",
top_k=10,
)
Scope search with NodeSets
Use NodeSets when the user wants to search only a subset of memory such as one project, one customer, one user, or one workflow.
results = await cognee.search(
query_text="What are this customer's reporting preferences?",
query_type=SearchType.GRAPH_COMPLETION,
datasets="customer_success",
node_name=["preferences", "customer_123"],
)
Enrich an existing graph
Use memify(...) when the user wants to improve or extend an already-built graph without restarting the full workflow.
await cognee.memify(dataset="research")
Create domain-specific structures
Use custom models when the user wants extraction shaped around a schema.
from typing import Any
from pydantic import SkipValidation
from cognee.infrastructure.engine import DataPoint
from cognee.tasks.storage import add_data_points
class ScientificPaper(DataPoint):
title: str
authors: list[str]
methodology: str
findings: list[str]
cites: SkipValidation[Any] = None
metadata: dict = {"index_fields": ["title", "findings"]}
paper = ScientificPaper(
title="Graph Memory for Agents",
authors=["A. Researcher"],
methodology="Knowledge graph + vector retrieval",
Read the complete source ↗