Your first context query
Once your agent is connected, querying context is the same operation under the hood —
the query-context tool — whether you call it over MCP, REST, or an SDK. Here is the same
first query, three ways.
Replace <YOUR_API_KEY> with your fab_sk_… key and ws_<your_project> with your
workspace ID. Use the URLs shown in your console.
With Fabric installed as an MCP server (see the per-client guides), just ask your agent a question that depends on your data:
“What are the top accounts at churn risk?”
The agent calls the query-context tool; Fabric traverses your context graph and returns
the ranked entities and relationships. Nothing else to do — the result is grounded,
scope-pinned, and audited.
curl https://api.wexa.ai/v1/query-context \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -H "X-Wexa-Workspace: ws_<your_project>" \ -H "Content-Type: application/json" \ -d '{ "query": "top accounts at churn risk", "limit": 10 }'See Query context for the full request and response shape.
# pip install wexafrom wexa import Wexa
wexa = Wexa(api_key="<YOUR_API_KEY>")
context = wexa.context.query( workspace="ws_<your_project>", query="top accounts at churn risk",)print(context.entities)See the Python SDK guide.
// npm install @wexa/sdkimport { Wexa } from "@wexa/sdk";
const wexa = new Wexa({ apiKey: process.env.WEXA_API_KEY });
const context = await wexa.context.query({ workspace: "ws_<your_project>", query: "top accounts at churn risk",});console.log(context.entities);See the TypeScript / Node SDK guide.
What happened
Section titled “What happened”Your query ran through Fabric’s governed pipeline: it was authenticated, scope-pinned to
your workspace, validated, policy-checked, executed by graph traversal over your
context graph, post-processed (PII redaction), and recorded in the audit log. The response
carries a lifecycle_id you can use to trace and audit the call.
Because retrieval is graph traversal — not a full-corpus dump into the prompt — the result is the connected neighborhood your query actually needs, which keeps token cost low.
Next steps
Section titled “Next steps”- The Fabric MCP tools —
query-context,create-ontology,save-context,docs. - Simple vs Advanced mode — when writes and ontology proposals come into play.
