본문으로 건너뛰기
cccskills
무료GitHub에 공개

cognee-recall

Query documents and conversations stored in cognee to retrieve answers, supporting passages, or context for an AI model. This skill guides search method selection, source filtering, result interpretation, and troubleshooting empty or unexpected results.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Use when querying cognee memory with recall() (or search()) — picking a search type, understanding auto-routing, scoping to datasets, node sets or sessions, getting context or citations instead of an answer, reading the results, or debugging empty or unexpected results.

설치 방법 보기

이럴 때 유용합니다

  • Searching selected datasets or conversation sessions
  • Retrieving supporting passages or model context
  • Choosing a search method for a question
  • Investigating empty or unexpected search results

포함된 파일(1)

  • SKILL.md10.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Query memory with recall()

recall() is cognee's query API. It picks a search strategy, searches the graph and (with a session) the session cache, and returns a list of tagged results.

import cognee

results = await cognee.recall("Where was Einstein born?")
for r in results:
    print(r.source, r.text)  # e.g. "graph", "Einstein was born in Ulm."

Without datasets it searches every dataset the user can read. Pass datasets=["research"] (names) or dataset_ids=[...] (UUIDs, which win) to narrow it; that is also faster.

Use it

How the search type is picked

  1. An explicit query_type=SearchType.X always wins.
  2. Otherwise, with no usable LLM key, CHUNKS (plain vector search).
  3. Otherwise the router (auto_route=True, the default). It is three regex rules, first match wins, no LLM call:
    • the whole query is one "quoted phrase" → CHUNKS_LEXICAL
    • mentions coding rules/standards/conventions or code-review guidelines → CODING_RULES
    • an absolute date behind a time preposition (in 2019, before 1900, on 7 November 1867) → TEMPORAL
  4. Everything else → HYBRID_COMPLETION.

A routed type (never a pinned one) that the backend rejects, or a routed CHUNKS_LEXICAL / CODING_RULES that returns nothing, is retried once as HYBRID_COMPLETION. The router never picks CYPHER.

from cognee import SearchType

await cognee.recall("What changed in v2?", query_type=SearchType.GRAPH_COMPLETION)

Search types

The full list is cognee/modules/search/types/SearchType.py; the type-to-retriever table is cognee/modules/retrieval/README.md.

TypeLLM?Use for
HYBRID_COMPLETION (default)yesGeneral questions: document passages plus entity neighbourhoods, then an answer
GRAPH_COMPLETIONyesAnswers from graph relationships
GRAPH_COMPLETION_COT, _CONTEXT_EXTENSION, _DECOMPOSITIONyesHarder multi-hop questions (more LLM calls)
GRAPH_SUMMARY_COMPLETIONyesSummarizes the retrieved graph edges at query time (extra LLM call), then answers
RAG_COMPLETIONyesClassic chunk RAG
TEMPORALyesTime questions; hybrid retrieval reranked by the dates in the question
CHUNKSnoRaw passages by vector similarity
CHUNKS_LEXICALnoKeyword / exact-phrase match
SUMMARIESnoDocument summaries
CODEnoCode-graph operations via code_query={...}; needs scope="code" in recall
SKILLSnoDiscover skill playbooks; exactly one dataset
CYPHERnoRaw Cypher. Off by default; ALLOW_CYPHER_QUERY=true enables it. It can write, so only pass user-authored queries deliberately
NATURAL_LANGUAGEyesLLM writes Cypher, then runs it (same flag)
GRAPH_REPORTpartlyGraph insight report: hubs, cross-set links, suggested questions
FEELING_LUCKYyesAn LLM picks the type
AGENTIC_COMPLETIONyesMulti-step loop with skills/tools; exactly one dataset. Use search() for its parameters

Scope: which sources are searched

scope is one of, or a list of: graph, session, session_first, trace, session_context, all, tools, code. all means graph + session + trace + session_context; tools and code are never included implicitly.

When scope is omitted:

You passSources
session_id onlySession first; a session hit skips the graph
session_id + datasetsSession and graph both contribute
session_id + query_typeGraph only — pinning a type drops the session
no session_idGraph only

Session and trace search is keyword overlap, not embeddings.

Filters and knobs

  • top_k=15: per dataset, not in total. The default HYBRID caps each lane at min(top_k, 10); set chunks_top_k / entities_top_k / facts_top_k in retriever_specific_config to go higher.
  • node_name=["AI"] (+ node_name_filter_operator="OR"|"AND"): restricts graph/chunk/completion types to data remembered with that node_set. SUMMARIES, CHUNKS_LEXICAL, GRAPH_REPORT, CYPHER, NATURAL_LANGUAGE, CODE and SKILLS ignore it; CODING_RULES treats it as the rules node-set name.
  • system_prompt / system_prompt_path: change the answering prompt.
  • response_model=MyPydanticModel: structured answer, on r.structured.
  • include_references=True: attach the document chunks that support each graph edge used (needs EDGE_EVIDENCE_ENABLED=true, the default).
  • only_context=True: return what the LLM would have received instead of an answer. r.text is the rendered user prompt, r.system_prompt the system prompt. Pin query_type when you use it.
  • retriever_specific_config={...}: retriever-only options. For the agentic extras (skills, tools, max_iter) and node_type, call cognee.search() instead, which takes them as parameters.

Reading the results

Each item is a Pydantic model with a source discriminator: graph, session, trace, session_context, code, tools, skills, or system. Graph items carry text (always renderable), search_type, kind, score, dataset_id / dataset_name, metadata, raw, and structured. A system item is a status marker, not data (see "memory warming up" below).

When a query sounds procedural ("how do I…", "runbook", "steps to…") and exactly one dataset is targeted, recall also runs a small SKILLS lookup and appends hits with source="skills". Disable with SKILL_GATE_ENABLED=false.

Pitfalls

  • Permissions change what you get back. With no datasets, recall searches only datasets the user can read, so a user without grants gets one source="system" memory_warming_up marker from a graph-only recall (with only_context=True or RECALL_WARMUP_SHORTCIRCUIT=false it gets []; with session sources included only the graph lane is empty, and session and trace hits still come back). Asking for a dataset id the user cannot read raises PermissionDeniedError (HTTP 403). Dataset names resolve only among the user's own datasets, so a name that is not theirs (even one shared with them) raises DatasetNotFoundError; use dataset_ids for shared datasets. See the cognee-permissions skill.
  • "Memory warming up". On an empty graph, a graph-only recall (no session sources, not only_context) returns one source="system" item with status="memory_warming_up" (or "build_failed" plus error_message) instead of results; a multi-source recall just returns no graph results. Wait for the remember to finish, or check why it failed.
  • Hybrid silently becomes graph completion when you pass neighborhood_depth or feedback_influence > 0 (including a nonzero DEFAULT_FEEDBACK_INFLUENCE), or the chunk collection is missing. node_name stays on hybrid, which filters to that node set. search() also defers for a custom node_type or node_name with node_type=None; recall() has no node_type. wide_search_top_k and triplet_distance_penalty with hybrid raise InvalidHybridSearchConfig; pin GRAPH_COMPLETION to use them.
  • SKILLS and AGENTIC_COMPLETION need exactly one dataset. For SKILLS, search() raises unless exactly one dataset is given. recall() runs SKILLS per dataset with access control on (zero datasets gives [], not an error) and raises only with access control off and not exactly one dataset. For AGENTIC_COMPLETION only search() checks it up front, so call it through search() with one dataset.
  • code_query without scope="code" raises, and scope="tools" also needs TOOL_CALLS_ENABLED=true.
  • Latency. Most completion types make one LLM call; COT, DECOMPOSITION, CONTEXT_EXTENSION, GRAPH_SUMMARY_COMPLETION, TEMPORAL, FEELING_LUCKY (one call to pick the type, then the chosen type's) and AGENTIC_COMPLETION (a loop of up to max_iter, default 6) make more. NATURAL_LANGUAGE makes one (no answer call) and retries only on an empty or failed query, up to 3 attempts. With CACHING and AUTO_FEEDBACK on (defaults), each answered turn adds one analysis call, even without a session_id. Set AUTO_FEEDBACK=false for low-latency reads (see the cognee-performance skill).

recall() or search()?

Use recall(). Drop to cognee.search() only for agentic parameters (skills, tools, max_iter, node_type) as first-class arguments, raw SearchResult objects, or a pinned type with no router. search() never searches the session cache; its session_id only adds conversation history to the prompt. Full guide: docs/recall-vs-search.md.

How it works

recall() resolves scope and search type, then calls the same authorized search search() uses: datasets resolve through the permission layer with read, one search per dataset runs concurrently, and results are normalized and tagged.

  • Entry point, scope and type resolution: cognee/api/v1/recall/recall.py
  • Router: cognee/api/v1/recall/query_router.py
  • Skill gate: cognee/api/v1/recall/skill_gate.py
  • Result types: cognee/modules/recall/types/RecallResponse.py, SearchResultItem.py
  • Scope names: cognee/memory/entries.py:normalize_scope
  • Warm-up config (RECALL_WARMUP_*): cognee/modules/recall/config.py
  • Core search and fan-out: cognee/modules/search/methods/search.py
  • Hybrid fallback rules: cognee/modules/search/methods/hybrid_deferral.py
  • Registry: cognee/modules/search/methods/get_search_type_retriever_instance.py

Examples in examples/guides/: recall_core.py, hybrid_retrieval_recall.py, references_example.py, temporal_recall.py, sessions.py.

Extending it

Adding a search type, per cognee/modules/retrieval/README.md:

  1. Write the retriever in cognee/modules/retrieval/ (subclass BaseRetriever or a completion base).
  2. Add the SearchType member and its search_core_registry entry.
  3. Add a row to the README table. A unit test (cognee/tests/unit/modules/retrieval/retriever_readme_index_test.py) fails if the table and registry disagree.
  4. Optional: add it to SEARCH_TYPE_CHOICES in cognee/cli/config.py for the CLI, or a regex rule to query_router.py for auto-routing. Never route a type that can write.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Operate cognee from the terminal to store, retrieve, update, and remove information. Covers dataset and configuration management, ingestion cost estimates, session history access, and commands for inspecting or applying database migrations.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Storing documents and asking questions from the terminal
  • Estimating token usage and cost before importing data
  • Managing datasets and saved configuration
topoteretes/cognee3.3만2026년 10월 19일 업데이트

Connect cognee to additional databases and data sources through community packages. The skill covers installing and registering adapters, importing data through connectors, configuring monitoring, and developing extension packages with examples and tests.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Connect cognee to Qdrant or another database
  • Import data from Slack or Gmail
  • Configure monitoring with Keywords AI
topoteretes/cognee3.3만2026년 10월 19일 업데이트

Define custom entities and relationships in cognee, a memory system for AI applications. This skill guides model design, identity matching, searchable fields, and troubleshooting when entities are duplicated or relationships are missing.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Designing custom entities and relationships
  • Preventing duplicate entities across imports
  • Investigating missing search results or relationships
topoteretes/cognee3.3만2026년 10월 19일 업데이트

Build custom cognee processing by chaining Python tasks, defining data types, and saving results to graph and vector databases. Use it to enrich existing data, inspect run status, and troubleshoot how tasks pass data.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Building custom extraction and processing steps
  • Saving custom data types to graph and vector databases
  • Adding information to an existing graph
topoteretes/cognee3.3만2026년 10월 19일 업데이트

Run cognee in Docker, starting with a prebuilt image for local document ingestion and questions. It also covers Docker Compose profiles for adding the UI, MCP server, Postgres, and Neo4j, plus persistent data storage.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Try cognee locally using a prebuilt Docker image
  • Test document ingestion and questions through the API
  • Start the UI, MCP server, and databases with Docker Compose
topoteretes/cognee3.3만2026년 10월 19일 업데이트

Find and remove stored content from cognee using its SDK, HTTP API, or CLI. Inspect documents before deletion, choose document or dataset removal, or keep raw files while clearing derived graph relationships and search vectors.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Find and delete a specific stored document
  • Remove an entire dataset
  • Clear derived memory while keeping original files
topoteretes/cognee3.3만2026년 10월 19일 업데이트

topoteretes의 스킬 모두 보기

이 스킬의 문제 신고