A FastAPI-based server that provides Global, Local, DRIFT, and Basic search capabilities based on Microsoft GraphRAG. Designed for easy integration with the GraphRAG Visualizer or custom clients.
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 entire GraphRAG project directory (e.g.,
ragtest/
) into the root of this repository. This folder must contain at least:output
,prompts
,settings.yaml
and.env
. - In
config.py
, pointPROJECT_DIRECTORY
at that folder, and adjust any other options as needed:PROJECT_DIRECTORY = "ragtest" # ← name of the folder you just copied COMMUNITY_LEVEL = 2 CLAIM_EXTRACTION_ENABLED = False RESPONSE_TYPE = "Single Paragraph"
- 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./search/basic
: Perform a basic search using text units.