search lets you ask questions over everything you’ve ingested and cognified.
Under the hood, Cognee blends vector similarity, graph structure, and LLM reasoning to return answers with context and provenance.

The big picture

  • Dataset-aware: searches run against one or more datasets you can read
  • Multiple modes: from simple chunk lookup to graph-aware Q&A
  • Hybrid retrieval: vectors find relevant pieces; graphs provide structure; LLMs compose answers
  • Safe by default: permissions are checked before any retrieval
  • Observability: telemetry is emitted for query start/completion

Where search fits

Use search after you’ve run .add and .cognify.
At that point, your dataset has chunks, summaries, embeddings, and a knowledge graph—so queries can leverage both similarity and structure.

How it works (conceptually)

  1. Scope & permissions
    Resolve target datasets (by name or id) and enforce read access.
  2. Mode dispatch
    Pick a search mode (default: graph-aware completion) and route to its retriever.
  3. Retrieve → (optional) generate
    Collect context via vectors and/or graph traversal; some modes then ask an LLM to compose a final answer.
  4. Return results
    Depending on mode: answers, chunks/summaries with metadata, graph records, Cypher results, or code contexts.

GRAPH_COMPLETION (default)