Querying a Graph
Retrieve the graph records for a natural-language question
graph.query is experimental. Its request, response, and events can change. Zep enables the operation for each account. A request from an account without access returns 404 not_found. To get access, contact support@getzep.com.
graph.query takes a natural-language question about one graph. The operation runs a read-only retrieval loop. The response contains at most 300 records in results. When the query returns more than 300 records, the server keeps cited records first in citation order. The server then keeps other records in the order that retrieval calls first returned them. The response sets truncated to true when the server omits records.
By default, the response has the records and no answer. When the request sets generate_answer to true, the response also includes an answer that a model writes from the records and citations to the graph items.
Select a mode
The mode field selects the retrieval loop. The default is fast.
A value other than fast or deep returns 400 invalid_request with param set to mode.
BYOM and BYOC
fast mode uses a Zep decision model. It does not support BYOM configurations or BYOC deployments.
- When the project has a BYOM configuration, set
modetodeep. All model calls of the query then go to your BYOM provider. Afastrequest returns409 conflictwith the message “Fast mode does not support BYOM configurations. Set mode to deep.” - In a BYOC deployment, set
modetodeep. Afastrequest returns409 conflictwith the message “Fast mode is not available in a BYOC deployment. Set mode to deep.” - When the BYOM configuration has no compatible model, a
deeprequest returns409 conflict.