Skip to main content
POST
Get context
This endpoint retrieves relevant context from your knowledge graph based on a textual prompt. Understanding how the system processes your prompt is critical to achieving best-in-class results.
  1. Similarity search: The knowledge graph is first searched to find nodes that are most similar to the prompt. This ensures that only the most relevant information is considered for retrieval.
  2. Optional reranking: If rerank is enabled, the system also analyzes the prompt for example for bullet points or enumerated instructions (e.g., “1) Look at this, 2) Include this as well, 3) This is also important”). These bullets are used to rerank the retrieved nodes so that the final context better reflects the user’s priorities and instructions.

Authorizations

X-API-Key
string
header
required

API key for the Qontext API

Body

application/json
prompt
string
required

The prompt to retrieve context for.

Example:

"Give me the following information regarding Harry Potter. 1) Who is he?, 2) What is his relationship with Gryffindor Inc., Weasleys Wizard Wheezes, and Ollivanders?"

limit
number
required

Number of nodes to consider at the first level of the knowledge vault.

Example:

5

Response

Context successfully retrieved