Sprint 9+ — Live Dashboard & Active Quality Control

PrimoGreedy

An autonomous AI agent that hunts, filters, debates, grades, and paper-trades micro-cap stocks across 4 global markets — every single day.

4
Markets
6
LLM Fallback Chain
3
Debate Agents
7
Auto Evaluators
24/7
Catalyst Watch
Live
Dashboard
Built on LangGraph
A multi-graph system with parallel fan-out, structured output, multi-agent debate, and live broker execution.

Hunter Pipeline

Daily cron — 4 regions in parallel via the Send API
START Scout Gatekeeper Analyst Email END
🔍

Two-Pronged Discovery

yFinance screener + Brave Search trending merged, scored, and ranked.

🚧

Quantitative Firewall

$5M–$500M cap, <$30 price, zombie filter. Command routing.

🧠

Structured Verdicts

Pydantic InvestmentVerdict model with Kelly Criterion sizing.

📧

Team Dispatch

HTML reports emailed to the full team via Resend API.

Investment Committee (Multi-Agent Debate)

Three competing LLM personas for hallucination-resistant verdicts
Pitcher Skeptic Judge Verdict
📈

The Pitcher (Gemma)

Writes the strongest bullish Lynch Pitch using only provided data.

🔥

The Skeptic (Mistral)

Aggressively challenges the bull case, flags fabricated claims.

⚖️

The Judge (Nemotron)

Synthesizes the debate, applies Kelly sizing, issues the final verdict.

Parallel Region Orchestrator

Fan-out across all markets simultaneously
START dispatch USA UK Canada Australia END
What the Agent Produces
Every analysis follows the same battle-tested format — strict math, one catalyst, one way to lose, and a final call.
### THE QUANTITATIVE BASE (Graham / Asset Play)
* Current Price: $17.80
* Deep Value Asset Play Valuation (Book/Share): $10.89 per share
* Margin of Safety: None — price is ~63% above the book-value floor.

### THE LYNCH PITCH (Why I would own this)
* The Core Action: Board committed $42.75M of personal capital to support buyback.
* The Catalyst: $40M buyback + zero debt + $164M liquidity signals confidence.

### THE MUNGER INVERT (How I could lose money)
* Structural Weakness: Negative EPS of -3.79, negative EBITDA of -$32.97M.
* The Bear Evidence: Failure to hit $180-$200M 2026 revenue target.

### FINAL VERDICT
WATCH — Upside dependent on fragile buyback catalyst.

### POSITION SIZING (Kelly Criterion)
Recommended allocation: 5.0% of portfolio
Based on historical win rate of 20% across 20 trades.
The Engine Room
Every component is purpose-built, with VPS fallbacks, caching, and graceful degradation.
🎯

Screener & Scoring

yFinance-based micro-cap screener with quantitative candidate scoring. Brave Search adds trending/momentum signals. $5M–$500M market cap range.

📄

SEC EDGAR Ground Truth

Fetches 10-K/10-Q filings for US equities. Extracts MD&A and Risk Factors via BeautifulSoup. Injected into the analyst prompt as hard evidence.

📊

Kelly Criterion Sizing

Computes optimal position size from historical win rate. Half-Kelly with verdict scaling. Per-verdict caps: STRONG BUY 25%, BUY 15%, WATCH 5%. 10-minute cache.

🏦

Alpaca Paper Trading

Live broker integration for US equities. Submits market orders for BUY/STRONG BUY verdicts. Records order ID, fill price, and broker status to VPS.

🚨

Catalyst Polling Daemon

VPS systemd timer polls every 15 min for volume spikes, price moves, and SEC Form 4 insider filings. Fires GitHub Actions repository_dispatch for instant analysis.

🧪

Grading Engine (Online + Offline)

7 evaluators across two tiers. Online: format_score and verdict_validity run inline during every cron and post LangSmith feedback. Offline: LLM-as-a-Judge hallucination catchers. Annotation queue auto-tags edge cases for human review.

💾

VPS Data Layer + Live Dashboard

FastAPI + DuckDB behind Tailscale. Seen-tickers with dynamic amnesia (14d AVOID, 30d BUY). Paper portfolio with P&L tracking. Chart.js dashboard with summary cards, verdict donut, Kelly bar chart, and sortable trade table.

🔬

Prompt A/B Testing

LangSmith Hub integration with PROMPT_VERSION env var to pin prompts to specific commits. Run parallel crons with different prompt versions and compare results in LangSmith Experiments.

🔗

LLM Fallback Chain

6-model cascade via OpenRouter: Nemotron → Step → Trinity → Gemma → Llama → Mistral. Auto-retry on 429s with exponential backoff.

Sprint Timeline
From basic screening to autonomous paper trading in 9 sprints.
Sprint 1–7

Foundation

Core LangGraph pipeline, yFinance integration, Brave Search discovery, Finnhub fundamentals, Resend email dispatch, Chainlit UI, and GitHub Actions cron.

Sprint 8 — Ground Truth & Sizing

SEC EDGAR + Kelly Criterion

  • Epic 1–2: LangGraph modernization — Command routing, Send parallel fan-out, RetryPolicy, InMemorySaver
  • Epic 3: SEC EDGAR 10-K/10-Q filing fetcher with MD&A and Risk Factors extraction
  • Epic 4: Kelly Criterion position sizing with half-Kelly, verdict scaling, and trade history
  • VPS deployment: FastAPI + DuckDB data API behind Tailscale
  • Ticker extraction hardening: 100+ noise words, uppercase-only matching
Sprint 9 — Execution & Quality Control

Debate + Broker + Evaluators + Catalyst

  • Epic 1 — Grading Engine: 5 custom LangSmith evaluators, golden dataset builder, evaluation runner
  • Epic 2 — Live Broker: Alpaca Paper Trading integration with order routing, fill tracking, and VPS sync
  • Epic 3 — Sniper Node: Catalyst polling daemon on VPS, Finnhub volume/price/insider triggers, repository_dispatch wake-up
  • Epic 4 — Investment Committee: Multi-agent debate subgraph (Pitcher → Skeptic → Judge) with configurable models
  • Optimizations: Widened universe to $5M–$500M, dynamic amnesia (14d/30d), per-verdict Kelly caps, 65k token headroom
Sprint 9+ — Dashboard & Active Quality Control

Live Dashboard + Online Evaluators + Prompt Versioning

  • VPS Dashboard: Chart.js portfolio dashboard served from FastAPI — summary cards, verdict donut, Kelly sizing bar chart, sortable trade table, seen-ticker feed. Auto-refresh 5 min
  • Online Evaluators: format_score and verdict_validity run inline after every verdict, posting feedback directly to LangSmith runs — zero extra LLM cost
  • Annotation Queue: WATCH/AVOID/fallback verdicts auto-tagged with needs_review in LangSmith for team review
  • Prompt A/B Testing: PROMPT_VERSION env var pins LangSmith Hub prompts to specific commits for controlled experiments
  • New endpoint: GET /portfolio/summary for lightweight stats without yFinance calls
Technology
Built with production-grade frameworks and APIs.
🦜 LangGraph
🔗 LangChain
🔬 LangSmith
🤖 OpenRouter
📊 yFinance
📡 Finnhub
🔍 Brave Search
📄 SEC EDGAR
🏦 Alpaca Markets
FastAPI
🦆 DuckDB
🐍 Python 3.11
🔒 Tailscale
📧 Resend
🔄 GitHub Actions
💬 Chainlit
Framework Features Used
Following modern LangGraph best practices throughout.
📝

Partial State Updates

Nodes return only changed keys. Annotated reducers on candidates and scores with operator.add.

🔀

Command Pattern

Gatekeeper combines state update + routing in a single return. Routes to analyst, scout, or email.

Send API

Parallel fan-out across 4 market regions. Each region runs the full pipeline independently.

💾

Checkpointing

InMemorySaver with thread_id for state persistence and tracing correlation.

🔄

RetryPolicy

max_attempts=3, initial_interval=2.0 on all nodes. Handles transient API failures.

🏗️

Subgraphs

Multi-agent debate as a nested LangGraph subgraph. Composable and independently testable.

"PrimoGreedy does not predict the future. It finds the math, finds the catalyst, finds the catch — and says AVOID far more often than it says BUY."
Benjamin Graham's math  ·  Peter Lynch's story  ·  Charlie Munger's inversion