Token导航 LogoToken导航

Agent Skill · 研究检索

cognee(cognee 搜索)

cognee 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cognee 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 43,453。

总安装 984周安装 41GitHub Stars 3下载 328核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cognee(cognee 搜索)
来源仓库:https://github.com/armelhbobdad/oh-my-skills
仓库路径:skills/cognee
安装命令:
npx skills add https://github.com/armelhbobdad/oh-my-skills --skill cognee
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/armelhbobdad/oh-my-skills --skill cognee

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

cognee 是一个开源 Python AI 内存引擎,将原始数据转换为可搜索的知识图谱。适用于在 Codex、Claude、Cursor、Gemini CLI 中进行信息检索、向量与图数据库联合查询。支持异步处理、自动去重与元数据管理,提供 22 个公共 API 导出。

使用时需设置 LYZR_API_KEY 环境变量,并通过 asyncio 调用 cognee.prune 清理状态。涉及数据持久化和外部 API 访问时,应确认权限范围与系统稳定性。

来源仓库内路径:skills/cognee

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/armelhbobdad/oh-my-skills --skill cognee;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cognee 怎么安装?

在终端执行 npx skills add https://github.com/armelhbobdad/oh-my-skills --skill cognee。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cognee 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cognee 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

cognee 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

cognee 用的人多吗?

公开数据是累计安装 984 次,近一周安装 41 次,下载 328 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cognee 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
cognee

cognee 搜索 · 本页

9843接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Overview

Cognee v0.5.5 — open-source Python AI memory engine that converts raw data into searchable knowledge graphs combining vector search with graph databases.

  • Source: topoteretes/cognee @ main
  • Language: Python (async/await throughout)
  • Forge tier: Deep (AST + gh + QMD)
  • Public API exports: 22 | Total extracted: 837 (302 functions, 535 classes)
  • Confidence: 837 T1 (AST-verified), 14 T2 (QMD-enriched), T3 (docs supplemental)

Quick Start

import cognee
import asyncio

async def main():
    # Reset state
    await cognee.prune.prune_data()
    await cognee.prune.prune_system(metadata=True)

    # 1. Ingest data
    await cognee.add("Cognee turns documents into AI memory.")  # [AST:cognee/api/v1/add/add.py:L22]

    # 2. Build knowledge graph
    await cognee.cognify()  # [AST:cognee/api/v1/cognify/cognify.py:L47]

    # 3. Search
    results = await cognee.search(  # [AST:cognee/api/v1/search/search.py:L26]
        query_text="What does Cognee do?"
    )
    for r in results:
        print(r)

asyncio.run(main())

All core functions are async — must use await inside an async context. [EXT:docs.cognee.ai/getting-started/quickstart]

Setup Requirements

Python: >=3.10, <3.14. Recommended installer: uv.

uv pip install -e "."                    # minimal (SQLite + LanceDB + Kuzu)
uv pip install -e ".[postgres,neo4j]"    # with PostgreSQL + Neo4j

Key installation extras: postgres / postgres-binary, neo4j, neptune, chromadb, qdrant, redis, ollama, anthropic, gemini, mistral, groq, huggingface, llama-cpp, aws (S3), langchain, llama-index, graphiti, baml, dlt, docling, codegraph, scraping, docs, monitoring (Sentry+Langfuse), distributed (Modal), dev, debug.

Minimal.env:

LLM_API_KEY="your_openai_api_key"
LLM_MODEL="openai/gpt-4o-mini"

Defaults (no extra setup): SQLite (relational), LanceDB (vector), Kuzu (graph). All stored in .venv by default — override with DATA_ROOT_DIRECTORY and SYSTEM_ROOT_DIRECTORY.

Important: If you configure only LLM or only embeddings, the other defaults to OpenAI. Always configure both, or ensure a valid OpenAI API key.

Common Workflows

Add and process data: await cognee.add(data) → await cognee.cognify() → await cognee.search(query_text)

Multi-format ingestion: await cognee.add(["/path/to/file.pdf", "raw text", open("doc.txt","rb")], dataset_name="my_data")

Ontology-grounded cognify: config = {"ontology_config": {"ontology_resolver": RDFLibOntologyResolver(ontology_file=path)}} → await cognee.cognify(config=config) [EXT:docs.cognee.ai/guides/ontology-support]

Session-aware search: await cognee.search(query_text="Q1", session_id="conv_1") → await cognee.search(query_text="Follow-up", session_id="conv_1") [EXT:docs.cognee.ai/guides/sessions]

Custom data models: class MyEntity(DataPoint): name: str; metadata = {"index_fields": ["name"]} → await add_data_points([entity]) [EXT:docs.cognee.ai/guides/custom-data-models]

Key API Summary

FunctionPurposeKey Params
add()Ingest text, files, binary datadata, dataset_name, user
cognify()Build knowledge graph from ingested datadatasets, graph_model, chunker, temporal_cognify
search()Query knowledge graphquery_text, query_type, top_k, session_id
memify()Enrich existing graph with custom tasksextraction_tasks, enrichment_tasks, data
config.*Runtime configuration (LLM, DB, vectors)static methods
datasets.*List, inspect, delete datasetsstatic methods
prune.*Clean up data and system resourcesprune_data(), prune_system()
update()Update existing data itemsdata_id, data, dataset_id
session.*Session history and feedbackget_session(), add_feedback()
run_custom_pipeline()Execute custom task pipelinestasks, data, dataset
SearchTypeEnum of 14 search modesGRAPH_COMPLETION (default)
visualize_graph()Render knowledge graph to HTMLdestination_file_path
enable_tracing()Enable OpenTelemetry tracingconsole_output
run_migrations()Run Alembic database migrations—
start_ui()Launch local Cognee UI (frontend + backend + MCP servers)pid_callback, port, start_backend, start_mcp
cognee_network_visualization()Render knowledge graph to interactive HTMLgraph_data, destination_file_path
pipelinesModule re-export: Task, run_tasks, run_tasks_parallel, run_pipeline—

LLM Provider Configuration

Configure via .env — provider-specific examples:

# Azure OpenAI
LLM_PROVIDER="azure"
LLM_MODEL="azure/gpt-4o-mini"
LLM_ENDPOINT="https://YOUR-RESOURCE.openai.azure.com/openai/deployments/gpt-4o-mini"
LLM_API_KEY="your_key"
LLM_API_VERSION="2024-12-01-preview"

# Anthropic (requires: pip install cognee[anthropic])
LLM_PROVIDER="anthropic"
LLM_MODEL="claude-3-5-sonnet-20241022"
LLM_API_KEY="your_key"

# Ollama (requires: pip install cognee[ollama])
LLM_PROVIDER="ollama"
LLM_MODEL="llama3.1:8b"
LLM_ENDPOINT="http://localhost:11434/v1"
LLM_API_KEY="ollama"
EMBEDDING_PROVIDER="ollama"
EMBEDDING_MODEL="nomic-embed-text:latest"
EMBEDDING_ENDPOINT="http://localhost:11434/api/embed"
HUGGINGFACE_TOKENIZER="nomic-ai/nomic-embed-text-v1.5"

# AWS Bedrock (requires: pip install cognee[aws])
LLM_PROVIDER="bedrock"
LLM_MODEL="anthropic.claude-3-sonnet-20240229-v1:0"
AWS_REGION="us-east-1"

# Custom / OpenRouter / vLLM
LLM_PROVIDER="custom"
LLM_MODEL="openrouter/google/gemini-2.0-flash-lite-preview-02-05:free"
LLM_ENDPOINT="https://openrouter.ai/api/v1"

Rate limiting: LLM_RATE_LIMIT_ENABLED=true, LLM_RATE_LIMIT_REQUESTS=60, LLM_RATE_LIMIT_INTERVAL=60

Structured output: STRUCTURED_OUTPUT_FRAMEWORK="instructor" (default) or "baml" (requires cognee[baml]). Override instructor mode: LLM_INSTRUCTOR_MODE="json_schema_mode".

Database Switching

# PostgreSQL (requires: pip install cognee[postgres])
DB_PROVIDER=postgres
DB_HOST=localhost  DB_PORT=5432  DB_USERNAME=cognee  DB_PASSWORD=cognee  DB_NAME=cognee_db

# PGVector (requires: pip install cognee[postgres])
VECTOR_DB_PROVIDER=pgvector
VECTOR_DB_URL=postgresql://cognee:cognee@localhost:5432/cognee_db

# Neo4j (requires: pip install cognee[neo4j])
GRAPH_DATABASE_PROVIDER=neo4j
GRAPH_DATABASE_URL=bolt://localhost:7687
GRAPH_DATABASE_USERNAME=neo4j  GRAPH_DATABASE_PASSWORD=yourpassword

# S3 storage (requires: pip install cognee[aws])
STORAGE_BACKEND="s3"
STORAGE_BUCKET_NAME="your-bucket"
DATA_ROOT_DIRECTORY="s3://your-bucket/cognee/data"

Security Environment Variables

ACCEPT_LOCAL_FILE_PATH=True     # Allow local file paths in add()
ALLOW_HTTP_REQUESTS=True        # Allow HTTP fetches
ALLOW_CYPHER_QUERY=True         # Allow raw Cypher in SearchType.CYPHER
REQUIRE_AUTHENTICATION=False    # Enable API auth
ENABLE_BACKEND_ACCESS_CONTROL=True  # Multi-tenant dataset isolation

Extension Patterns

Custom pipeline task:

from cognee.modules.pipelines.tasks.Task import Task

async def my_task(data):
    return process(data)

task = Task(my_task)

Direct database access:

from cognee.infrastructure.databases.graph import get_graph_engine
from cognee.infrastructure.databases.vector import get_vector_engine

graph_engine = await get_graph_engine()
vector_engine = await get_vector_engine()

LLM Gateway (structured output):

from cognee.infrastructure.llm.get_llm_client import get_llm_client

llm_client = get_llm_client()
response = await llm_client.acreate_structured_output(
    text_input="prompt", system_prompt="instructions", response_model=YourPydanticModel
)

MCP Server Transport Modes

python src/server.py                    # stdio (default)
python src/server.py --transport sse    # SSE
python src/server.py --transport http --host 127.0.0.1 --port 8000 --path /mcp
# API mode (connect to running Cognee API):
python src/server.py --transport sse --api-url http://localhost:8000 --api-token TOKEN

Docker: docker run -e TRANSPORT_MODE=sse --env-file.env -p 8000:8000 cognee/cognee-mcp:main

Common Troubleshooting

  • Ollama + OpenAI embeddings NoDataError — configure both LLM and embedding to same provider, or set HUGGINGFACE_TOKENIZER
  • LM Studio structured output — set LLM_INSTRUCTOR_MODE="json_schema_mode"
  • Default provider fallback — configuring only LLM or only embeddings defaults the other to OpenAI
  • Permission denied on search — returns empty list (not error) to prevent info leakage; check dataset permissions
  • Docker DB connections — use DB_HOST=host.docker.internal for local databases
  • Debug logging — LITELLM_LOG="DEBUG", ENV="development", TELEMETRY_DISABLED=1

Migration & Deprecation Warnings

  • delete() deprecated since v0.3.9 — use datasets.delete_data() instead [SRC:cognee/api/v1/delete/__init__.py:L13]
  • memify() default pipeline changed — coding rules replaced with triplet embedding (Mar 2026) [QMD:cognee-temporal:prs.md]
  • update() bug — PATCH updates timestamps but GET raw may return old data [QMD:cognee-temporal:issues.md]
  • visualize_graph() frontend — open bug #2442: missing component in UI mode [QMD:cognee-temporal:issues.md]
  • start_ui() v0.5.5 bug — pip-installed frontend fails with 500 errors due to missing npm deps (react-markdown, ngraph.graph) [QMD:cognee-temporal:issues.md]

See Full API Reference for migration details.

Key Types

SearchType (14 modes) [AST:cognee/modules/search/types/SearchType.py:L4]: GRAPH_COMPLETION (default), RAG_COMPLETION, CHUNKS, SUMMARIES, TRIPLET_COMPLETION, GRAPH_SUMMARY_COMPLETION, CYPHER, NATURAL_LANGUAGE, GRAPH_COMPLETION_COT, GRAPH_COMPLETION_CONTEXT_EXTENSION, FEELING_LUCKY, TEMPORAL, CODING_RULES, CHUNKS_LEXICAL

Task — wraps any callable (async/sync/generator) for pipeline execution [AST:cognee/modules/pipelines/tasks/task.py]

DataPoint — base class for custom graph nodes; inherit and add typed fields [EXT:docs.cognee.ai/guides/custom-data-models]

ChunkStrategy — PARAGRAPH, SENTENCE, LANGCHAIN_CHARACTER [AST:cognee/shared/data_models.py:L83]

Architecture at a Glance

  • Storage: Relational (SQLite/Postgres) + Vector (LanceDB/PGVector/Qdrant/Redis/ChromaDB/FalkorDB) + Graph (Kuzu/Neo4j/Neptune/Memgraph)
  • LLM Providers: OpenAI, Azure OpenAI, Gemini, Anthropic, Ollama, custom (vLLM)
  • Embedding: OpenAI, Azure, Gemini, Mistral, Ollama, Fastembed
  • Pipeline: Tasks → Pipelines → run_pipeline (orchestration with async generators)
  • Observability: OpenTelemetry tracing via enable_tracing() / disable_tracing()
  • MCP Server: 7 tools (cognify, search, list_data, delete, prune, cognify_status, save_interaction) [AST:cognee-mcp/src/server.py]

CLI

cognee --add "data"          # Ingest data
cognee --cognify             # Build knowledge graph
cognee --search "query"      # Search
cognee --debug               # Enable debug logging
cognee --ui                  # Launch local UI

[AST:cognee/cli/_cognee.py:L32]

Full API Reference

See references/full-api-reference.md for complete signatures with parameters, return types, and T2 annotations for all 22 exports.

Full Type Definitions

SearchType [AST:cognee/modules/search/types/SearchType.py:L4]

class SearchType(str, Enum):
    SUMMARIES = "SUMMARIES"               # Vector similarity on TextSummary nodes
    CHUNKS = "CHUNKS"                     # Vector similarity on DocumentChunk nodes
    RAG_COMPLETION = "RAG_COMPLETION"     # LLM-backed with chunk context
    TRIPLET_COMPLETION = "TRIPLET_COMPLETION"  # Graph triplet-based retrieval
    GRAPH_COMPLETION = "GRAPH_COMPLETION" # Default — LLM + graph traversal
    GRAPH_SUMMARY_COMPLETION = "GRAPH_SUMMARY_COMPLETION"
    CYPHER = "CYPHER"                     # Raw Cypher query
    NATURAL_LANGUAGE = "NATURAL_LANGUAGE" # NL → Cypher translation
    GRAPH_COMPLETION_COT = "GRAPH_COMPLETION_COT"  # Chain-of-thought graph
    GRAPH_COMPLETION_CONTEXT_EXTENSION = "GRAPH_COMPLETION_CONTEXT_EXTENSION"
    FEELING_LUCKY = "FEELING_LUCKY"       # Single best result
    TEMPORAL = "TEMPORAL"                 # Time-aware search
    CODING_RULES = "CODING_RULES"         # Code rule retrieval
    CHUNKS_LEXICAL = "CHUNKS_LEXICAL"     # BM25 keyword search on chunks

DataPoint [EXT:docs.cognee.ai/guides/custom-data-models]

Base class for all graph nodes. Inherits from Pydantic BaseModel. Set metadata = {"index_fields": ["field"]} for vector indexing. Use Edge(weight, relationship_type) for weighted relationships.

Notable subclasses: DocumentChunk, TextSummary, CodeSummary, DatabaseSchema, SchemaTable, TranslatedContent, GraphitiNode, WebPage.

Task [AST:cognee/modules/pipelines/tasks/task.py]

class Task:
    def __init__(self, executable, *args, task_config=None, **kwargs)

Wraps any callable (async/sync function, generator, async generator). Use task_config={"batch_size": N} for parallel processing. Decorate with @task_summary("Processed {n} items") for pipeline reporting.

Pipeline Exports [SRC:cognee/modules/pipelines/__init__.py:L1]

Task, run_tasks, run_tasks_parallel, run_pipeline

Full Integration Patterns

Co-import Patterns

  • pydantic — BaseModel for graph models, BaseSettings for config
  • sqlalchemy — relational storage layer (async sessions)
  • fastapi — HTTP API server for deployment
  • uuid — dataset and data item identifiers
  • asyncio — all core operations are async

MCP Server Integration [AST:cognee-mcp/src/server.py]

7 MCP tools: cognify(data, graph_model_file, graph_model_name, custom_prompt), search(search_query, search_type, top_k), save_interaction(...), list_data(dataset_id), delete(data_id, dataset_id, mode), prune(), cognify_status().

Runs via FastMCP("Cognee"). Supports SSE and streamable HTTP transports with CORS.

Provider Configuration [EXT:docs.cognee.ai/setup-configuration/overview]

Configure via .env or cognee.config.* methods:

  • LLM: LLM_API_KEY, LLM_MODEL, LLM_PROVIDER (openai/azure/gemini/anthropic/ollama/custom)
  • Embedding: EMBEDDING_PROVIDER, EMBEDDING_MODEL
  • Vector: VECTOR_DB_PROVIDER (lancedb/pgvector/qdrant/redis/chromadb/falkordb)
  • Graph: GRAPH_DB_PROVIDER (kuzu/neo4j/neptune/memgraph)
  • Debug: LOG_LEVEL=DEBUG, TELEMETRY_DISABLED=true

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

平台分布

Codex

33.88%
按下载量换算111

Claude

31.83%
按下载量换算104

Cursor

20.91%
按下载量换算69

Gemini CLI

9.04%
按下载量换算30

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills