| title | Duddu - Autonomous Investment Committee |
|---|---|
| emoji | ๐ค |
| colorFrom | red |
| colorTo | green |
| sdk | docker |
| app_port | 7860 |
| pinned | false |
| suggested_hardware | cpu-basic |
| suggested_storage | small |
A multi-agent AI system for investment research and analysis
Duddu is a human-safe autonomous investment committee that transforms your investment questions into transparent, explainable trading strategies. It uses a multi-agent LangGraph workflow powered by MCP tools to research, analyze, and propose tradesโwith explicit human approval required before any execution.
๐ก Think of it as having a team of specialized analysts working for you: a researcher gathering market data, an analyst crunching numbers, and an interpreter translating it all into clear recommendations.
Check out Duddu on ๐ค HuggingFace Spaces now!
This work is a submission for the ๐ค HuggingFace Agents Winter Hackathon 2025, Track 2: MCP in Action
Track tag: mcp-in-action-track-consumer
Built by @aakaashjois, @pmagadi17, @sravan953, @vineetrao25
Application Demo Video: https://www.youtube.com/watch?v=_2Vfm6LL84A (AI voiceover for video generated using ElevenLabs)
Social Media Post: https://x.com/sravan953/status/1995174119261032799?s=20
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GRADIO 6 INTERFACE โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ ๐ฌ Chat Interface โ โ ๐ Portfolio โ โ ๐ Backtest Results โ โ
โ โ + Voice Input ๐๏ธ โ โ + P/L Panel โ โ + Equity Curves โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LANGGRAPH ORCHESTRATION โ
โ โ
โ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ O โโโโโถโ R โโโโโถโ A โโโโโถโ I โ โ
โ โOrchestratorโโโโโ Research โโโโโ Analyzer โโโโโ Interpreter โ โ
โ โ (Plan) โ โ (Collect) โ โ (Signal) โ โ (Synthesize) โ โ
โ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ โ
โ โผ โผ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP TOOL LAYER โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ AlphaVantage โ โ Google Search โ โ Alpaca โ โ
โ โ ๐ Market Data โ โ ๐ News/Web โ โ ๐ผ Trading & Portfolio โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Alpaca MCP (MCP link) for paper trading
- ALphaVantage MCP for stock market data
- Blaxel for MCP
- ElevenLabs for speech-to-text
- Tavily MCP for web search, hosted on Blaxel
| Agent | Role | Responsibilities |
|---|---|---|
| ๐ฏ Orchestrator | Master Planner | Routes between agents, manages context, ensures coverage |
| ๐ฌ Research | Data Collector | Gathers market data, news, and fundamentals via MCP |
| ๐ Analyzer | Signal Generator | Produces BUY/HOLD/SELL/WATCH signals with confidence scores |
| ๐ก Interpreter | Strategy Synthesizer | Translates analysis into plain-language recommendations |
- Python 3.13+
uvpackage manager
# Clone and setup
git clone <repo-url>
cd hf-gradio-winter-2025-hackathon
uv syncCreate a .env file with your API keys:
# Required
GEMINI_API_KEY=your_gemini_key
ALPHAVANTAGE_API_KEY=your_alphavantage_key
GOOGLE_SEARCH_API_KEY=your_google_search_key
GOOGLE_SEARCH_ENGINE_ID=your_engine_id
# Alpaca Trading (paper mode)
ALPACA_API_KEY=your_alpaca_key
ALPACA_SECRET_KEY=your_alpaca_secret
ALPACA_BASE_URL=https://paper-api.alpaca.markets
ALPACA_MODE=paper
ALPACA_USE_REST_API=true # Recommended for stability
# Optional: Voice Input
ELEVENLABS_API_KEY=your_elevenlabs_keyuv run python app.pyOpen http://localhost:7860 and start chatting!
| Type | Example |
|---|---|
| Research | "Research NVDA for me" |
| Compare | "Compare TSLA and F for a 3-year horizon" |
| Sector Analysis | "Analyze AI chip stocks" |
| With Budget | "I have $5,000 to invest in tech stocks" |
| Backtest | "Backtest AAPL for 180 days with $5,000 capital" |
- Set Your Profile โ Choose risk tolerance and investment horizon
- Ask Questions โ Type or use ๐๏ธ voice input
- Watch the Committee โ See agents research, analyze, and synthesize
- Review Recommendations โ Get transparent, explainable strategies
- Approve Trades โ Execute via Alpaca (paper trading by default)
- Backtest โ Validate strategies with historical data
Duddu includes a powerful backtesting engine:
| Feature | Description |
|---|---|
| Auto Backtests | BUY trades trigger automatic 12-month buy-and-hold simulations |
| Budget-Aware | Mention a budget and shares are scaled to fit |
| Direct Commands | Backtest TSLA for 180 days with $5,000 capital and 2 shares |
| Rich Metrics | Return, P/L, CAGR, max drawdown, Sharpe, volatility, hit rate |
| Visual Output | Equity curves, drawdown charts, trade logs |
| Feature | Description |
|---|---|
| Human-in-the-Loop | All trades require explicit user approval |
| Paper Trading | Uses Alpaca paper trading by default |
| Input Guards | Screens for toxic content, prompt injection, off-topic queries |
| Output Guards | Prevents leaking API keys or credentials |
| Crypto/Options Block | Automatically rejects crypto and derivatives requests |
| Source | Purpose | Configuration |
|---|---|---|
| AlphaVantage MCP | Market data & fundamentals | ALPHAVANTAGE_API_KEY |
| Google Search MCP | News & web search | GOOGLE_SEARCH_* keys |
| Alpaca REST/MCP | Trading & portfolio | ALPACA_* keys |
| Tavily MCP | (Optional) Alternative search | TAVILY_MCP_ENDPOINT |
๐ก Tip: Set
ALPACA_USE_REST_API=truefor best stability. SetSEARCH_PROVIDER=googleif you experience Tavily timeouts.
.
โโโ app.py # Main entry point
โโโ src/
โ โโโ agents/ # O, R, A, I agent implementations
โ โโโ graph/ # LangGraph state and workflow
โ โโโ schemas/ # Pydantic models and contracts
โ โโโ tools/ # MCP clients and utilities
โ โโโ guardrails/ # Input/output safety validators
โ โโโ ui/ # Gradio interface
โโโ scripts/ # Testing and utility scripts
โโโ docs/ # Documentation
# Test all MCP integrations
uv run python scripts/test_mcp.py --test-all
# Test individual components
uv run python scripts/test_mcp.py --alphavantage-only
uv run python scripts/test_mcp.py --google-only
uv run python scripts/test_mcp.py --alpaca-onlyKey settings in src/config/settings.py:
| Setting | Default | Description |
|---|---|---|
max_graph_iterations |
20 | Maximum LangGraph iterations |
request_timeout_seconds |
30 | MCP request timeout |
guardrails_enabled |
True | Enable input safety checks |
guardrails_output_enabled |
True | Enable output safety checks |
elevenlabs_stt_model |
scribe_v1 |
Speech-to-text model |
MCP Servers Not Found
uv pip list | grep -E "(alphavantage|mcp-google|alpaca-mcp)"Ensure MCP servers are installed and remove old MCP command settings from .env.
API Quota Exceeded
Check your API usage limits, wait for quota reset, or upgrade API plans.
Alpaca Connection Issues
Set ALPACA_USE_REST_API=true to use direct REST API calls instead of MCP.
Graph Not Completing
- Check logs for agent errors
- Increase
max_graph_iterationsin settings - Verify all API keys are set correctly
- PRD โ Product requirements
- Architecture โ System design
- Agent Contracts โ Input/output schemas
- UX Flow โ User experience design
This is a demo application for educational purposes only.
- Duddu is not a registered investment advisor
- This is not financial advice
- Default mode uses paper trading (no real money)
- Always do your own research before making investment decisions
Built for the HuggingFace Gradio Winter 2025 Hackathon โ Track 2: MCP in Action
Made with โค๏ธ using LangGraph, MCP, and Gradio 6