Get Most Relevant Facts for an Arbitrary Query
Search a Context Graph for facts that are relevant to a query
In this recipe, we demonstrate how to retrieve the most relevant facts from the knowledge graph using an arbitrary search query.
Search the graph
First, we perform an edge search on the knowledge graph using a sample query. The search takes the graph_uuid of the graph. For a user graph, use the graph_uuid that user.create returns, and store it next to your own user ID:
Build the fact list
Then, we get the edges from the first page of search results and construct our fact list. We also include the temporal validity data to each fact string:
Summary
We demonstrated how to retrieve the most relevant facts for an arbitrary query using the Zep client. Adjust the query and parameters as needed to tailor the search for your specific use case.