Welcome to the Multi-Agent Collaboration for Financial Analysis repository! This project showcases how multiple intelligent agents can work together to solve complex financial tasks. 🚀
Before running the code, make sure you have the following set up:
-
Anthropic API Key:
- Visit [Anthropic's website](https://console.anthropic.com/ to create an account and generate an API key.
- Add the key to a
.envfile asANTHROPIC_API_KEY.
-
Serper API Key (or other search APIs):
- Sign up at Serper to obtain an API key.
- Add the key to the
.envfile asSERPER_API_KEY.
-
Optional: Other LLMs
- While this repository uses Anthropic Claude, you can integrate other large language models (LLMs) by modifying the code accordingly. Ensure the appropriate API keys are added to the
.envfile.
- While this repository uses Anthropic Claude, you can integrate other large language models (LLMs) by modifying the code accordingly. Ensure the appropriate API keys are added to the
-
Install the required libraries:
pip install crewai crewai_tools anthropic litellm langchain_community
-
Ensure Python 3.8+ is installed.
-
Use either:
- Jupyter Notebook: Install Jupyter Notebook and open the provided
.ipynbfile. - Google Colab: Upload the
.ipynbfile to Google Colab for an easy-to-use cloud environment. - Amazon SageMaker: Use Amazon SageMaker Studio for a managed and scalable machine learning environment.
- Jupyter Notebook: Install Jupyter Notebook and open the provided
This project focuses on:
-
🤝 Multi-Agent Collaboration: Leverages multiple agents to collaborate and exchange data for enhanced financial analysis.
-
🧠 Anthropic Claude Integration: Utilizes Claude for natural language processing and reasoning tasks.
-
🔄 Extensibility: Supports integration with other LLMs or APIs for customized workflows.
-
🧰 Utilities: The
utilsmodule includes helper functions for loading API keys and managing environment variables.
Here are the 4 agents designed to collaborate in this project:
-
📊 Data Analyst: Gathers and processes financial data to extract meaningful insights.
-
📈 Trading Strategy Agent: Develops and evaluates trading strategies based on data trends and predictive models.
-
💼 Trade Advisory Agent: Provides recommendations on trade executions, taking into account market conditions and strategies.
-
⚠️ Risk Advisor Agent: Assesses potential risks and ensures strategies align with risk management protocols.
-
Clone the repository:
git clone https://github.com/draqai/financial-analysis.git cd financial-analysis -
Create a
.envfile in the project directory:ANTHROPIC_API_KEY=your_anthropic_key SERPER_API_KEY=your_serper_key
-
Run the Jupyter Notebook:
jupyter notebook Collaboration_Financial_Analysis_wClaude.ipynb
-
Follow the notebook steps to execute the multi-agent collaboration workflow.
- Flexibility: Swap out Anthropic Claude for other LLMs like Llama or DeepSeek.
- Scalable Workflows: Easily extend the solution to handle different domains beyond financial analysis.
- Modular Utilities: Customize the
utilsmodule for additional functionality.
This project is licensed under the MIT License.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the solution.
