跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
数据与分析

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 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add topoteretes/cognee

技能说明


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 DataPoint types
  • 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:

  1. Start with the simplest working path unless the user explicitly asks for advanced configuration.
  2. Prefer the standard workflow:
    • add(...) to ingest
    • cognify(...) to build the graph
    • search(...) to query it
  3. Treat Cognee APIs as async.
  4. Use dataset_name / datasets to keep work organized when the user has multiple sources.
  5. Use node_set when the user wants lightweight tagging, project scoping, per-user memory buckets, or subgraph filtering.
  6. Recommend advanced features only when they match the task:
    • memify(...) for enriching an existing graph
    • temporal_cognify=True for time-aware extraction
    • custom graph models or DataPoint types 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",
    
阅读完整来源 ↗