Skip to main content

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.

Release files for maha-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maha-sdk 0.1.0
File Size Uploaded
maha_sdk-0.1.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for maha-sdk 0.1.0
File Interpreter ABI Platform
maha_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / maha_sdk-0.1.0.tar.gz

Download URL maha_sdk-0.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c0da8a1a5514a6da4ab13fe693cbd715fee88f7712ed539ec00322ee57034a5b
BLAKE2b-256 checksum
How to use checksums
2c043df92aff664fc9d09ea992b2d7441529468b4907717ce404b3843e1ac3bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / maha_sdk-0.1.0-py3-none-any.whl

Download URL maha_sdk-0.1.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77f5e2a008619c7bb44ca4484795cdc3c62c4a8aad3da8ed12ecd284f1840b79
BLAKE2b-256 checksum
How to use checksums
74fea28e7a9fb0e64da02fd02e00ab7472a012b239f3c40291eb7c768372bcc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page