OVERVIEW/ADVANCED/INVEST_ADVISOR
Advancedstable00_/_ADVANCED

Investment Advisor

A 4-agent CrewAI pipeline that gathers financial data, researches latest news, synthesizes analysis, and generates structured investment recommendations with Pydantic output and guardrails. Single stock uses parallel execution; multiple stocks use distributed async crews.

Py_3.12CrewAIOpenRouteryfinanceEXA_SearchPydanticGuardrailsVIEW SOURCE
V1 — PARALLEL PIPELINETHREADPOOL_EXECUTOR // PARALLEL PHASE 1
# STOCK_SELECTOR // INVEST_ADVISOR
1 SELECTED
1 stock selected→ V1 PARALLEL PIPELINE (single stock)
system@invest-advisor:~$
PHASE 1 // PARALLELThreadPoolExecutor — 2 workers
AGENT_01 // DATA_EXPLORER
IDLE

[IDLE] Waiting for pipeline execution...

AGENT_02 // NEWS_RESEARCHER
IDLE

[IDLE] Waiting for pipeline execution...

context flows down
PHASE 2 // SEQUENTIALContext-dependent analysis chain
AGENT_03 // DATA_ANALYST
IDLE

[IDLE] Waiting for pipeline execution...

AGENT_04 // FINANCIAL_EXPERT
IDLE

[IDLE] Waiting for pipeline execution...

LIVE_EXECUTION_LOG // investment-advisor0 EVENTS

[STREAM] No active execution. Select stocks and run analysis.

/SYSTEM_INTERNALS

ARCHITECTURE

V1_ARCHITECTURE // PARALLEL + SEQUENTIALSINGLE STOCK
INPUT
stock: AAPL (single symbol)
ThreadPoolExecutor spawns 2 parallel workers
PHASE 1 // PARALLEL
AGENT_01 // DATA_EXPLORER
role: Data Researcher
tools: get_company_info, get_income_statements
Fetches financial data via yfinance API
AGENT_02 // NEWS_RESEARCHER
role: News and Info Researcher
tools: EXASearchTool
Searches latest news and business information
PHASE 2 // SEQUENTIAL
AGENT_03 // DATA_ANALYST
role: Data Analyst
context: [Data Explorer, News Researcher]
Synthesizes financial data + news into analysis
AGENT_04 // FINANCIAL_EXPERT
role: Financial Expert
tools: get_current_stock_price
output: InvestmentRecommendation (Pydantic)
guardrail: validate_recommendation()
STRUCTURED OUTPUT
action: BUY | HOLD | SELL
confidence: 0.0 — 1.0
target_price: 12-month target
current_price: live market price
reasons: list[str]
risks: list[str]
V2_ARCHITECTURE // DISTRIBUTED ASYNCMULTI-STOCK WATCHLIST
INPUT
watchlist: ["AAPL", "GOOGL", "MSFT"]
asyncio.gather() spawns N concurrent crews
DISTRIBUTED_CREWS // ASYNC
CREW_AAPL
01 Data Explorer
02 News Researcher
03 Data Analyst
04 Financial Expert
output: InvestmentRecommendation
CREW_GOOGL
01 Data Explorer
02 News Researcher
03 Data Analyst
04 Financial Expert
output: InvestmentRecommendation
CREW_MSFT
01 Data Explorer
02 News Researcher
03 Data Analyst
04 Financial Expert
output: InvestmentRecommendation
AGGREGATED RESULTS
dict(zip(stocks, results)) — each stock mapped to its InvestmentRecommendation
AAPL
BUY/HOLD/SELL
GOOGL
BUY/HOLD/SELL
MSFT
BUY/HOLD/SELL
LLM
openai/gpt-4.1 via OpenRouter
Data Source
yfinance + EXA Search API
Output Schema
Pydantic InvestmentRecommendation
Guardrail
validate_recommendation()

/BACKEND_CONTRACT

PLUGGABLE RUNTIME

This demo serves a hardcoded fixture today. Set NEXT_PUBLIC_USE_REAL_BACKEND=true and the same UI will POST /api/advanced/investment-advisor to a real CrewAI service - no UI change required.

/TYPED_INTERFACE

runProject(INVEST_ADVISOR, {
  stock: string,
}) -> json