ReasonBlocks is a standard Python package distributed on PyPI. Installation is a singleDocumentation Index
Fetch the complete documentation index at: https://reasonblocks.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
pip command. This page covers the full installation process, all configuration options, and the environment variables the SDK reads at runtime.
Requirements
- Python 3.10 or later
langchain>=1.0httpx>=0.27
langchain and httpx are declared as required dependencies and are installed automatically with the SDK.
Install the package
Optional dependencies
ImportGraph — the Python import graph and blast-radius query tool — requires networkx. It is not installed automatically. If you plan to use ImportGraph, install it separately:
The rest of the SDK (middleware,
CodebaseMemory, E-trace injection, monitors) has no dependency on networkx. You only need it if you call ImportGraph directly.dev extras:
Set your API key
The SDK requires an API key to authenticate with the ReasonBlocks API. Get yours from the Quickstart page in the ReasonBlocks dashboard.Environment variable (recommended)
SetREASONBLOCKS_API_KEY in your environment. The SDK reads this variable automatically if you prefer not to pass the key in code.
Pass directly
You can also pass the key directly to the constructor:Configure the client
ReasonBlocks.__init__ accepts several keyword arguments beyond api_key. All are optional.
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | — | Your ReasonBlocks API key. Required. |
base_url | str | None | None | Override the API base URL. Use this for self-hosted deployments. |
token_budget | int | None | None | Maximum token count tracked per run by the state manager. |
monitor_names | list[str] | None | None | Monitor names to enable. When None, the server-side default suite runs. |
fsm_thresholds | dict | None | None | Override FSM transition thresholds (fast_threshold, slow_threshold, skip_threshold). |
model_routing | dict | None | None | Map FSM state names ("FAST", "SLOW") to model identifiers. |
e_traces_enabled | bool | True | Whether to retrieve and inject E-traces from the pattern store. |
customer_id | str | None | None | Scope E1 pattern retrieval to a specific customer. |
live_streaming_enabled | bool | True | Stream per-step telemetry to the API as each step completes. Set to False for fully offline operation. |
task_profile | str | "coding" | Monitor weight profile used server-side. Built-in options: "coding", "pr_review", "qa". |
Self-hosted deployments
If you run the ReasonBlocks API server yourself, point the SDK at it usingbase_url:
REASONBLOCKS_API_URL environment variable and read it in your code:
REASONBLOCKS_API_URL is not set, base_url is None and E-traces are disabled. This pattern is useful for local development and CI environments where the API server is not available.
Verify your installation
Run the following to confirm the package is installed and importable:ReasonBlocks instance and call rb.middleware() without running a full agent: