Skip to main content

langchain-assistanthub

PyPI version Downloads License: MIT CI

Crypto intelligence toolkit for LangChain agents. Real-time prices, risk scores, Monte Carlo backtests, AI forecasts, and more — powered by Assistant Hub.

Install

# Recommended: pin to current stable version
pip install langchain-assistanthub==0.1.4

# Or latest (for bleeding-edge users)
# pip install langchain-assistanthub

We're at v0.1.4 — pinned install recommended for stability. Check the changelog for updates!

Optional extras:

pip install langchain-assistanthub[x402]      # USDC on-chain payments
pip install langchain-assistanthub[swarm]     # LangGraph multi-agent
pip install langchain-assistanthub[notebook]  # JupyterLab + pandas + matplotlib for examples
pip install langchain-assistanthub[dev]       # pytest, ruff, mypy

Quick Start

Option A: Pre-built toolkit (recommended)

from langchain_assistanthub import AssistantHubToolkit
from langgraph.prebuilt import create_react_agent

toolkit = AssistantHubToolkit.from_api_key("ahk_your_key")
# or: toolkit = AssistantHubToolkit.from_env()   # reads ASSISTANT_HUB_API_KEY
tools = toolkit.get_tools()

agent = create_react_agent(model, tools)
result = agent.invoke({"messages": [
    {"role": "user", "content": "What's the risk score for SOL?"}
]})

Option B: Login with Hub credentials

from langchain_assistanthub import AssistantHubToolkit

toolkit = AssistantHubToolkit.from_hub_login("you@email.com", "password")
tools = toolkit.get_tools()

Option C: MCP auto-discovery

Dynamically discover tools from the MCP server — picks up new tools without upgrading the package:

from langchain_assistanthub import AssistantHubToolkit

tools = await AssistantHubToolkit.from_mcp(api_key="ahk_your_key")
agent = create_react_agent(model, tools)

Option D: MCP client directly

from langchain_assistanthub import AssistantHubMCPClient

client = AssistantHubMCPClient.from_api_key("ahk_your_key")
tools = await client.get_tools()

Available Tools

Tool Description Tier
live_prices Real-time prices for 8 major coins Free
fear_greed Crypto Fear & Greed Index Free
crypto_news Latest crypto headlines Free
risk_scores AI-computed composite risk scores Free
daily_pulse Daily macro threats + opportunities Free
ai_forecast AI price predictions (24h/7d) Premium
monte_carlo_backtest Strategy backtesting with Monte Carlo Premium
slippage_estimate Trade slippage estimation Premium
create_alert Price/change alerts Premium
strategy_analysis Full backtest + Monte Carlo + walk-forward Premium
execute_trade Paper/live trade execution Premium
check_approval Trade approval status Premium
price_monitor Live WebSocket price feed + alerts Free*

* Requires enable_price_feed=True and websockets package.

Advanced Usage

# Free tools only
toolkit = AssistantHubToolkit(api_key="...", include_premium=False)

# Specific tools
toolkit = AssistantHubToolkit(api_key="...", tools=["live_prices", "risk_scores"])

# Custom instance (local dev)
toolkit = AssistantHubToolkit(api_key="...", base_url="http://localhost:3000")

# With live price monitoring
toolkit = AssistantHubToolkit(
    api_key="...",
    enable_price_feed=True,
    price_feed_coins=["BTC", "ETH", "SOL"],
)

Anonymous Free Tier

No API key? You get 10 free calls per day on non-premium tools:

toolkit = AssistantHubToolkit()  # no api_key needed
tools = toolkit.get_tools()     # 10 calls/day, then 429 with upgrade CTA

Payment

Free tools work instantly. Premium tools require:

  • Pro/Premium JWT — unlimited calls
  • x402 USDC on Base — pay per call (no subscription needed)
  • HUB stakers — 50% off all x402 calls

Package Structure

sdk/langchain-python/
  src/langchain_assistanthub/
    __init__.py          # Public API + __all__
    _version.py          # Single source of truth for version
    toolkit.py           # AssistantHubToolkit (main entry)
    client.py            # AssistantHubMCPClient (MCP adapter)
    tools.py             # Individual tool wrappers
    price_feed.py        # WebSocket price feed
    price_monitor.py     # Price alert monitor
    strategy.py          # Strategy analysis tool
    execution.py         # Trade execution tools
  tests/
    test_toolkit.py      # Comprehensive test suite
  pyproject.toml         # hatchling build config

Example Notebooks

See sdk/notebooks/ for runnable examples:

Notebook Description Difficulty
01_sentiment_trader.py ReAct agent: sentiment → news → risk → trade Beginner
02_backtest_optimizer.py Grid search 4 strategies × 3 coins Intermediate
03_live_monitor.py WebSocket feed + auto AI analysis on big moves Advanced

Telemetry

This package sends a single anonymous ping on toolkit init to help us gauge adoption. No PII is collected — just a random ID, package version, and auth type (keyed vs anonymous).

Opt out:

export ASSISTANT_HUB_TELEMETRY_OPT_OUT=1

Links

Metadata

Release files for langchain-assistanthub 0.1.4

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

Source distribution (sdist)

Source distribution for langchain-assistanthub 0.1.4
File Size Uploaded
langchain_assistanthub-0.1.4.tar.gz 28.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-assistanthub 0.1.4
File Interpreter ABI Platform
langchain_assistanthub-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 61.8 kB

Release files / langchain_assistanthub-0.1.4.tar.gz

Download URL langchain_assistanthub-0.1.4.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0e996a8b0db21aa20cef15a2d495b0f27115a9b0e495493dbd1011cb39773da1
BLAKE2b-256 checksum
How to use checksums
7b1cb2d1e502071da2583a6f39448ae2d0de8eac11dafdf06ea91f5be76ecaa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release files / langchain_assistanthub-0.1.4-py3-none-any.whl

Download URL langchain_assistanthub-0.1.4-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2a3c51d55c97afca9256afea9391a935d9125f7c187768fd39cd316e8f7bd39
BLAKE2b-256 checksum
How to use checksums
cc398403a2c386dde27240a21a1225e9637d1418258e627d256eba92714a764c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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