- File type:
.txt
only
pip install -r requirements.txt
No API key required for this step.
python -m graphrag.index --init --root ./ragtest
mkdir ./ragtest/input
You can convert .pdf to .txt using convert.py, also calculate tokens
Set your OpenAI APIkey in .env
GRAPHRAG_API_KEY=""
Also configure your settings.yaml with parameters like chunk size, model, embedding, etc.
python -m graphrag.index --root ./ragtest
After Embedding, output will be saved in ragtest/output
Global level
python -m graphrag.query --root ./ragtest --method global "your question"
Local level (Specific character or terminology)
python -m graphrag.query --root ./ragtest --method local "your question"
- Number of tokens in the txt file: 13,592
- Price: $1.62
- Price: $0.07