This repo contains the code for WQU Capstone project where we investigate the use of LLM multi-agent systems for solving tasks in the financial domain. We use the CrewAI framework to orchestrate the agents, and the LlamaIndex framework to creating vector store index from unstructured text data like news and SEC filings.
4 crews have been created that have different focus, with different data sources. A final combined crew is created that combines data from news, SEC filings and market data to provide a final stock analysis that includes a recommendation.
The following screenshots illustrate a output from the combined crew and the main dashboard.
The following diagram shows how the different components of the web app are connected together.
To install the app do the following:
- Clone the repo
git clone https://github.com/KevorkSulahian/agentic-llm-for-better-results.git
cd agentic-llm-for-better-results
- Create a virtual environment and install the dependencies into the environment.
We recommend using the uv package manager to install the dependencies.
From the root of the project run the following command to install the latest dependencies without the development dependencies:
uv sync --upgrade --no-dev
If you want to use standard pip instead, use the following:
python -m venv .venv
source .venv/bin/activate # macOS or Linux
.venv\Scripts\activate # Windows
pip install -r requirements.txt
- Set up
.env
file with necessary API keys.
Activate the virtual environment and start the server by using panel
:
source .venv/bin/activate # macOS or Linux
.venv\Scripts\activate # Windows
panel serve finmas/panel/app.py --show
If you want to start the app with a specific ticker like META
:
panel serve finmas/panel/app.py --show --args --args META
We use Alpha Vantage to get fundamental data (income statements).
You can create your .env
file by copying the .env.template
file in the repo.
Set the following API keys in the .env
file in the repo folder:
- ALPHAVANTAGE_API_KEY for fundamental data.
- ALPACA_API_KEY and
ALPACA_API_SECRET
for access to Benzinga Historical News API. - GROQ_API_KEY for access to running Groq models.
- OPENAI_API_KEY for accessing OpenAI models
gpt-4o
andgpt-4o-mini
. - HF_TOKEN for access to HuggingFace embedding models.
To install the virtual environment, we use the extremely fast uv project manager.
Install uv
using the standalone installer is recommended.
To create or sync a virtual environment the following command can be used in the project folder:
uv sync
To exclude the development dependencies (like pre-commit
) append the --no-dev
flag to the command:
uv sync --no-dev
To add or remove packages, simply use uv add <package>
or uv remove <package>
.
Activate the virtual environment with the following command:
source .venv/bin/activate # macOS or Linux
.venv\Scripts\activate # Windows