topoteretes/cognee

cognee-custom-pipelines

Use when building your own cognee processing — writing custom tasks, chaining them into a pipeline with run_custom_pipeline or the lightweight run_pipeline (from cognee.pipelines import run_pipeline), storing custom DataPoints with add_data_points, running custom enrichment over the existing graph, checking pipeline run status, or debugging how data flows…

  • SKILL.md 已保存
  • 英文来源资料
  • 安装与运行未实测
先判断是否解决你的问题

cognee-custom-pipelines 是什么?

Use when building your own cognee processing — writing custom tasks, chaining them into a pipeline with run_custom_pipeline or the lightweight run_pipeline (from cognee.pipelines import run_pipeline), storing custom DataPoints with add_data_points, running custom enrichment over the existing graph, checking pipeline run status, or debugging how data flows between tasks (batch_size, data_per_batch, ctx, Drop, enriches).

以上为来源原文,中文用途说明尚待整理。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 cognee-custom-pipelines,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 cognee-custom-pipelines

请在 Codex 的当前工作环境中安装并检查 cognee-custom-pipelines 这个 Skill。

项目身份:topoteretes/cognee / cognee-custom-pipelines
来源:https://github.com/topoteretes/cognee/blob/1961133d0c68b450fe8e71941a756371e94f7c04/.agents/skills/cognee-custom-pipelines/SKILL.md
已定位的源文件:.agents/skills/cognee-custom-pipelines/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-23T04:29:48.865Z
中文使用说明
尚待整理,保留英文来源内容
安装与任务测试
本站未执行安装或任务测试
来源复核
已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料

.agents/skills/cognee-custom-pipelines/SKILL.md · 抓取时间 2026-11-23T04:29:48.865Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Use when building your own cognee processing — writing custom tasks, chaining them into a pipeline with run_custom_pipeline or the lightweight run_pipeline (from cognee.pipelines import run_pipeline), storing custom DataPoints with add_data_points, running custom enrichment over the existing graph, checking pipeline run status, or debugging how data flows between tasks (batch_size, data_per_batch, ctx, Drop, enriches).

查看源文件章节 / Source sections
  • 原文:Custom tasks and pipelines
  • 原文:Use it
  • 原文:Pick the runner
  • 原文:Write a task
  • 原文:How data flows
  • 原文:Store results
  • 原文:Work on the existing graph
  • 原文:Check status
  • 原文:Pitfalls
  • 原文:How it works
  • 原文:Extending it
原文:Custom tasks and pipelines

Everything cognee does runs as a **pipeline**: an ordered list of **tasks**, each a plain Python function whose output feeds the next one. `remember()` is the right tool for ordinary ingestion. Build a pipeline when you need processing cognee does not ship: your own extraction, your own node types, or a post-processing step over the graph. ```python import cognee from cognee.modules.pipelines import Task from cognee.tasks.storage import add_data_points from cognee.low_level import DataPoint class Person(DataPoint): name: str metadata: dict = {"index_fields": ["name"], "identity_fields": ["name"]} async def extract_people(data_items: list) -> list[Person]: people = [] for item in data_items: # always a list, see below text = item if isinstance(item, str) else "" people += [Person(name=n.strip()) for n in text.split(",") if n.strip()] return people result = await cognee.run_custom_pipeline( tasks=[ Task(extract_people, needs_llm=False), Task(add_data_points, needs_llm=False), # store in graph + vector DBs ], data=["Ada Lovelace, Alan Turing"], dataset="people", ) ```

原文:Pick the runner

There are three, and two share the name `run_pipeline`: | Runner | Import | Use it for | |---|---|---| | `cognee.run_custom_pipeline(...)` | `cognee` | The normal choice: runs your tasks against a dataset with permissions, a per-dataset lock, run records, and status | | Full orchestrator `run_pipeline(tasks=..., data=..., datasets=...)` | `cognee.modules.pipelines` | What `run_custom_pipeline` and `cognify` call; yields `PipelineRunInfo` | | Lightweight `run_pipeline([...], data=...)` | `from cognee.pipelines import run_pipeline` (after `import cognee`, the attribute `cognee.pipelines.run_pipeline` is the orchestrator) | Quick chains of `task()` specs with no permissions, locks, run rows, or migrations; returns the last step's outputs | `cognee.run_custom_pipeline(tasks, data=None, dataset="main_dataset", user=None, incremental_loading=False, data_per_batch=20, run_in_background=False, pipeline_name="custom_pipeline", data_cache=False, ...)` returns `{dataset_id: PipelineRunInfo}` (the started run when `run_in_background=True`). With `data=None` it runs over the dataset's existing documents (`Data` rows).

原文:Write a task

```python from cognee.modules.pipelines import Task from cognee.modules.pipelines.models import PipelineContext from cognee.modules.pipelines.tasks.task import task_summary from cognee.pipelines import Drop @task_summary("Tagged {n} chunk(s)") async def tag_chunks(chunks: list, ctx: PipelineContext = None, label: str = "x"): for chunk in chunks: chunk.metadata["label"] = label return chunks # or yield per item; return/yield Drop to discard tag = Task(tag_chunks, label="reviewed", batch_size=10, needs_llm=False) ``` - A task is an `async def`, a generator, an async generator, or a plain `def`. Extra `Task(fn, *args, **kwargs)` arguments are passed after the pipeline data. - `needs_llm=False` on tasks that never call an LLM lets an LLM-free pipeline skip the LLM connection check. - `ctx` (injected by the parameter **name** `ctx`) carries `user`, `data_item`, `dataset`, `pipeline_run_id`, `pipeline_name`, and `extras`. - `task.with_config(batch_size=..., **kwargs)` returns a modified copy.

原文:How data flows

- **Each document runs the whole chain on its own** with `run_custom_pipeline` or the orchestrator, and the first task receives it as a **one-element list** (`[data_item]`), not the bare item. The lightweight `run_pipeline` passes `data` to the first task unchanged. - **`data_per_batch`** (default 20) is how many documents run at the same time. It is a concurrency limit, not a batch size. - **`batch_size` belongs to the consumer.** A task's `batch_size` decides how the *previous* task's generator output is grouped before it is passed in. Generator tasks always hand over lists; a coroutine or function hands over its single return value. - **Streaming:** each upstream result goes down the chain immediately, so a downstream task can run many times per document. - **`enriches=True`:** if the task returns `None`, its input is passed on unchanged (coroutines and functions only, not generators). - **`Drop`:** returning or yielding it removes that item from the stream. - Every `DataPoint` passing through is stamped automatically with where it came from (`source_pipeline`, `source_task`, `source_user`, …).

原文:Store results

`add_data_points(data_points, custom_edges=None, graph_only=False)` writes a list of `DataPoint`s to the graph and indexes their `index_fields` in the vector DB. It returns the same list, so it can sit mid-chain. Give every node type `identity_fields` so repeated runs merge instead of duplicating (see the `cognee-custom-graph-models` skill).

原文:Work on the existing graph

`cognee.memify`, `cognee-cli memify`, `POST /api/v1/memify` and `improve()`'s `extraction_tasks` / `enrichment_tasks` are deprecated and removed in the next release. Run a post-processing step over the graph with `run_custom_pipeline`: the task reads the graph itself, and one placeholder item as `data` makes the chain run once instead of once per document. ```python from cognee.infrastructure.databases.graph import get_graph_engine async def enrich_graph(_items: list): graph = await get_graph_engine() # the dataset's graph inside the pipeline nodes, edges = await graph.get_graph_data() return [...] # new DataPoints for add_data_points await cognee.run_custom_pipeline( tasks=[Task(enrich_graph, needs_llm=False), Task(add_data_points, needs_llm=False)], data=[{}], dataset="people", ) ``` For cognee's own enrichment (session bridging, feedback weights, conflict review, global context index) call `improve()`.

文件 SHA256:be29f6a160f690af9d163ae574c21d699adf27061282b5aab81f598399c9e550

仓库许可证记录:Apache-2.0;repository-license-recorded-scope-unverified,查看来源。

SKILL.md原文description · 2026-11-23T04:29:48.865Z

Use when building your own cognee processing — writing custom tasks, chaining them into a pipeline with run_custom_pipeline or the lightweight run_pipeline (from cognee.pipelines import run_pipeline), storing custom DataPoints with add_data_points, running custom enrichment over the existing graph, checking pipeline run status, or debugging how data flows between tasks (batch_size, data_per_batch, ctx, Drop, enriches).

查看历史简介来源

历史收录数据

来源仓库topoteretes/cognee
Skill源路径.agents/skills/cognee-custom-pipelines/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源