Skip to navigation

Query a graph

Alpha

Experimental. Retrieves the graph records for a natural-language question about a graph with a read-only retrieval loop. 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. Set stream to true to get the retrieval calls as server-sent events. The default mode is fast. fast: A decision model selects the types of search for each round and stops when it has enough context. The query runs at most 3 search rounds. deep: A model plans its own searches. It can page through complete lists and read more records before it answers. A project with a BYOM configuration supports only deep. A BYOC deployment supports only deep. The operation is experimental and in closed release. Zep enables the operation only for select accounts. The request, the response, the events, and the modes of the operation can change. A request from an account without access returns 404 not_found. To get access, contact support@getzep.com.

Authentication

AuthorizationApi-Key

Type “Api-Key” followed by a space and the project API key.

Request

Graph query
graph_uuidslist of stringsRequired
The graph UUIDs to query. The current release accepts one UUID.
querystringRequired

The natural-language question about the graph.

streamfalseRequired

When true, return the retrieval calls as server-sent events.

generate_answerbooleanOptional

When true, a model also writes an answer from the retrieved records. The default is false: the response has the records and no answer.

guidancestringOptional
Optional caller guidance for the answer. The agent treats it as untrusted text.
modeenumOptional

The retrieval mode. The default is fast. fast: A decision model selects the types of search for each round and stops when it has enough context. The query runs at most 3 search rounds. deep: A model plans its own searches. It can page through complete lists and read more records before it answers. A project with a BYOM configuration supports only deep. A BYOC deployment supports only deep.

Allowed values:

Response

answerstringOptional

The answer with citation handles removed. Present only when the request sets generate_answer to true.

citationsobjectOptional
The UUIDs of the graph items cited by the answer. The lists are empty when the response has no answer.
resultsobjectOptional
The distinct graph records retrieved during the query.
truncatedbooleanOptional
Whether the record limit omitted any results.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
413
Content Too Large Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error