Physical-bottleneck, reverse-consensus investment analysis for every market — an LLM agent chain that traces any asset (A-share / HK / US stocks, crypto) to its supply-chain constraint and refuses to chase narrative-driven tops. Bring your own LLM key.
Project description
🧠 cyberagent
Physical-bottleneck, reverse-consensus investment analysis — for every market
A chain of LLM agents that traces any asset down to the physical constraint that caps its industry, checks whether the market has already priced it, and refuses to chase a narrative-driven top. Stocks (A-share / HK / US) and crypto (token / contract). Bring your own LLM key.
🌐 Language / 语言
English | 简体中文
🚧 Early release. The analysis engine works end-to-end today; the public API may still evolve before
1.0.
What makes it different
Most open-source "AI analyst" frameworks ask "is this a good company?" and return a textbook SWOT. cyberagent asks a sharper, falsifiable, reverse-consensus question, in a fixed order:
Physical bottleneck → uniqueness → commercialization → financial elasticity → consensus correction
Where is the physical constraint in this asset's supply chain? Is it unique? Can it be monetized? Does it have non-linear financial elasticity? And has the market already priced it in?
It is built on one idea from Leopold Aschenbrenner's Situational Awareness: AI scaling is a massive industrial process, bottlenecked by physical inputs — power, transformers, HBM, CoWoS packaging, specific materials. cyberagent operationalizes that thesis: it walks the supply chain down to the link "no amount of money can buy", and then applies hard anti-narrative discipline so it doesn't mistake a headline-driven spike for an opportunity.
It does not predict prices. It produces facts, a falsifiable logic chain, and monitorable physical signals — the final decision is yours.
Intellectual foundations
cyberagent stands on two ideas and turns them into a reproducible, falsifiable agent chain.
Leopold Aschenbrenner — Situational Awareness (the why)
In Situational Awareness: The Decade Ahead,
Aschenbrenner argues that AI scaling is a massive industrial process, not a
software one: every frontier model needs a bigger cluster, then bigger power
plants, then bigger fabs. So the binding limits are physical — power,
transformers, HBM, CoWoS packaging, specific materials — and effective compute
compounds at roughly an order of magnitude (OOM) per year (GPT‑2 → GPT‑4 → ~2027
AGI). The people with situational awareness build conviction from the trendlines
years before consensus prices them. cyberagent treats the market as that
physical system; the thesis is distilled in references/sa-canon.md.
Serenity & Crux — the bottleneck method (the how)
The practitioner discipline comes from supply-chain bottleneck hunters such as Serenity (@aleabitoreddit) and Crux Capital. Instead of asking "which stock goes up?", they take the machine apart and look for the chokepoint:
What does the machine actually look like? Which part of its BOM is the hardest to replace? If one supplier stopped shipping tomorrow, how long would the whole chain wait?
- Serenity is narrow and deep — find one decisive choke point and concentrate.
- Crux is wide and disciplined — map a ~6-layer stack and size each layer by execution certainty, separating proven executors from early optionality.
cyberagent distills that discipline into a fixed, falsifiable chain that any LLM can run across any market.
We borrow their method — tracing a supply chain to its physical chokepoint, asking "where does the chain break", separating execution from optionality. We do not impersonate them, quote them, or present their positions as fact.
How it works
The chain is a telescope — it zooms from physical reality down to the specific, actionable name, one grounded LLM call per stage (each reads the upstream reports):
Positioning → Physical World → Human Development → Economics → Company Financials → Leaders & Verdict
That telescope is how the five-step method above (bottleneck → uniqueness → commercialization → elasticity → consensus) actually gets executed.
flowchart LR
IN["Any asset<br/>NVDA · 600519 · 0700 · BTC · 0x…"] --> CL{{AssetClassifier}}
CL --> AD["Data adapters<br/>yfinance · CoinGecko · DefiLlama<br/>+ price action + analyst consensus"]
AD --> P0["Phase 0 · Positioning<br/>core business → physical-world position"]
P0 --> D1[physical] --> D2[human_dev] --> D3[economics] --> D4[financials] --> D5[leaders]
D5 --> R["AnalystReport<br/>ACCUMULATE · HOLD · REDUCE · AVOID"]
Phase 0 — Positioning. From the fundamentals, lock down what the company actually sells, then pin it to a specific layer of the physical / AI supply chain (materials → substrate → equipment → packaging → device → module → system → end demand) and a concrete machine (e.g. a GB300 NVL72 rack, a 1.6T optical link).
Five departments, run in sequence, each reading the upstream reports:
| Dept | key |
What it does |
|---|---|---|
| 🪨 Physical World | physical |
Locate the binding bottleneck on the SA ladder (power > CoWoS/HBM > raw logic); classify the asset as owner / adjacent / derivative / none. Non-owner ⇒ downgraded, scarcity-rent logic forbidden. |
| 🌍 Human Development | human_dev |
Place the demand on the AGI / OOM arc — early (runway left) or mature/peaked? |
| 💱 Economics | economics |
ore-seller vs processor; decompose the price move into earnings-growth vs multiple-expansion; detect valuation-framework switches; is it already priced (Gray Rhino vs loud consensus)? |
| 📈 Company Financials | financials |
Fundamentals + financial elasticity (linear vs non-linear); attribute earnings anomalies before flagging them. |
| 🎯 Leaders & Verdict | leaders |
Two-axis verdict — bottleneck identity (a) vs pricing position (b) — steelman + Munger inversion, monitorable exit signals, final decision. |
The discipline (why it won't chase a top)
This is the part textbook frameworks skip:
- Real-time grounding — with Gemini it searches why a price moved (the catalyst, who said what), instead of trusting model memory.
- Price-action guardrail — the data layer flags parabolic / near-high moves; a stock that doubled in days on one headline is an AVOID / observe form, never a buy.
- Evidence ladder — every key claim is tagged
Confirmed / Inferred / Weak; a load-bearingInferredclaim caps the confidence. - Two independent axes — "is it a bottleneck" (classification) and "should you buy it here" (pricing) are never conflated. A non-bottleneck can be a fine trade at a price; a real bottleneck at a top can be a bad one.
- Honest "too late" — parabolic move + extreme valuation + loud consensus ⇒ the label is "too late / top", not an opportunity.
Educational and research use only. Output quality varies with the model, data, and many non-deterministic factors. This is not financial, investment, or trading advice.
Quickstart
import asyncio
from cyberagent import AnalystChain
chain = AnalystChain(llm="gemini", api_key="...", lang="en") # grounding on by default
report = asyncio.run(chain.analyze("NVDA")) # US · or 600519 (A-share) / 0700 (HK) / BTC / 0x6B17...
print(report.final_decision) # ACCUMULATE / HOLD / REDUCE / AVOID
print(report.confidence) # 0.0 - 1.0
print(report.positioning) # Phase 0 — core business + physical position
print(report.departments["physical"].markdown)
print(report.departments["leaders"].markdown)
(Inside Jupyter or an async app, call await chain.analyze("NVDA") directly.)
One import, any market. Pick the report language with lang="zh" / "en";
the whole report is generated in it.
Install
pip install 'cyberagent[stocks,gemini,web]' # recommended: stock data + grounded Gemini + local web UI
Extras: stocks (yfinance) · gemini / openai / claude (providers) ·
web (local UI) · all (everything). The bare pip install cyberagent is
the zero-dependency core.
Set up your API key
cyberagent is bring-your-own-key. Gemini is the default and the only provider with real-time grounding — recommended.
1. Get a key — Gemini is free to start: aistudio.google.com/app/apikey. (Other providers: OpenAI · Anthropic · DeepSeek.)
2. Configure it — create a .env file in the folder you run from:
echo 'GOOGLE_API_KEY=your_key_here' > .env
(All supported variables are listed in .env.example.)
The CLI and web UI auto-load .env. In code you can pass it directly instead:
AnalystChain(llm="gemini", api_key="your_key_here")
3. Run it — cyberagent (interactive) or cyberagent serve (web). The model
picker shows a ✓ next to every key it found in your .env.
Bring your own LLM key
Gemini is the default (and the only provider with real-time grounding). You can also pass any provider or a custom adapter:
from cyberagent import AnalystChain, LLMAdapter, MockLLM
AnalystChain(llm="gemini", api_key="...") # default, grounded
AnalystChain(llm="openai", api_key="sk-...")
AnalystChain(llm="claude", api_key="...")
AnalystChain(llm="deepseek", api_key="...")
AnalystChain(llm=MockLLM()) # offline, no key — try the flow
class MyLLM(LLMAdapter):
async def complete(self, system: str, user: str) -> str: ...
AnalystChain(llm=MyLLM())
Keys are read from the environment / a local .env (see .env.example).
CLI & local web page
cyberagent # interactive: pick language + model, then a symbol
cyberagent analyze NVDA --llm gemini --lang en
cyberagent analyze BTC --depts physical,economics,leaders # subset, faster
cyberagent serve # local web UI at http://127.0.0.1:8000
The CLI and web page show a model picker that auto-matches the API key found in
your .env (✓ / ✗), live per-department progress, and the rendered report.
Use as a Claude Skill — no install
The whole methodology is also packaged as a self-contained Claude Skill in
SKILL.md — it runs the same physical-bottleneck chain in pure-prompt
form, no Python required. To install it in Claude Code:
mkdir -p ~/.claude/skills/physical-bottleneck-analyst
curl -fsSL https://raw.githubusercontent.com/CyberK13/cyberagent/main/SKILL.md \
-o ~/.claude/skills/physical-bottleneck-analyst/SKILL.md
Then just ask: "analyze NVDA" — Claude picks the skill up automatically. (Any
other agent that loads skills works the same way: give it SKILL.md.) The Python
package adds live data, real-time grounding, and the CLI / web UI on top.
Methodology & prompts — fully open
There is no paywall. How to hunt a physical bottleneck is framework knowledge,
not alpha. The complete system prompts live in
src/cyberagent/prompts/departments.py,
and the Situational Awareness anchor (the physical-bottleneck ladder + the OOM
development arc) is distilled in references/sa-canon.md.
Roadmap
- LangChain / LangGraph tool wrapper
- MCP server (Claude / Cursor)
- EDGAR (US filings) + Tushare (A-share) + Etherscan (EVM) adapters
- Segment-level chains for conglomerates
- Structured per-department gate verdicts (machine-enforced "stop")
Disclaimer
final_decision, confidence, and the department reports are AI-generated
educational outputs, not financial advice. LLMs make mistakes; markets are
unpredictable. Do your own research. The authors and contributors are not liable
for any decision made based on this software. See docs/disclaimer.md.
License
MIT. See LICENSE.
Publication to the tea Protocol is planned.
Project details
Release history Release notifications | RSS feed
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 cyberagent-0.1.0.tar.gz.
File metadata
- Download URL: cyberagent-0.1.0.tar.gz
- Upload date:
- Size: 55.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19c749680a863999e4e4b5fa65829661cdcfd730f729b0e23b1526aa826ca86a
|
|
| MD5 |
45412c5eebe72357bfe81a376fd0fadc
|
|
| BLAKE2b-256 |
69a7a4eadf42e007fe076c55f11acf3a0bde4e73ae5911a2eebf4313f243d4ff
|
Provenance
The following attestation bundles were made for cyberagent-0.1.0.tar.gz:
Publisher:
publish.yml on CyberK13/cyberagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cyberagent-0.1.0.tar.gz -
Subject digest:
19c749680a863999e4e4b5fa65829661cdcfd730f729b0e23b1526aa826ca86a - Sigstore transparency entry: 1772217421
- Sigstore integration time:
-
Permalink:
CyberK13/cyberagent@d0b46926049d5d979b9d5b8c35bed83cf3be4ff7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CyberK13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0b46926049d5d979b9d5b8c35bed83cf3be4ff7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cyberagent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cyberagent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 53.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
838e3989739a2500e45501c0643d2d3bf4d2f86f1b5b81669d6e9e05710a48d0
|
|
| MD5 |
b53e9e8ce85da67135bb5034f10c00f9
|
|
| BLAKE2b-256 |
9fb606dfd68ef5d1804a9ee2467c65460433347adf6b75626f4af43e360fc23e
|
Provenance
The following attestation bundles were made for cyberagent-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CyberK13/cyberagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cyberagent-0.1.0-py3-none-any.whl -
Subject digest:
838e3989739a2500e45501c0643d2d3bf4d2f86f1b5b81669d6e9e05710a48d0 - Sigstore transparency entry: 1772217765
- Sigstore integration time:
-
Permalink:
CyberK13/cyberagent@d0b46926049d5d979b9d5b8c35bed83cf3be4ff7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CyberK13
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d0b46926049d5d979b9d5b8c35bed83cf3be4ff7 -
Trigger Event:
release
-
Statement type: