MemNexus
Reference

GraphRAG API

Graph-based retrieval augmented generation endpoints

Graph-based retrieval augmented generation endpoints

GET /api/graphrag/explain

Explain a GraphRAG query

Query parameters:

ParameterTypeRequiredDescription
queryIdstringYesThe query ID to explain

Response: 200 Query explanation retrieved successfully

FieldTypeRequiredDescription
dataobjectNoQuery explanation details

Example:

curl -X GET "https://api.memnexus.ai/api/graphrag/explain" \
  -H "Authorization: Bearer cmk_live_xxx.yyy"

POST /api/graphrag/query

Execute a GraphRAG query

Request body:

FieldTypeRequiredDescription
querystringYesGraphRAG query string
maxDepthintegerNoMaximum graph traversal depth (alias: depth)
depthintegerNoGraph traversal depth (deprecated, use maxDepth)
limitintegerNoMaximum number of results to return
includeRelationshipsbooleanNoInclude relationship data in response

Response: 200 GraphRAG query results

FieldTypeRequiredDescription
dataGraphRAGQueryResponseNo

Example:

curl -X POST "https://api.memnexus.ai/api/graphrag/query" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/graphrag/query-communities

Query communities

Request body:

FieldTypeRequiredDescription
querystringYes
limitintegerNo

Response: 200 Community query results

FieldTypeRequiredDescription
dataobject[]No

Example:

curl -X POST "https://api.memnexus.ai/api/graphrag/query-communities" \
  -H "Authorization: Bearer cmk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{}'