Knowledge Graph Implementation
This is an reimplementation of LightRAG and PathRAG.
- Clone this repo to a folder of your choice
- In a folder of your choice, create a file named ".env"
- Using Azure OpenAI Services, enter the variables in the .env file:
AZURE_OPENAI_API_KEY = "..."
AZURE_OPENAI_ENDPOINT = "..."
AZURE_OPENAI_API_VERSION = "..."
AZURE_OPENAI_LLM_DEPLOYMENT_NAME = "..."
AZURE_OPENAI_EMB_DEPLOYMENT_NAME = "..."
LLM_PROVIDER = "azure" The value of this variable can be found in your Azure OpenAI Services subscription - Using OpenAI Services, enter the variables in the .env file:
OPENAI_API_KEY = "..."
OPENAI_BASE_URL = "..."
OPENAI_LLM_MODEL = "..."
OPENAI_EMBEDDINGS_MODEL = "..."
LLM_PROVIDER = "openai" - In case your documents include .docx files, make sure that Microsoft Word is installed.
- Open an Anaconda prompt or other command prompt
- Go to the root folder of the project and create a Python environment with pip with
python -m venv venv
This will create a basic virtual environment folder named venv in the root of your project folder NB: The chosen name of the environment folder is here venv. It can be changed to a name of your choice - Activate this environment with
venv\Scripts\activatefor windows orsource venv/bin/activatefor MacOS - All required packages can now be installed with
pip install -r requirements.txt
Go to the root folder of the project and run python graph/main.py on the terminal.