Skip to main content
POST
/
brain
/
retrieve
/
graph-qa
curl --request POST \
  --url https://api.atlas.bsyncs.com/brain/retrieve/graph-qa \
  --header 'X-API-Key: atlas_your_key_here' \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "Who owns the payments service?",
    "user_id": "user-123"
  }'
{
  "answer": "Alice owns the payments service. She is the backend lead and reports to the CTO.",
  "intermediate_steps": [
    {
      "query": "MATCH (p:Entity {name: 'payments service'})<-[:OWNS]-(person) RETURN person.name",
      "result": [{"person.name": "Alice"}]
    }
  ]
}
Use this endpoint for relational questions: ownership, dependencies, team structure, and traversal across multiple entities.
Use /brain/retrieve for general fact retrieval.

Authorizations

X-API-Key
string
required
Your Atlas API key. Format: atlas_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

Body

query
string
required
Natural language relational question.Good queries for this endpoint:
  • "Who owns the payments service?"
  • "What services depend on PostgreSQL?"
  • "How is Alice connected to the Q3 project?"
  • "What would break if we removed Redis?"
user_id
string
required
Namespace identifier. Overridden server-side from your API key.
max_hops
integer
default:"3"
Maximum relationship traversal depth in the knowledge graph.
2 = two-hop (A → B → C). 3 = three-hop (A → B → C → D).
Higher values surface deeper relationships but increase latency.

Response

answer
string
Grounded natural language answer derived from the knowledge graph.
Empty string if no relevant connected facts exist.
intermediate_steps
array
Debug information showing the generated Cypher queries and raw graph results. Useful for understanding empty or unexpected answers.
curl --request POST \
  --url https://api.atlas.bsyncs.com/brain/retrieve/graph-qa \
  --header 'X-API-Key: atlas_your_key_here' \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "Who owns the payments service?",
    "user_id": "user-123"
  }'
{
  "answer": "Alice owns the payments service. She is the backend lead and reports to the CTO.",
  "intermediate_steps": [
    {
      "query": "MATCH (p:Entity {name: 'payments service'})<-[:OWNS]-(person) RETURN person.name",
      "result": [{"person.name": "Alice"}]
    }
  ]
}