Skip to content

A modular graph-based Retrieval-Augmented Generation (RAG) system

Benachrichtigungen You must be signed in to change notification settings

abcd5251/graphrag

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphRAG testing

File Requirements

  • File type: .txt only

Execution Steps

1. Install Dependency

pip install -r requirements.txt

2. Initial Structure (We use ragtest as folder name)

No API key required for this step.

python -m graphrag.index --init --root ./ragtest

3. Make input folder

mkdir ./ragtest/input

4. Put your file inside input folder (.txt only)

You can convert .pdf to .txt using convert.py, also calculate tokens

5. Set Your OpenAI API Key and Settings

Set your OpenAI APIkey in .env

GRAPHRAG_API_KEY=""

Also configure your settings.yaml with parameters like chunk size, model, embedding, etc.

6. Embedding

python -m graphrag.index --root ./ragtest

After Embedding, output will be saved in ragtest/output

7. Ask question

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"

Cost of Embedding

  • Number of tokens in the txt file: 13,592
  • Price: $1.62

Cost of single query

  • Price: $0.07

Über uns

A modular graph-based Retrieval-Augmented Generation (RAG) system

Ressourcen

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.6%
  • Jupyter Notebook 2.4%