This project implements a financial analyst system using LangChain and Ollama. The system allows users to input queries related to finance, such as stock analysis, market trends, and company reports, and returns insightful and organized responses.
- Interactive Financial Queries: Users can input finance-related questions, and the system responds with structured, useful answers.
- LangChain Integration: Utilizes LangChain's
PromptTemplate
to format queries before sending them to the model for accurate results. - Ollama Model: Uses Ollama for AI-driven query handling, delivering concise and relevant financial insights.
- Continuous Interaction: The system stays active and continuously processes user inputs until explicitly stopped.
- Error Handling: Robust error handling ensures smooth operations and prevents system crashes.
To run this system, ensure you have the following libraries installed:
pip install ollama langchain
-
Clone the repository:
git clone https://github.com/TamerOnLine/financial-analyst-system.git cd financial-analyst-system
-
Run the system:
Run the following command to start interacting with the financial analyst system:
python financial_analyst_system.py
-
Input Queries:
Once the system is running, you can input any finance-related query. For example:
What are the current trends in the stock market?
The system will respond with detailed, organized insights.
financial_analyst_system.py
: The main script that initializes the LangChain and Ollama integration, processes user queries, and returns formatted answers.templates/
: Contains the prompt templates used to structure user questions before sending them to the model.
Input: What are the most profitable tech stocks in 2024?
Response:
- Stock A: Detailed performance metrics
- Stock B: Insights on market position
...
- Data Integration: Add real-time financial data integration from APIs to enhance response accuracy.
- Advanced Analysis: Implement deeper financial analysis and machine learning-based predictions.
We welcome contributions! Please follow the steps below to contribute:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE
file for more details.
Developed by Tamer.