Hanzo AI
OpenapiGraph

Create answer

Answers a question from the whole graph and cites the assertions it rests on.

POST /v1/graph/answer

Addresshttps://api.hanzo.ai/v1/graph/answer
MethodPOST
OperationgraphAnswer
AuthAuthorization: Bearer $HANZO_API_KEY

Answers a question from the whole graph and cites the assertions it rests on.

It asks a model what each community's in-force facts say about the question, then asks once more for one answer from those findings. Every cited ID is checked to be a row of this graph, a failed model call fails the answer, and the calls are billed to the calling organization.

Time: as_of and as_known place the graph that is read; either absent is now.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
as_knownbodystringAsKnown is how much this plane had heard, RFC 3339: the answer as it would have been given then, which is what makes a past answer reproducible.
as_ofbodystringAsOf answers from the graph as it stood at an instant of the world, RFC 3339: what held then.
questionbodystringyesQuestion is what to answer, in words, 1000 bytes at most.

Response

StatusBodyMeaning
200graph.graphAnswerOutok
defaultproblem-detailsrefused

200 body — 15 fields.

FieldInTypeAlwaysDescription
answerbodystringAnswer is the answer, in prose.
as_knownbodystringAsKnown is the knowledge instant it was taken at, RFC 3339, the same way.
as_ofbodystringAsOf is the instant the graph was read at, RFC 3339: the one asked for, or the server's clock when none was.
askedbodyinteger (int64)Asked is how many communities were read.
assertionsbodystring[]Assertions are the IDs of every assertion the answer rests on, ascending.
callsbodyinteger (int64)Calls is how many model calls the answer made, each billed to the calling organization.
clippedbodybooleanClipped says the answer did not read all it gathered: a community held more facts than one call carries, or more members than one answer reads, and kept the…
communitiesbodyinteger (int64)[]Communities are every community the answer rests on, ascending.
findingsbodygraph.graphFinding[]Findings are the findings the answer cites, most relevant first.
findings[].assertionsbodystring[]Assertions are the IDs of the assertions it cites, each a row a read of this graph returns.
findings[].communitiesbodyinteger (int64)[]Communities are the communities of the facts it cites, at level 0 of the partition at AsOf — the ids POST /v1/graph/communities answers with.
findings[].scorebodyinteger (int64)Score is how much the model judged it helps, 1 to 100.
findings[].textbodystringText is what the model found, in its words.
groundedbodybooleanGrounded is false when no community held a fact bearing on the question, or the findings did not answer it.
skippedbodyinteger (int64)Skipped is how many were not, because one answer makes at most eight map calls and reads at most 2048 entities.

Failure carries the platform error shape — see Errors.

Examples

hanzo graph answer

Graph API · All Hanzo APIs · Interactive reference

How is this guide?

On this page