getzep / graphiti

Build and query dynamic, temporally-aware Knowledge Graphs
https://help.getzep.com/graphiti
Apache License 2.0
1.4k stars 75 forks source link

Number of Neo4j Connections Optimizations #199

Closed prasmussen15 closed 1 month ago

prasmussen15 commented 1 month ago

[!IMPORTANT] Optimize Neo4j connections by setting READ_ACCESS and refactor search functions to use query vectors for improved performance in search.py and search_utils.py.

  • Neo4j Connection Optimization:
    • Set default_access_mode=neo4j.READ_ACCESS in get_mentioned_nodes(), get_communities_by_nodes(), edge_fulltext_search(), edge_similarity_search(), node_fulltext_search(), node_similarity_search(), community_fulltext_search(), and community_similarity_search() in search_utils.py.
  • Search Function Refactoring:
    • Use query_vector for similarity searches in search(), edge_search(), node_search(), and community_search() in search.py.
    • Remove embedder parameter from edge_search(), node_search(), and community_search() in search.py.
  • Miscellaneous:
    • Update logging to include latency in search() in search.py.
    • Refactor node_distance_reranker() and episode_mentions_reranker() to use UNWIND for batch processing in search_utils.py.

This description was created by Ellipsis for e4dacd15fd93d2971924287e9cfe18febb4f6b92. It will automatically update as commits are pushed.