maha-sdk
Zero-dependency Python client for the Maha Strategies API, with native tool adapters for LangChain and CrewAI.
pip install maha-sdk
Client
from maha_sdk import MahaClient
client = MahaClient(api_key="maha_live_sk_...")
client.balance()
client.compress(task="brief the board", documents=[{"id": "d1", "text": "..."}], token_budget=4000)
client.verify_claim("chronobiological-entrainment")
client.call_mcp_tool("mcp_srv_...", "tools/calculateRiskScore", {"portfolioId": "pf_1"})
Errors are typed, so an agent can act on them rather than parse strings:
from maha_sdk import MahaAuthenticationError, MahaCreditError
try:
client.compress(...)
except MahaCreditError as error:
print(f"Out of credits. Top up at {error.purchase_url}")
except MahaAuthenticationError:
print("The API key is invalid or revoked.")
LangChain
pip install 'maha-sdk[langchain]'
from langgraph.prebuilt import create_react_agent
from maha_sdk import MahaClient
from maha_sdk.langchain import MahaToolkit
tools = MahaToolkit(MahaClient(api_key="maha_live_sk_...")).get_tools()
agent = create_react_agent(llm, tools)
CrewAI
pip install 'maha-sdk[crewai]'
from crewai import Agent
from maha_sdk import MahaClient
from maha_sdk.crewai import maha_tools
researcher = Agent(
role="Researcher",
goal="Ground every claim in a cited source",
tools=maha_tools(MahaClient(api_key="maha_live_sk_...")),
)
Tools
| Tool | Purpose |
|---|---|
maha_compress_context |
Compile documents into a context pack that fits a token budget |
maha_verify_claim |
Resolve a published claim, its evidence status, and its sources |
maha_credit_balance |
Remaining API credits for the configured key |
maha_verify_claim returns the claim's status alongside its summary, and says
plainly when a record is not evidence-backed. The status label is material:
VERIFIED and SOURCED identify evidence status, while ILLUSTRATIVE and
UNVERIFIED must not be treated as established fact. An agent that cannot see
the label will present the latter as though it were the former.
Design notes
No runtime dependencies. This installs into agent environments that already pin their own HTTP stack, so it must not force a resolution against it, and it cannot carry a transitive vulnerability into someone else's agent. Framework packages are optional extras.
Payment is never autonomous. A depleted key raises MahaCreditError with a
purchase URL. Buying credits requires a human to authorize the payment; no
method here can charge anyone.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maha_sdk-0.1.0.tar.gz.
File metadata
- Download URL: maha_sdk-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0da8a1a5514a6da4ab13fe693cbd715fee88f7712ed539ec00322ee57034a5b
|
|
| MD5 |
9c6174a9c8182c697401fc3e5b555cae
|
|
| BLAKE2b-256 |
2c043df92aff664fc9d09ea992b2d7441529468b4907717ce404b3843e1ac3bc
|
File details
Details for the file maha_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maha_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77f5e2a008619c7bb44ca4484795cdc3c62c4a8aad3da8ed12ecd284f1840b79
|
|
| MD5 |
c027aba5411111066e13b6d0d1619eab
|
|
| BLAKE2b-256 |
74fea28e7a9fb0e64da02fd02e00ab7472a012b239f3c40291eb7c768372bcc0
|