code_search
Search an indexed code graph for symbols, call paths, dependencies, impact, architecture, and index changes, or ask plain-language questions about source code.
Instructions
Search Cognee's indexed code graph with a structured operation.
This tool is for source-code structure, symbols, call/dependency paths,
impact, architecture, and index changes. It does not search conversational
memory. Choose an operation and pass its operation-specific fields in
arguments. For example, use operation="query_facts" with
arguments={"kinds": ["module", "symbol"], "limit": 100}, or
operation="impact_analysis" with arguments={"seeds": ["UserService"]}.
For a question in plain words ("how does checkout work?"), use
operation="ask" with the question as query: it returns matching
symbols, entry-point flows, their neighbourhood and file:line citations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Optional seed text, used by explore when no explicit seed is supplied in arguments, and the text or question for search and ask. | |
| top_k | No | Maximum number of results to return (default: 15). | |
| datasets | No | Comma-separated Cognee dataset names containing indexed code. | |
| arguments | No | Operation-specific structured arguments. Do not include an "operation" key here; select it with the operation parameter. | |
| operation | Yes | Code-graph operation: query_facts, explore, traverse, find_path, impact_analysis, insights, architecture, delta, capabilities, search, neighbors, subgraph, flows, hubs, or ask. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |