ai-hedge-fund: From Viral Python Script to Drag-and-Drop AI Investment Committee
One developer turned a subway idea into a 48.9k-star visual editor where Warren Buffett, Cathie Wood, and Michael Burry agents debate stocks in a React Flow canvas. The real story is what it reveals about building serious agent platforms.
- A single developer transformed a viral Python script into a 48.9k-star visual IDE where users drag and drop distinct investor personas onto a React Flow canvas.
- Deliberate conflict between strong investment philosophies produces richer analysis than single-model approaches.
- The architecture cleanly separates a design-time visual editor from a runtime graph execution engine with persistent history.
- Multi-perspective visual agent workflows offer a powerful template for domains beyond finance.
The Investment Committee You Can Drag and Drop
Open the web app and you are greeted with a polished React Flow canvas. On the left sits a library of nodes. On the right, configuration panels. In the center, you compose your own investment committee by dragging and connecting components.
Stock Analyzer node feeds data to specialized investor nodes. Each investor node represents a distinct philosophy. Those connect to a Risk Manager and finally a Portfolio Manager that synthesizes the debate into a clear recommendation.
Click run. Watch data flow through the graph. Outputs appear in the bottom panel: conflicting analyses, reasoned counterarguments, and a final synthesized trade decision. The entire experience feels like a professional workflow tool rather than a novelty script.
How 18 Distinct Investing Philosophies Actually Argue
The power comes from deliberate conflict. Instead of generic agents that converge too quickly, this system gives each participant a strong, opinionated voice.
Warren Buffett looks for wonderful businesses at fair prices. Cathie Wood hunts disruptive growth stories. Michael Burry hunts deep value with near-term catalysts. Aswath Damodaran builds detailed valuation models. The Risk Manager challenges them all with volatility metrics and position limits.
This tension produces richer synthesis than a single model could achieve. The Portfolio Manager node receives these contradictory signals and must reconcile them into a coherent recommendation.
Let multiple AI agents with conflicting strategies debate the same data and force them to reach a consensus.
This started as a simple idea while riding the NYC subway. I wanted to see what would happen if legendary investors could debate stocks together using modern AI.
From Subway Script to Full Agent IDE in Six Months
The project began as a compact Python script. A handful of hardcoded agents, a simple orchestration loop, and entertaining output. It struck a nerve and went viral, reaching thousands of stars in days.
Instead of stopping at the meme, Virat Singh kept building. He migrated the core logic to a more scalable LangGraph-style execution model. Then he added a complete full-stack web application with a visual editor. Persistent flows, execution history, database storage via SQLAlchemy and Alembic migrations, and a polished React + TypeScript frontend using React Flow.
What was once a single file evolved into a professional-grade platform built almost entirely by one developer.
The Architecture That Makes It Work
The system maintains a clean separation between design time and runtime. The React Flow canvas is purely for authoring flows. Nodes map to backend agent definitions stored in data files. When you execute a flow, the backend translates the visual graph into an executable orchestration using the services in the FastAPI backend.
Key services include the graph execution engine, individual agent runners, portfolio management logic, and a backtesting service that evaluates historical performance. Every run is persisted to the database along with its cycles and outputs, creating an inspectable history similar to LangSmith.
Multi-LLM support is handled cleanly. Users can assign different models to different nodes or use a single provider across the board. Local models via Ollama are fully supported.
AI Hedge Fund vs. The Rest
Most alternatives fall into different categories. Some focus on research report generation. Others attempt live execution. Few combine memorable personas with a visual composer and strong educational framing.
| Project | Agent Style | Primary Interface | Execution | Persistence | Stars | Best For |
|---|---|---|---|---|---|---|
| virattt/ai-hedge-fund | 18 distinct investor personas | React Flow visual editor + CLI | Graph orchestration with debate | SQLAlchemy + runs history | 48.9k | Learning multi-perspective agents |
| FinRobot | Orchestrated research agents | Jupyter notebooks | Director + specialized tools | Limited | ~6.4k | Financial report generation |
| AutoHedge | Swarm intelligence agents | Code-first | Autonomous with execution | Minimal | ~1.1k | Live strategy experimentation |
| Freqtrade | Rule and ML based | Web UI + code | Backtesting engine | Full | Many thousands | Traditional quant trading |
Why This Pattern Matters Beyond Finance
The project demonstrates a broader shift in how we build agent systems. Moving from imperative scripts to visual, inspectable, and persistent platforms lowers the barrier to experimentation while increasing transparency and debuggability.
Strong personas force models to articulate their reasoning more clearly. The visual canvas makes the decision process legible. Persistent execution history allows users to inspect where and why the committee reached its conclusions.
While the project includes strong disclaimers that it is for educational purposes only, it offers a compelling template for domain-specific agent platforms in other fields. Legal analysis, medical reasoning, and strategic planning could all benefit from similar multi-perspective visual workflows.