Search Types Reference
Cognee provides a variety of search types to query your knowledge graph in different ways. This reference guide explains each search type, its purpose, and how to use it effectively.Available Search Types
Cognee offers the following search types through theSearchType
enum:
Basic Search Syntax
All search types use the same basic function call pattern:Detailed Search Type Descriptions
SUMMARIES
TheSUMMARIES
search type retrieves summarized information from your knowledge graph.
- Getting concise overviews of topics
- Summarizing large amounts of information
- Quick understanding of complex subjects
INSIGHTS
TheINSIGHTS
search type discovers connections and relationships between entities in your knowledge graph.
- Discovering how entities are connected
- Understanding relationships between concepts
- Exploring the structure of your knowledge graph
CHUNKS
TheCHUNKS
search type retrieves specific facts and information chunks from your knowledge graph.
- Finding specific facts
- Getting direct answers to questions
- Retrieving precise information
COMPLETION
TheCOMPLETION
search type uses retrieval-augmented generation to provide comprehensive answers based on your knowledge graph.
- Getting detailed explanations
- Combining multiple pieces of information
- Generating comprehensive answers
GRAPH_COMPLETION
TheGRAPH_COMPLETION
search type leverages the graph structure to provide more contextually aware completions.
- Complex queries requiring graph traversal
- Questions that benefit from understanding relationships
- Queries where context from connected entities matters
GRAPH_SUMMARY_COMPLETION
TheGRAPH_SUMMARY_COMPLETION
search type combines graph traversal with summarization to provide concise but comprehensive answers.
- Getting summarized information that requires understanding relationships
- Complex topics that need concise explanations
- Queries that benefit from both graph structure and summarization
GRAPH_COMPLETION_COT
TheGRAPH_COMPLETION_COT
search type combines graph traversal with chain of thought to provide answers to complex multi hop questions.
- Multi-hop questions that require following several linked concepts or entities
- Tracing relational paths in a knowledge graph while also getting clear step-by-step reasoning
- Summarizing completx linkages into a concise, human-readable answer once all hops have been explored
GRAPH_COMPLETION_CONTEXT_EXTENSION
TheGRAPH_COMPLETION_CONTEXT_EXTENSION
search type combines graph traversal with multi-round context extension.
- Iterative, multi-hop queries where intermediate facts aren’t all present upfront
- Complex linkages that benefit from multi-round “search → extend context → reason” loops to uncover deep connections.
- Sparse or evolving graphs that require on-the-fly expansion—issuing follow-up searches to discover missing nodes or properties
CODE
TheCODE
search type is specialized for retrieving and understanding code-related information from your knowledge graph.
- Code-related queries
- Programming examples and patterns
- Technical documentation searches
CYPHER
TheCYPHER
search type allows you to execute raw Cypher queries directly against your graph database.
- Executing precise graph queries with full control
- Leveraging Cypher features and functions
- Getting raw data directly from the graph database
- Only supported with Neo4j, Memgraph, and FalkorDB (not NetworkX)
- Requires knowledge of Cypher query language
- Returns raw query results without additional processing
Advanced Usage
Combining Search Types
For complex queries, you might want to use multiple search types in sequence:Search with Filters
You can filter search results by node type or other properties:Choosing the Right Search Type
Here’s a quick guide to help you choose the most appropriate search type:If you want to… | Use this search type |
---|---|
Get a quick summary | SUMMARIES |
Discover relationships | INSIGHTS |
Find specific facts | CHUNKS |
Get detailed explanations | COMPLETION |
Understand complex relationships | GRAPH_COMPLETION |
Get concise answers about complex topics | GRAPH_SUMMARY_COMPLETION |
Answers complex multi-hop questions | GRAPH_COMPLETION_COT |
Extend context iteratively to answer complex questions | GRAPH_COMPLETION_CONTEXT_EXTENSION |
Find code examples or technical information | CODE |
Execute raw Cypher queries against the graph database | CYPHER |
Examples
Example 1: Research Paper Analysis
Example 2: Code Documentation
Troubleshooting
If you’re not getting the expected search results:- No results: Make sure you’ve added relevant content and run
cognee.cognify()
- Irrelevant results: Try refining your query or using a different search type
- Missing connections: Your knowledge graph might not have captured the relationships you’re looking for; try adding more relevant content
Next Steps
- Learn how to visualize your knowledge graph
- Explore Cognee Tasks for specific use cases
- See how to build custom pipelines for specialized search functionality