Query a graph
Experimental. Smart Query retrieves multi-hop context from a graph in one call. Some agent tasks need multi-hop retrieval: the agent does not know in advance what to search for, so it must retrieve a record, learn from it, and then plan the next retrieval. Zep explores the graph with searches and graph traversals, and it uses the records from each retrieval round to plan the next round. By default, the response has the retrieved records and no answer. Set generate_answer to true to also get an answer that a model writes from the records, with the cited graph items and an answer_status of answered, partial, or refused. Set stream to true to get the retrieval calls as server-sent events. The default mode is fast. fast: Optimized for latency. Retrieves the context for multi-hop queries. The query runs at most 3 search rounds. deep: Runs more retrieval steps, so it can retrieve complete lists, such as the records for a count. It takes longer than fast mode. BYOM and BYOC projects can use fast mode when they have a configured decision model. Other projects can use fast mode without a decision model. BYOM and BYOC projects without a decision model must use deep mode. The operation is experimental and available to every Zep account. The request, the response, the events, and the modes of the operation can change.
Authentication
Type “Api-Key” followed by a space and the project API key.
Request
The natural-language query for the graph.
When true, return the retrieval calls as server-sent events.
When true, a model also writes an answer from the retrieved records. The default is false: the response has the records and no answer.
The retrieval mode. The default is fast. Fast mode is optimized for latency. It retrieves the context for multi-hop queries. The query runs at most 3 search rounds. A BYOM project needs a decision model for fast mode. A BYOC deployment needs a decision model (SystemOne or Gemini Decisions) for fast mode. Deep mode runs more retrieval steps, so it can retrieve complete lists, such as the records for a count. It takes longer than fast mode.