๐ฅ Best Use of AI/ML โ UB Hacking 2024 (OpenAI Sponsor Prize)
๐ฅ 2nd Place Overall โ out of 87 teams
AI-powered multi-agent system for stock market analysis. Three specialized GPT-4 agents collaborate via a consensus engine to generate BUY/SELL/HOLD signals with confidence scores.
Traditional algorithmic trading systems suffer from three core failures:
- Single-point failure - one model making all decisions
- Narrow context - missing broader market signals
- Poor explainability - black-box decisions traders can't trust
Synapse Street solves this with a collaborative multi-agent architecture that mirrors how real trading desks operate.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DATA INGESTION LAYER โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Market Data โ โ News API โ โ SEC Filings โ โ
โ โ (Yahoo) โ โ (NewsAPI) โ โ (EDGAR) โ โ
โ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โโโโโโโโฌโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโ โ
โ โ Spark Streaming โ โ
โ โ (3K+ entities) โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ VECTOR MEMORY (Qdrant) โ
โ โข Market embeddings (OpenAI Ada-002) โ
โ โข Historical pattern matching โ
โ โข News sentiment vectors โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ DATA AGENT โ โANALYSIS AGENT โ โ EXECUTION โ
โ (GPT-4) โ โ (GPT-4) โ โ AGENT โ
โ โ โ โ โ (GPT-4) โ
โ โข Ingest data โ โ โข Technical โ โ โ
โ โข Feature eng โ โ analysis โ โ โข Generate โ
โ โข Store to โ โ โข Sentiment โ โ signals โ
โ vector DB โ โ scoring โ โ โข Position โ
โ โ โ โข Risk assess โ โ sizing โ
โโโโโโโโโฌโโโโโโโโ โโโโโโโโโฌโโโโโโโโ โโโโโโโโโฌโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโ
โ CONSENSUS โ
โ ENGINE โ
โ (LangGraph) โ
โ โ
โ โข Weighted โ
โ voting โ
โ โข Confidence โ
โ thresholds โ
โโโโโโโโโโฌโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโ
โ TRADING SIGNAL โ
โ BUY/SELL/HOLD โ
โ + Confidence โ
โโโโโโโโโโโโโโโโโโโ
| Strategy | Total Return | Sharpe | Max Drawdown | Win Rate |
|---|---|---|---|---|
| Buy & Hold | 24.5% | 1.2 | -18% | โ |
| Synapse Street | 42.8% | 1.8 | -12% | 64% |
| Improvement | +18.3% | +50% | +33% | โ |
| Consensus Level | Trades | Win Rate | Avg Return | Sharpe |
|---|---|---|---|---|
| High (3/3 agree) | 45 | 78% | 4.2% | 2.4 |
| Medium (2/3 agree) | 120 | 58% | 2.1% | 1.6 |
| Low (split) | 85 | 42% | -0.5% | 0.8 |
Key Insight: High-consensus trades significantly outperform, validating the multi-agent approach.
| Metric | Value |
|---|---|
| Beta | 0.85 |
| Alpha | 12.3% annualized |
| Sortino Ratio | 2.1 |
| Calmar Ratio | 3.6 |
| Layer | Technology | Why |
|---|---|---|
| Agent Framework | LangGraph | Explicit state management, cyclic workflows |
| LLM | GPT-4 | Best reasoning for financial analysis |
| Vector Database | Qdrant | Hybrid search, Rust-based speed |
| Embeddings | OpenAI Ada-002 | Optimal cost/performance for financial text |
| Data Processing | Spark + Pandas | Batch + real-time |
| Orchestration | Apache Airflow | Production pipeline scheduling |
| Dashboard | Streamlit | Real-time monitoring |
| Backtesting | Backtrader | Industry-standard, extensible |
- Python 3.9+
- Docker (for Qdrant)
- OpenAI API key
# 1. Clone repository
git clone https://github.com/mrudula1501/Synapse-Street.git
cd Synapse-Street
# 2. Start Qdrant
docker run -p 6333:6333 -v $(pwd)/qdrant_storage:/qdrant/storage qdrant/qdrant
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure environment
cp .env.example .env
# Edit .env with your OPENAI_API_KEY
# 5. Download historical data
python scripts/download_data.py --symbols SPY,AAPL,MSFT --start 2020-01-01
# 6. Run backtest
python main.py --mode backtest --config configs/backtest.yamlfrom synapse_street import TradingSystem
from synapse_street.config import load_config
config = load_config('configs/production.yaml')
system = TradingSystem(config)
signals = system.generate_signals(
symbols=['AAPL', 'MSFT', 'GOOGL', 'AMZN'],
lookback_days=30
)
print(signals)
# [
# {
# 'symbol': 'AAPL',
# 'signal': 'BUY',
# 'confidence': 0.87,
# 'agents_agree': '3/3',
# 'rationale': 'Technical breakout + positive earnings sentiment',
# 'position_size': 0.15
# },
# ...
# ][14:32:05] DATA_AGENT: Fetched AAPL 1-min bars, RSI=68, MACD crossing
[14:32:06] DATA_AGENT: News sentiment: +0.8 (earnings beat)
[14:32:07] DATA_AGENT: Stored to Qdrant: 5 vectors
[14:32:08] ANALYSIS_AGENT: Retrieved similar patterns (3 bullish, 1 bearish)
[14:32:09] ANALYSIS_AGENT: Technical: 0.75 | Sentiment: 0.82 | Risk: LOW
[14:32:09] ANALYSIS_AGENT: โ BULLISH (confidence: 0.79)
[14:32:10] EXECUTION_AGENT: Portfolio: 20% cash, max position 15%
[14:32:10] EXECUTION_AGENT: โ BUY, Size: 12% (within risk limits)
[14:32:11] CONSENSUS: All 3 agents agree โ HIGH confidence
[14:32:11] CONSENSUS: โ EXECUTE BUY AAPL @ $178.50, 12% position
Not simple majority voting - we use weighted confidence scoring:
def calculate_consensus(agent_outputs):
weighted_sum = sum(
output['confidence'] * output['signal_value']
for output in agent_outputs
)
total_confidence = sum(output['confidence'] for output in agent_outputs)
consensus_score = weighted_sum / total_confidence
if consensus_score > 0.7:
return 'BUY', 'HIGH'
elif consensus_score < -0.7:
return 'SELL', 'HIGH'
else:
return 'HOLD', 'LOW'results = qdrant.search(
collection_name="market_conditions",
query_vector=dense_embedding, # Ada-002: semantic similarity
query_sparse=sparse_vector, # BM25: ticker/term matching
limit=5,
score_threshold=0.75
)Synapse-Street/
โโโ agents/
โ โโโ base_agent.py # Abstract base class
โ โโโ data_agent.py # Market data ingestion
โ โโโ analysis_agent.py # Technical + sentiment analysis
โ โโโ execution_agent.py # Signal generation + sizing
โโโ core/
โ โโโ consensus_engine.py # Agent voting mechanism
โ โโโ vector_store.py # Qdrant interface
โ โโโ risk_manager.py # Position sizing, stop-losses
โ โโโ backtester.py # Strategy validation
โโโ configs/
โ โโโ backtest.yaml
โ โโโ production.yaml
โโโ dashboard/
โ โโโ streamlit_app.py
โโโ main.py
โโโ requirements.txt
โโโ Dockerfile
โโโ README.md
- Live trading integration (Alpaca / Interactive Brokers)
- Reinforcement learning for dynamic position sizing
- Alternative data (satellite imagery, credit card transactions)
- Multi-asset support (crypto, forex, commodities)
- Federated learning across distributed data sources
- ๐ฅ Best Use of AI/ML (Sponsor: OpenAI)
- ๐ฅ 2nd Place Overall (87 teams)
- ๐ก Most Innovative Architecture (Judge's Choice)
"The multi-agent approach to financial analysis is genuinely novel. Most teams used single LLM calls; this team architected a collaborative system that mirrors real trading desks." โ Judges' Feedback
Team: Team of 4 - Mrudula Deshmukh (ML Engineer, Vector Search).
MIT License โ see LICENSE
โ ๏ธ Disclaimer: Educational purposes only. Not financial advice. Trading involves significant risk.
Mrudula Deshmukh