Python SDK
The Python SDK wraps the Context API so you can query Fabric from any Python agent or backend without hand-rolling HTTP.
Install
Section titled “Install”pip install wexaQuickstart
Section titled “Quickstart”from 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)api_key— a project-scopedfab_sk_…key. Generate one in Simple Mode. Prefer reading it from the environment or your secret manager rather than hardcoding it.workspace— your workspace ID (ws_<your_project>); it pins the call’s scope.
What you get back
Section titled “What you get back”context.query(...) returns the ranked entities, relationships, and facts that ground the
query — the same connected neighborhood the MCP query-context tool
returns — along with a lifecycle_id for tracing and audit.
Configuration
Section titled “Configuration”| Option | Purpose |
|---|---|
api_key |
Project-scoped credential (fab_sk_…). |
| Base URL | Defaults to the managed cloud; point it at your deployment’s apiBaseUrl (from connection-info) for on-prem / air-gapped. |
