GraphRAG setup, traditional RAG comparison and costs

Learn GraphRAG indexing and global versus local queries using A Christmas Carol, with a reported $7 processing cost in the July 2024 demonstration.

Player not loading? Watch on YouTube

Uploaded on July 4, 2024, this tutorial explains Microsoft's open source GraphRAG and demonstrates a local installation using Python, a Conda environment and A Christmas Carol. The source gives no GraphRAG package version; its setup steps and configuration describe the software at that time.

The speaker compares traditional retrieval over document chunks with GraphRAG's entity and relationship extraction. GraphRAG builds a knowledge graph, groups entities into communities and creates summaries for answering questions across the document collection. The speaker argues that this helps with broad thematic questions that chunk retrieval can miss, rather than establishing that every traditional RAG system fails at them.

The demonstration initializes a workspace, configures GPT-4o through an OpenAI API key and runs indexing. It uses 300-token chunks with a 100-token overlap. The speaker believes input support was limited to plain text at the time. Although the package runs on the local machine, this example uses hosted models. Ollama appears as a possible local model endpoint, without a demonstrated setup.

Queries contrast global search for the book's themes with local search about a character. The speaker reports source citations and roughly two minutes of indexing for one document. Processing reportedly involved 570 GPT-4o requests, about 25 embedding requests and over one million tokens, costing around $7. These are figures from this example, not current pricing or a general benchmark.