langchain-alphai
LangChain tools and a retriever for AlphaAI — AI-scored, ticker-linked financial news and SEC Form 4 insider events, built for AI agents and trading bots.
Every article on the AlphaAI feed is enriched before you see it: per-ticker impact analysis, one of 14 categories, and a 1-10 market-relevance score. The components here fetch and filter that feed — no scraping, no scoring of your own.
AlphaAINewsSearch— the scored news feed with ticker / category / relevance filtersAlphaAIInsiderNews— SEC Form 4 insider events with a structured who-sold-what blockAlphaAITickerSentiment— 7-day bullish/neutral/bearish rollup for one tickerAlphaAIInsiderSummary— 30-day insider buy/sell rollup for one tickerAlphaAINewsRetriever— the feed as LangChainDocuments for RAG pipelines
Install
pip install langchain-alphai
Requires Python 3.10+.
Authentication
Create an API key at alphai.io/developers — the
free tier works without a card. Export it as ALPHAI_API_KEY, or pass
api_key=... to any component.
export ALPHAI_API_KEY="ak_live_..."
Use the tools in an agent
from langchain.agents import create_agent
from langchain_alphai import (
AlphaAIInsiderNews,
AlphaAIInsiderSummary,
AlphaAINewsSearch,
AlphaAITickerSentiment,
)
agent = create_agent(
model="claude-sonnet-4-5",
tools=[
AlphaAINewsSearch(),
AlphaAIInsiderNews(),
AlphaAITickerSentiment(),
AlphaAIInsiderSummary(),
],
)
agent.invoke({"messages": [("user", "Are NVDA insiders selling, and does the news explain why?")]})
Each tool also works standalone:
from langchain_alphai import AlphaAINewsSearch
tool = AlphaAINewsSearch(min_relevance=7) # instance defaults, overridable per call
tool.invoke({"symbol": "NVDA", "max_results": 5})
{
"results": [
{
"uid": "788e477c66f3849b",
"url": "https://...",
"title": "Nvidia beats on data-center revenue",
"summary": "Q2 revenue came in above consensus...",
"source": "Example Wire",
"source_domain": "example.com",
"published_at": "2026-08-14T12:30:00+00:00",
"tickers": ["NVDA"],
"category": "earnings",
"relevance_score": 8,
}
]
}
Insider events add a structured insider block — side, shares, average price,
total dollar value, who traded, and whether the sale was a pre-planned 10b5-1:
from langchain_alphai import AlphaAIInsiderNews
AlphaAIInsiderNews().invoke({"symbol": "NVDA", "min_relevance": 7})
On the insider feed the relevance score is deterministic from the event's
summed dollar value, so min_relevance works as an "only large trades" dial.
Use the retriever for RAG
The query is a ticker symbol (crypto uses BTC-USD, foreign listings the Yahoo
suffix, e.g. VOD.L); an empty query returns the market-wide feed.
from langchain_alphai import AlphaAINewsRetriever
retriever = AlphaAINewsRetriever(min_relevance=7, k=5)
docs = retriever.invoke("NVDA")
docs[0].page_content # title + summary
docs[0].metadata # tickers, category, relevance_score, url, source, ...
Filters
| Parameter | Where | Meaning |
|---|---|---|
symbol |
news + insider tools | One ticker; share-class siblings included on the insider feed |
category |
news tool, retriever | One of 14: earnings, mergers_acquisitions, regulation, macro_economy, sector_analysis, market_movers, technology, commodities, crypto, ipo, geopolitics, insider, corporate_actions, other |
min_relevance |
news + insider tools, retriever | 1-10 floor; 7+ keeps only high-signal articles |
collapse_stories |
news tool, retriever (constructor) | Collapse syndicated same-story coverage into one item |
max_results / k |
all | Cap on returned items |
include_analysis |
news tool (constructor) | Add per-ticker AI sentiment + impact summary to each result |
Async
Every tool implements ainvoke, and the retriever _aget_relevant_documents,
over the SDK's native async client:
await AlphaAINewsSearch().ainvoke({"symbol": "NVDA"})
Rate limits
Limits are per AlphaAI account, two-layer (per-minute burst + per-day volume): Free 20/min · 100/day, Basic 60/min · 10,000/day, Pro 150/min · 100,000/day. News-archive depth is tiered too (30/90 days / full archive). The underlying alphai-sdk retries 429s with backoff automatically.
Links
- Developer guide: https://alphai.io/developers
- API reference: https://api.alphai.io/api/schema/
- MCP server (same feed, for MCP-speaking agents): https://alphai.io/mcp
AlphaAI output is AI-generated financial information for research, not investment advice — see alphai.io/terms.
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 langchain_alphai-0.1.0.tar.gz.
File metadata
- Download URL: langchain_alphai-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4daa2d25b0303902af1bd0b080ff3232fabb9f0b1965b963e6dacf68fbf38e45
|
|
| MD5 |
852bc169a4ea425520d2532fabe34638
|
|
| BLAKE2b-256 |
2e05705a9a0b94cb5e4af223a8dab3700f1fdf858186992b66c4a08224a8111d
|
Provenance
The following attestation bundles were made for langchain_alphai-0.1.0.tar.gz:
Publisher:
release.yml on makeev/langchain-alphai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_alphai-0.1.0.tar.gz -
Subject digest:
4daa2d25b0303902af1bd0b080ff3232fabb9f0b1965b963e6dacf68fbf38e45 - Sigstore transparency entry: 2464794973
- Sigstore integration time:
-
Permalink:
makeev/langchain-alphai@ca4efafd1d0cd07b0efde5f839b7b3e7a4decb9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/makeev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca4efafd1d0cd07b0efde5f839b7b3e7a4decb9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file langchain_alphai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_alphai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16da38427f05d675e5b0596d5a4e978d23592f92eb5aeb908d0aca5a9eb72eb8
|
|
| MD5 |
a9c14341d2d5f892b3c2f9a54867ca8e
|
|
| BLAKE2b-256 |
be810eb761cf79be5f1e43a9fdbbc9ad6b925a43ee276b9fc5c415760f6b3e68
|
Provenance
The following attestation bundles were made for langchain_alphai-0.1.0-py3-none-any.whl:
Publisher:
release.yml on makeev/langchain-alphai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_alphai-0.1.0-py3-none-any.whl -
Subject digest:
16da38427f05d675e5b0596d5a4e978d23592f92eb5aeb908d0aca5a9eb72eb8 - Sigstore transparency entry: 2464795023
- Sigstore integration time:
-
Permalink:
makeev/langchain-alphai@ca4efafd1d0cd07b0efde5f839b7b3e7a4decb9b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/makeev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca4efafd1d0cd07b0efde5f839b7b3e7a4decb9b -
Trigger Event:
push
-
Statement type: