Basic Search
The simplest way to search is using thesearch() method, which returns relationship edges:
Search Methods
Graphiti uses hybrid search combining multiple retrieval methods:Semantic Similarity
Finds results based on meaning using vector embeddings
BM25 Full-Text
Finds results based on keyword matching
Graph Traversal (BFS)
Explores connected nodes in the graph
Reranking
Combines and reorders results for optimal relevance
Search Parameters
Center Node Reranking
Rerank results based on their graph distance from a specific node:Advanced Search with Configurations
For more control, use thesearch_() method with custom search configurations:
Search Configuration Recipes
Graphiti provides pre-configured search recipes optimized for different scenarios:Edge Search Recipes
Search for relationships between entities:Node Search Recipes
Search for entities:Combined Search Recipes
Search across nodes, edges, episodes, and communities:Community Search Recipes
Search for clusters of related entities:Custom Search Configurations
Build your own search configuration:Search Configuration Options
Search Methods
- Edges
- Nodes
- Episodes
- Communities
EdgeSearchMethod.cosine_similarity- Semantic vector searchEdgeSearchMethod.bm25- Full-text keyword searchEdgeSearchMethod.bfs- Breadth-first graph traversal
Reranking Methods
RRF
Reciprocal Rank Fusion - Combines multiple search methods by rank
MMR
Maximal Marginal Relevance - Balances relevance and diversity
Node Distance
Reranks by graph distance from a center node
Cross Encoder
Neural reranking for highest accuracy
Episode Mentions
Reranks by frequency across episodes
Search Filters
Filter results by group, time, or custom criteria:Search Results
Thesearch_() method returns a SearchResults object with multiple result types:
Performance Tips
Limit Results
Set appropriate
limit values to reduce latencyUse Group IDs
Filter by
group_ids to search specific partitionsSimple Configs
Start with RRF reranking before using cross-encoder
Min Scores
Set
reranker_min_score to filter low-quality resultsExample: Multi-Stage Search
Combine different search strategies:Next Steps
Adding Episodes
Learn how to add content to your knowledge graph
Custom Entities
Define domain-specific entity types for better search