How parvdaga/stockbro works
StockBro AI provides Indian-market stock quotes, historical charts, news, and AI-generated financial guidance through a FastAPI backend and Streamlit interface. The main workflow is a user query entering the interface and API, being parsed and handled by the master agent or a domain endpoint, then drawing on market/news integrations and returning results. Authentication and watchlists are additional product branches. Source excerpts establish much of the backend wiring; the README documents the frontend/backend split, but does not show the frontend’s request implementation.
Main entry points: router.py API Router · groww.py Groww Client · master_agent.py Master Agent · newsdata.py NewsData Client
Components 28
User Interface
- Streamlit App
streamlit_app/main.py
API and Accounts
- FastAPI App
backend/app/main.py - API Router
backend/app/api/v1/router.py - Chat API
backend/app/api/v1/chat.py - Stocks API
backend/app/api/v1/stocks.py - Charts API
backend/app/api/v1/charts.py - News API
backend/app/api/v1/news.py - Auth API
backend/app/api/v1/auth.py - Watchlist API
backend/app/api/v1/watchlist.py
AI Analysis
- Master Agent
backend/app/agents/master_agent.py - Intent Router
backend/app/agents/query_router.py - Finance Agent
backend/app/agents/finance_agent.py - News Agent
backend/app/agents/news_agent.py - Market Knowledge
backend/app/core/knowledge_base.py - Shared LLM Model
backend/app/agents/shared_model.py
Market Data
- Stock Service
backend/app/services/stock_service.py - Groww Client
backend/app/integrations/groww.py - NewsData Client
backend/app/integrations/newsdata.py
Shared Infrastructure
- Auth Dependencies
backend/app/core/dependencies.py - Supabase Client
backend/app/core/supabase_client.py - TTL Cache
backend/app/integrations/cache.py - Rate Limiter
backend/app/integrations/rate_limiter.py - Retry Logic
backend/app/integrations/retry.py
Other components
- Investor
- Supabase
- Groq / Gemini
- Groww Market Data
- NewsData.io
Connections 37
- Investor → Streamlit App: asks / views
README.md - Streamlit App → FastAPI App: uses backend
README.md - FastAPI App → API Router: mounts routes
backend/app/main.py - API Router → Chat API: includes
backend/app/api/v1/router.py - API Router → Stocks API: includes
backend/app/api/v1/router.py - API Router → Charts API: includes
backend/app/api/v1/router.py - API Router → News API: includes
backend/app/api/v1/router.py - API Router → Auth API: includes
backend/app/api/v1/router.py - API Router → Watchlist API: includes
backend/app/api/v1/router.py - Chat API → Master Agent: invokes
backend/app/api/v1/chat.py - Chat API → Intent Router: routes intent
backend/app/api/v1/chat.py - Master Agent → Intent Router: parses queries
backend/app/agents/master_agent.py - Master Agent → Finance Agent: uses tools
backend/app/agents/master_agent.py - Master Agent → News Agent: uses tools
backend/app/agents/master_agent.py - Master Agent → Market Knowledge: reads knowledge
backend/app/agents/master_agent.py - Master Agent → Shared LLM Model: gets model
backend/app/agents/master_agent.py - Finance Agent → Shared LLM Model: gets model
backend/app/agents/finance_agent.py - News Agent → Shared LLM Model: gets model
backend/app/agents/news_agent.py - Shared LLM Model → Groq / Gemini: configures provider
backend/app/agents/shared_model.py - Finance Agent → Groww Client: fetches prices
backend/app/agents/finance_agent.py - News Agent → NewsData Client: fetches news
backend/app/agents/news_agent.py - Stocks API → Stock Service: calls service
backend/app/api/v1/stocks.py - Stock Service → Groww Client: requests stock data
backend/app/services/stock_service.py - Charts API → Groww Client: requests history
backend/app/api/v1/charts.py - News API → NewsData Client: requests news
backend/app/api/v1/news.py - Groww Client → Groww Market Data: fetches market data
backend/app/integrations/groww.py - NewsData Client → NewsData.io: fetches articles
backend/app/integrations/newsdata.py - Groww Client → TTL Cache: caches responses
backend/app/integrations/groww.py - Groww Client → Rate Limiter: uses limits
backend/app/integrations/groww.py - Groww Client → Retry Logic: retries failures
backend/app/integrations/groww.py - NewsData Client → TTL Cache: caches responses
backend/app/integrations/newsdata.py - NewsData Client → Rate Limiter: uses limits
backend/app/integrations/newsdata.py - NewsData Client → Retry Logic: retries failures
backend/app/integrations/newsdata.py - Auth API → Auth Dependencies: uses auth
backend/app/api/v1/auth.py - Watchlist API → Auth Dependencies: requires user
backend/app/api/v1/watchlist.py - Auth Dependencies → Supabase Client: gets client
backend/app/core/dependencies.py - Supabase Client → Supabase: connects to