Home

Awesome

<div align="center"> <img src="docs/DepRAG.png" alt="Logo" width="400" align="center"> </div>

DepsRAG

DepsRAG is a chatbot that answers user's questions about software dependencies after representing them as a Knowledge Graph (KG). DepsRAG offers the following features:

DepsRAG Architecture

DepsRAG uses the following set of tools to accomplish its process:

DepsRAG Workflow

The workflow of DepsRAG as follows:

:fire: Updates/Releases

<details> <summary> <b>Click to expand</b></summary> </details>

:gear: Installation and Setup

DepsRAG requires Python 3.11+. We recommend using a virtual environment.

# clone the repo and cd into repo root
git clone https://github.com/Mohannadcse/DepsRAG.git
cd DepsRAG

# create a virtual env under project root, .venv directory
python3 -m venv .venv

# activate the virtual env
. .venv/bin/activate

# install dependencies from pyproject.toml:
# This installs DepsRAG
poetry install 

Set up environment variables (API keys, etc)

DepsRAG requires a set of environment variables to operate. In the root of the repo, copy the .env-template file to a new file .env to set the values of these environment variables.

cp .env-template .env

Following is a description of these environment variables:

docker run --rm \
    --name neo4j \
    -p 7474:7474 -p 7687:7687 \
    -e NEO4J_AUTH=neo4j/password \
    neo4j:latest

Upon creating the cloud account successfully, neo4j will create a text file contains account settings. Please provide the following Neo4j environment variables:

NEO4J_USERNAME=typically neo4j
NEO4J_PASSWORD=your-neo4j-password
NEO4J_URI=uri-to-access-neo4j-dayabase OR bolt://neo4j:7687 if you use Neo4j Docker image
NEO4J_DATABASE=typically neo4j

:whale: Docker Instructions

We provide a containerized version of DepsRAG, where you can run DepsRAG using Chainlit in UI mode or CLI mode.
All you need to do is set up environment variables in the .env (as shown in .env-template) file after clonning DepsRAG repository. We created ths script run_depsrag_docker.sh. So everything will be working in an automated manner. Once you run this script, it will ask you to select the mode for running DepsRAG. Then you can interact with DepsRAG chatbot.

git clone https://github.com/Mohannadcse/DepsRAG.
cd DepsRAG
docker compose build
chmod +x run_depsrag_docker.sh
./run_depsrag_docker.sh

The script run_depsrag_docker.sh spins up two containers: Neo4j and DepsRAG app. After finishing the interaction with DepsRAG chatbot, you can run the command docker compose down to shut down the containers.

Running DepsRAG

DepsRAG supports two modes: CLI and UI (using chainlit).

Run DepsRAG in the CLI mode using this command:

python3 dependencyrag/dependency_chatbot.py
 -m <LLM-Name>

The flag -m provides the option to overwrite the default LLM (gpt-4o) used by DepsRAG. If you want to use Azure, set the flag -m azure, while for other LLMs, please check Langroid documentation (Open/Local LLMs and other non-OpenAI proprietary LLMs).

Here is a recording shows the CLI mode in action: Demo

Run DepsRAG in the UI mode using this command:

chainlit run dependencyrag/chainlit/chainlit_dependency_chatbot.py

Here is a recording shows the UI moded in action: Demo

NOTE: the dependency graph is constructed based on DepsDev API. Therefore, the Chatbot will not be able to construct the dependency graph if this API doesn't provide dependency metadata infromation.

DepsRAG Paper Citation

You can find the paper that describes the details of DepsRAG HERE

@misc{alhanahnah2024depsrag,
      title={DepsRAG: Towards Managing Software Dependencies using Large Language Models}, 
      author={Mohannad Alhanahnah and Yazan Boshmaf and Benoit Baudry},
      year={2024},
      eprint={2405.20455},
      archivePrefix={arXiv},
      primaryClass={cs.SE}
}