Skip to main content

Retrieving AI-Ready Data from Qontext

To make your AI workflows smarter, you first need the right context at the right time. Qontext lets you retrieve structured, relevant company data for any prompt or workflow, so your AI always has the information it needs. You can use retrieval to:
  • Supply precise context to LLMs before generating responses.
  • Automate workflows in n8n, make, Zapier, or custom agents.
  • Combine multiple sources into a single, coherent context summary.

How Retrieval Works

Qontext delivers the right context through a 4-step process:
  1. Semantic Analysis: Understands the intent and information needs from your prompt.
  2. Graph Traversal: Explores entities and their relationships in your Context Vault.
  3. Context Assembly: Compiles relevant data from connected sources into a list of facts and information.
  4. Relevance Scoring & Reranking: Prioritizes the most useful information, ensuring accuracy and completeness.

Retrieval Methods

You can retrieve context directly via the API in your codebase or in various workflow builders:

Example: Retrieve Context via API

curl --request POST \
  --url https://api.qontext.ai/v1/retrieval \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: q_sk_***************' \
  --data '{
    "workspaceId": "ws_123e4567-e89b-12d3-a456-426614174000",
    "knowledgeGraphId": "kg_681c0068-b589-4923-ac4a-73040fab7a45",
    "prompt": "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": 5,
    "depth": 1,
    "rerank": true
  }'
Response
[
  "*Harry Potter -> Gryffindor Inc. (works_at)*: Harry Potter works at Gryffindor Inc. as Project Lead.",
  "*Harry Potter*: Contact with email [email protected]; entered 2025-09-01; lead lifecycle stage.",
  "*Harry Potter -> Weasleys Wizard Wheezes (advisor_to)*: Advising on new product launches.",
  "*Weasleys Wizard Wheezes*: Magical joke shop co-founded by Fred and George Weasley.",
  "*Harry Potter -> Ollivanders (consulted_for)*: Consulted on wand customization strategies.",
  "*Ollivanders*: Wand-making company with a legacy spanning centuries."
]