跳到主要内容
知仓学习社ZHICANG

cognee-install

Use when the user wants to install cognee and run their first remember → recall flow with the Python SDK — fresh setup, virtual env, extras selectio…

读凭据严重 1 · 高危 0topoteretes/cognee

它会碰到什么

扫了多少1 个文本文件,4 KB
它会碰到什么读凭据
命中总数1 处
命中统计严重 1 · 高 0 · 中 0 · 低 0
逐条看命中(1 条严重或高危)
  • 严重 SKILL.md:26cred-paths
    The only required setting is an LLM API key. Create `.env` in the working

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Install and run cognee

Install

Requires Python 3.10–3.14. Prefer uv:

uv venv && source .venv/bin/activate
uv pip install cognee            # from PyPI
# or, working inside this repo:
uv pip install -e .

Add extras only when needed — examples: cognee[postgres], cognee[neo4j],

cognee[docling] (office/HTML document parsing, slim), cognee[docs]

(unstructured), cognee[anthropic], cognee[ollama], cognee[aws]. The full

list is in pyproject.toml under [project.optional-dependencies].

Configure

The only required setting is an LLM API key. Create .env in the working

directory (or export the variable):

LLM_API_KEY="your_openai_api_key"

Defaults need no services: SQLite (relational), LanceDB (vector), and Ladybug

(graph), all stored locally. OpenAI is the default LLM and embedding provider —

if you configure a different LLM but not embeddings (or vice versa), the other

silently stays on OpenAI. For other providers and databases use the

cognee-integrations skill.

First run

As of cognee 1.x the memory API — remember, recall, forget, improve

is the primary surface. All SDK functions are async. Minimal end-to-end script:

import asyncio
import cognee

async def main():
    await cognee.remember("Cognee turns documents into AI memory.")
    results = await cognee.recall("What does cognee do?")
    print(results)

asyncio.run(main())

remember() is the whole ingestion path in one call — it runs add() +

cognify(), then improve() to index the graph (self_improvement=True by

default). It accepts text, file paths, URLs, and binary streams, with an

optional dataset_name="my_project"; pass datasets=["my_project"] to

recall() to stay inside one dataset.

recall() auto-routes the query to a search strategy by default. Pass

query_type=SearchType.CHUNKS (etc.) to pin one, or auto_route=False to

fall back to GRAPH_COMPLETION.

Session memory is the other half of the API — remember(..., session_id="chat_1")

writes to a fast session cache rather than running add+cognify inline, and

recall(..., session_id="chat_1") reads it back (session hits short-circuit the

graph search). With the default self_improvement=True it still bridges that

data into the permanent graph in the background; `improve(dataset=...,

session_ids=[...])` does the same explicitly. Session memory runs on the

session cache, which is on by default (CACHING=true); setting

CACHING=false disables it entirely and makes remember(session_id=...)

raise.

Start with examples/advanced_guides/remember_recall_improve_example.py, which walks

through permanent memory, session memory, and the sync between them.

The add() / cognify() / search() / memify() primitives still exist and

are what remember/recall/improve call underneath — reach for them when you

need to drive a stage in isolation (e.g. custom pipeline tasks), not for

ordinary ingestion. cognee.delete is formally deprecated (since 0.3.9);

forget() is the v1 replacement, unifying the old delete/prune/empty_dataset

paths behind one call. When to use recall() versus the low-level search()

is covered in docs/recall-vs-search.md.

Verify / troubleshoot

  • cognee-cli remember "hello" && cognee-cli recall "hello" exercises the same

flow from the shell.

  • To wipe local state during experiments: cognee-cli forget --all (or

await cognee.forget(everything=True)).

  • Reads slow or spending tokens on every query → set AUTO_FEEDBACK=false

(keep CACHING=true); by default cognee makes one structured-output LLM

call per answered query to self-tune its memory.

  • Structured LLM output errors usually mean the model/provider needs an

explicit instructor mode: LLM_INSTRUCTOR_MODE="json_schema_mode".

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 30,732
本站分层T1
该仓技能数8
原文件路径.claude/skills/cognee-install/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 8 个技能