Chat with Knowledge Graph
POST
/api/v1/projects/{projectId}/chat
const url = 'https://api.yggy.tech/api/v1/projects/example/chat';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"message":"example","history":[],"options":{"tier":"fast"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.yggy.tech/api/v1/projects/example/chat \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "message": "example", "history": [], "options": { "tier": "fast" } }'Ask questions about your documents using the knowledge graph.
The AI agent will search the graph, find relevant entities and relationships, and synthesize an answer.
Examples of questions you can ask:
- “Who founded Acme Corp?”
- “What topics are discussed in my documents?”
- “How is John Smith related to the AI project?”
- “What are the main entities mentioned?”
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” projectId
required
string
Request Body
Section titled “Request Body ” Media type application/json
object
message
required
Your question about the knowledge graph
string
history
Previous conversation messages for context
Array<object>
object
role
required
Message role
string
content
required
Message content
string
options
object
tier
Model tier for response quality
string
Responses
Section titled “ Responses ”Chat response
Media type application/json
object
success
required
boolean
data
required
object
response
required
The AI’s answer to your question
string
citations
Documents referenced by graph tools
Array<object>
object
documentId
required
Document that grounded the answer
string
source
Caller-supplied source id when present
string
snippet
Evidence text when the tool returned it
string
toolCalls
Array<object>
object
name
required
string
input
result
usage
object
inputTokens
number
outputTokens
number
totalTokens
number
metadata
required
object
processingTimeMs
required
number
tierApplied
required
string
Example
{ "data": { "metadata": { "tierApplied": "fast" } }}Unauthorized
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
string
Example
{ "success": false}Project access denied
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
string
Example
{ "success": false}Internal server error
Media type application/json
object
success
required
boolean
error
required
object
message
required
string
code
string
Example
{ "success": false}