GraphRAG 101

posted in: AI, Azure | 1

image

When I first came across GraphRAG – all the documentation pointed to this solution accelerator. While that’s great, to give it a go I wanted something simpler. After a bit of digging I finally came across this article.

There’s lots of setup options but I’m running with Azure Open AI

Prerequisites

  • At the time of writing needed Python 3.11. See here for easy way to switch versions
  • Install the Python package 
  • Azure Open AI key
  • Text Embedding Deployment
  • Model Deployment

Settings

This one got a bit tricky but here’s what worked for me.

image

model_supports_json: false – the default file generates true and for me would fail on creating community reports step until i tried this as false

api_version: this doesn’t seem to the be what you get from your deployment – I changed this back to the default and it worked

api_base: get this from the endpoint setting in azure portal

image

model and deployment_name:get these from model name and name under deployments in azure ai studio

image

Running the index pipeline

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

Once you run successfully it will look like below. An output folder gets created with artifacts and reports. Under reports there is a log file which is where you need to go looking if you encounter any errors.

image

Queries

When I first tried this it would not work at all. I upgraded to v0.2.2 and suddenly queries started working.