The Bronn Stock Analysis and Prediction Service operates as an advanced chatbot designed to deliver comprehensive insights and recommendations for stock market investments. It employs a range of specialized agents to process user queries and provide actionable intelligence.
- Stock News Analysis: Retrieves and analyzes recent news articles related to a specific stock.
- Stock Price Prediction: Utilizes machine learning models to predict future stock prices.
- Stock Suggestions: Recommends alternative stocks based on the user's input and market data.
- Comprehensive Reporting: Generates detailed reports summarizing analysis results, predictions, and stock suggestions.
The Bronn Orchestrator is the central decision-making agent in the system. It evaluates the user's query and determines which agent(s) should handle the request. Based on the response, it directs the flow of the request to:
- Analyze Stock: Retrieve and process stock news.
- Predict Stock: Generate price predictions.
- Sugest Stock: Provide stock suggestions based on price analysis.
The Web Scraper fetches the latest news articles about a specific stock by performing a web search. It ensures that the news data is current and relevant to the user's query.
After the Web Scraper retrieves the news articles, the Article Info Extractor processes them to extract key information such as headlines, summaries, and publication dates. This information is crucial for understanding market sentiment and trends.
The Price Extractor finds the current price of the queried stock. This data is essential for making accurate predictions and suggestions.
The Stock Predictor uses machine learning models to forecast future stock prices based on historical data and current market conditions. It provides both detailed predictions and a summary for easier understanding.
The Stock Suggester recommends alternative stocks based on the current price and user preferences. It evaluates market trends and provides up to three suggested stocks for consideration.
- Stock Report Generator: Creates a detailed report of the stock prediction, including an introduction, insights, and conclusions.
- Suggestion Report Generator: Produces a report summarizing the suggested stocks, including detailed information to assist the user in making informed decisions.
The stock prediction model is trained using the dataset available from youdata.ai at the following link:
This dataset provides historical stock market data, which is crucial for training the prediction models and generating accurate forecasts.
- User Query: The process starts when a user submits a query to the
/bronn
endpoint. - Orchestration: The Bronn Orchestrator determines the appropriate action (news analysis, price prediction, or stock suggestion) based on the query.
- Agent Invocation: The orchestrator invokes the relevant agents to process the query.
- Data Processing: Each agent processes the data and returns the results.
- Report Generation: The appropriate report generator agent creates a comprehensive report.
- Response: The orchestrator compiles the results and reports, then sends them back to the user.
- FastAPI: A modern, fast (high-performance) web framework for building APIs with Python.
- LangChain: A framework for developing applications powered by language models, used here for web scraping and information extraction.
- Uvicorn: An ASGI server used to run the FastAPI application.
- Pydantic: Data validation and settings management using Python type annotations.
- Deep Learning: For stock price prediction and analysis using Neural Prophet.
- Web Scraping: To gather the latest news and stock data.
To get started with the application, ensure you have the necessary environment variables set up and dependencies installed. Refer to the installation instructions and usage guidelines for more details on running the application and interacting with the API.