How shraddharai412/eightfold.ai_assesment_company_research_ai_assistant works
Project Type and Purpose
• This is a full-stack, Python-based research assistant application.
• It exposes a Streamlit frontend (ui/) and a tightly-coupled backend orchestrator (core/) to gather real-time data, drive an LLM, and generate business-grade account plans.
• No persistent database—data flows from external sources (Yahoo Finance, Google News, Wikipedia, Gemini) through the Research Engine into the UI.
File Structure
• Top level
– app.py: entry point for Streamlit
– requirements.txt / config/keys.env: dependency list and API key storage
• core/ (research_engine + service wrappers)
– research_engine.py: orchestrator
– llm_client.py: Gemini API wrapper
– *_service.py: one file per external data source (ticker, Yahoo, news, wiki)
• plan/
– plan_generator.py: initial 8-section plan creation via Gemini
– plan_updater.py: modifies specific plan sections on user requests
• ui/
– layout.py, components.py, theme.py: Streamlit layout, theming, reusable UI bits
– assets/: static files (bot avatar)
• utils/
– logger.py: centralized debug logging
– text_cleaner.py: normalizes and sanitizes incoming text
Inspect the README for Architecture Insights
• Data-flow pseudocode: User Input → ResearchEngine.run() → PlanGenerator.generate() → Rendered in Sidebar → PlanUpdater → UI.
• Tech stack: Python 3.12, Streamlit, yfinance, RSS, Wikipedia API, Gemini 2.0 Flash.
Main Components
a. Streamlit Frontend (ui/)
b. Research Engine (core/research_engine.py)
c. Service Adapters
• Ticker Service → Yahoo Search Wrapper
• Yahoo Service → Company financials
• News Service → Google News RSS
• Wiki Service → Wikipedia API
d. LLM Client (Gemini)
e. Plan Modules (plan_generator, plan_updater)
f. Utilities (text_cleaner, logger)
g. Configuration Store (config/keys.env)
h. External Systems (Yahoo Finance, Google News, Wikipedia, Gemini API)
Relationships and Data Flow
• User → Streamlit UI → calls Research Engine
• Research Engine
– invokes Ticker Service → retrieves ticker
– parallel calls: Yahoo Service, News Service, Wiki Service
• Aggregated data → LLM Client → generates 8-section plan
• Plan → returned to UI for display
• User edits → Plan Updater modifies existing plan structure → UI updates
Architectural Patterns and Principles
• Orchestrator Pattern: core/research_engine.py coordinates all services
• Separation of Concerns: each service in its own module
• Pipeline / Chain-of-Responsibility: sequential data gathering → LLM → plan generation
• Environment-driven Configuration: config/keys.env for secrets