This project provides a FastAPI-based server implementation for handling both global and local structured searches using GraphRAG.
Clone the repository and install the required dependencies using the following commands:
git clone [email protected]:noworneverev/graphrag-api.git
cd graphrag-api
python -m venv venv
source venv/bin/activate # for Linux
venv\Scripts\activate # for Windows
pip install -r requirements.txt
- Copy the following files and the
lancedb
folder into theartifacts
folder:lancedb create_final_communities.parquet create_final_community_reports.parquet create_final_nodes.parquet create_final_entities.parquet create_final_relationships.parquet create_final_covariates.parquet create_final_text_units.parquet
- Run the API
python api.py
Open http://127.0.0.1:8000/docs/ to see the API documentation.
You can also use the interface at GraphRAG Visualizer to run queries against the server.
/search/global
: Perform a global search using GraphRAG./search/local
: Perform a local search using GraphRAG./search/drift
: Perform a DRIFT search using GraphRAG./status
: Check if the server is up and running.