agentic_huge_data_base / wiki
页面 Cognee · 15 术语表·DeepWiki 中文全文译文

15 · 术语表(Glossary)

记忆管道与知识图谱构建 · 聚焦本章的模块关系、源码依据与实现要点。

项目Cognee 章节15 状态全文译文 模块检索、召回与索引、存储与持久化、工作流与编排、接口与服务契约
源码线索
  • .env.template
  • .github/workflows/dockerhub-mcp.yml
  • Dockerfile
  • README.md
  • assets/cognee_benefits.png
  • cognee-mcp/Dockerfile
  • cognee-mcp/README.md
  • cognee-mcp/entrypoint.sh
  • cognee-mcp/pyproject.toml
  • cognee-mcp/src/__init__.py
模块标签
  • 检索、召回与索引
  • 存储与持久化
  • 工作流与编排
  • 接口与服务契约
  • 配置治理

章节正文

术语表

术语表

相关源文件

本章引用的主要源码文件:

  • .env.template
  • .github/workflows/dockerhub-mcp.yml
  • Dockerfile
  • README.md
  • assets/cognee_benefits.png
  • cognee-mcp/Dockerfile
  • cognee-mcp/README.md
  • cognee-mcp/entrypoint.sh
  • cognee-mcp/pyproject.toml
  • cognee-mcp/src/__init__.py
  • cognee-mcp/src/client.py
  • cognee-mcp/src/cognee_client.py
  • cognee-mcp/src/server.py
  • cognee-mcp/uv.lock
  • cognee/alembic/versions/7c5d4e2f8a91_add_parent_user_id_to_users.py
  • cognee/api/v1/add/add.py
  • cognee/api/v1/cognify/cognify.py
  • cognee/api/v1/config/config.py
  • cognee/base_config.py
  • cognee/context_global_variables.py
  • cognee/infrastructure/databases/graph/config.py
  • cognee/infrastructure/databases/graph/get_graph_engine.py
  • cognee/infrastructure/databases/graph/graph_db_interface.py
  • cognee/infrastructure/databases/graph/kuzu/adapter.py
  • cognee/infrastructure/databases/graph/neo4j_driver/adapter.py
  • cognee/infrastructure/databases/utils/get_or_create_dataset_database.py
  • cognee/infrastructure/databases/vector/chromadb/ChromaDBAdapter.py
  • cognee/infrastructure/databases/vector/config.py
  • cognee/infrastructure/databases/vector/create_vector_engine.py
  • cognee/infrastructure/databases/vector/get_vector_engine.py
  • cognee/infrastructure/databases/vector/lancedb/LanceDBAdapter.py
  • cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py
  • cognee/infrastructure/databases/vector/vector_db_interface.py
  • cognee/infrastructure/llm/config.py
  • cognee/infrastructure/llm/prompts/extract_query_time.txt
  • cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/bedrock/adapter.py
  • cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/get_llm_client.py
  • cognee/modules/data/models/Data.py
  • cognee/modules/pipelines/operations/pipeline.py
  • cognee/modules/pipelines/operations/run_tasks.py
  • cognee/modules/retrieval/base_retriever.py
  • cognee/modules/retrieval/completion_retriever.py
  • cognee/modules/retrieval/graph_completion_context_extension_retriever.py
  • cognee/modules/retrieval/graph_completion_cot_retriever.py
  • cognee/modules/retrieval/graph_completion_retriever.py
  • cognee/modules/retrieval/graph_summary_completion_retriever.py
  • cognee/modules/retrieval/temporal_retriever.py
  • cognee/modules/retrieval/utils/completion.py
  • cognee/modules/settings/__init__.py
  • cognee/modules/settings/get_settings.py
  • cognee/modules/settings/save_llm_config.py
  • cognee/modules/settings/save_vector_db_config.py
  • cognee/modules/users/authentication/default/default_transport.py
  • cognee/modules/users/authentication/get_api_auth_backend.py
  • cognee/modules/users/authentication/get_client_auth_backend.py
  • cognee/modules/users/models/DatasetDatabase.py
  • cognee/root_dir.py
  • cognee/shared/lru_cache.py
  • cognee/tasks/ingestion/ingest_data.py
  • cognee/tasks/ingestion/save_data_item_to_storage.py
  • cognee/tests/unit/infrastructure/llm/test_get_llm_client.py
  • cognee/tests/unit/modules/retrieval/chunks_retriever_test.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py
  • cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py
  • cognee/tests/unit/modules/retrieval/summaries_retriever_test.py
  • cognee/tests/unit/modules/retrieval/temporal_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py
  • cognee/tests/unit/modules/retrieval/triplet_retriever_test.py
  • cognee/tests/unit/test_add_parent_user_id_migration.py
  • docker-compose.yml
  • entrypoint.sh
  • poetry.lock
  • pyproject.toml
  • uv.lock

本页面提供了 Cognee 知识引擎中使用的代码库特定术语、缩写和领域概念的定义。

核心概念

Cognify

将原始入库数据转换为结构化知识图谱的核心过程。它涉及一个多阶段管线:分类、片段切分、实体提取、关系检测和摘要生成 cognee/api/v1/cognify/cognify.py:83-89。该过程通过 run_pipeline 函数进行编排 cognee/api/v1/cognify/cognify.py:12-12

  • 源代码cognee.cognify() cognee/api/v1/cognify/cognify.py:43-59
DataPoint

Cognee 中所有数据实体的基础基类。知识图谱中的每个节点或关系数据库中的每条记录都继承自 DataPoint,它提供了内置的元数据、来源追踪和版本控制功能。它被定义为一个 Pydantic BaseModel cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:36-49

  • 源代码class DataPoint cognee/infrastructure/engine/__init__.py(在 cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:15-15 中被引用)
三数据库架构

Cognee 使用三种不同类型的数据库来管理上下文:

  1. 关系型数据库:使用 SQLAlchemyAdapter 管理系统状态、用户、数据集和管线运行 cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:51-51
  2. 向量数据库:存储文本片段和图三元组的嵌入向量,以实现语义搜索 cognee/infrastructure/databases/vector/vector_db_interface.py:26-28
  3. 图数据库:存储实体及其关系(三元组),以实现结构化推理 cognee/infrastructure/databases/graph/graph_db_interface.py:1-10
数据集

数据点的逻辑分组。Cognee 通过将数据分离到不同的数据集中来实现多租户隔离。如果启用了 backend_access_control_enabled,这些数据集可以存储在隔离的数据库实例中 cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:22-22

来源: cognee/api/v1/cognify/cognify.py:43-89, cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:15-51, cognee/infrastructure/databases/vector/vector_db_interface.py:26-28

技术术语与行话

术语定义代码指针
三元组表示为(主体,谓词,客体)的知识单元。cognee/modules/retrieval/graph_completion_retriever.py:1-20
Memify用于图谱增强的管线,包括编码规则提取和实体合并。cognee/api/v1/cognify/cognify.py:136-150
来源追踪数据点来源的元数据(哪个用户、哪个任务、哪个管线)。cognee/api/v1/cognify/cognify.py:34-34
InstructorCognee 使用的库,用于从大语言模型(LLM)响应中提取结构化的 Pydantic 模型。pyproject.toml:33-33
MCP模型上下文协议(Model Context Protocol)。一种标准,用于 AI 代理将 Cognee 作为工具进行交互。cognee-mcp/src/server.py:73-73
Ladybug图适配器的内部名称,以前称为 KuzuAdapter。cognee/infrastructure/databases/graph/kuzu/adapter.py:1-17

来源: cognee-mcp/src/server.py:73-73, cognee/infrastructure/databases/graph/kuzu/adapter.py:1-17, pyproject.toml:33-33

自然语言空间到代码实体空间

以下图表将高层系统概念映射到其具体的实现类和函数。

数据入库与转换

此图表将用户"记住记忆"的操作映射到内部管线执行。

Cognee · 数据入库与转换 · 图 1
Cognee · 数据入库与转换 · 图 1

来源: cognee/api/v1/cognify/cognify.py:12-35, cognee/api/v1/add/add.py:1-25, README.md:128-159, cognee/tasks/storage/__init__.py(在 cognee/api/v1/cognify/cognify.py:27-27 中被引用)。

检索与搜索流程

此图表将"搜索"意图映射到具体的检索器和数据库适配器。

Cognee · 检索与搜索流程 · 图 2
Cognee · 检索与搜索流程 · 图 2

来源: cognee/modules/retrieval/graph_completion_retriever.py:1-30, cognee/infrastructure/databases/graph/get_graph_engine.py:1-20, cognee/infrastructure/databases/vector/create_vector_engine.py:1-20, cognee/infrastructure/databases/vector/lancedb/LanceDBAdapter.py:73-80

缩写

  • CoT:思维链(Chain of Thought)。在 GraphCompletionCotRetriever 中使用,用于在图谱上执行多步推理 cognee/modules/retrieval/graph_completion_cot_retriever.py:1-15
  • RAG:检索增强生成(Retrieval-Augmented Generation)。Cognee 通过 CompletionRetriever 将图谱/向量上下文注入大语言模型(LLM)提示词来实现的通用模式 cognee/modules/retrieval/completion_retriever.py:1-10
  • OTEL:OpenTelemetry。用于管线内追踪和可观测性的框架,使用 new_span cognee/api/v1/cognify/cognify.py:34-34
  • DLT:数据加载工具(Data Load Tool)。用于从各种来源入库结构化数据的集成工具 cognee/api/v1/cognify/cognify.py:28-28
  • SSE:服务器发送事件(Server-Sent Events)。MCP 服务器用于实时更新的传输模式 cognee-mcp/src/server.py:166-185

数据库适配器术语表

适配器类数据库类型描述
LadybugAdapter使用 KuzuDB 的默认本地图数据库(别名为 KuzuAdaptercognee/infrastructure/databases/graph/kuzu/adapter.py:10-17
LanceDBAdapter向量使用 LanceDB 的默认本地向量数据库 cognee/infrastructure/databases/vector/lancedb/LanceDBAdapter.py:73-80
SQLAlchemyAdapter关系型通过 SQLAlchemy 处理元数据和系统状态 cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:51-51
PGVectorAdapter向量用于带有 pgvector 扩展的 PostgreSQL 的适配器 cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:51-55
ChromaDBAdapter向量用于 ChromaDB 向量存储的适配器 cognee/infrastructure/databases/vector/chromadb/ChromaDBAdapter.py:1-20

来源: cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py:51-55, cognee/infrastructure/databases/vector/lancedb/LanceDBAdapter.py:73-80, cognee/infrastructure/databases/graph/kuzu/adapter.py:10-17, pyproject.toml:40-52