Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
770ee94
First version of GraphRAG Xeon for LLM, and open endpoint for graph i…
edlee123 May 23, 2025
ca90df5
Updated align_generator to be like ChatQnA bytes format. Added loggin…
edlee123 May 25, 2025
1658169
Working GraphRAG on laptop cpu with help of three LLM endpoints for d…
edlee123 May 25, 2025
42d9d41
The GraphRAG gaudi compose.yaml had to be updated so the UI can pass …
edlee123 May 25, 2025
fa1bc52
Provided build instructions of GraphRAG images for Xeon
edlee123 May 25, 2025
b6e7729
Small edits to GraphRAG xeon readme
edlee123 May 25, 2025
70330c5
Merge branch 'main' into graphrag_workshop
edlee123 May 25, 2025
6606ab0
Add architecture container diagram
edlee123 May 25, 2025
d50bf14
Fix to compose.yaml dataprep-neorj-llamaindex port and dataprep compo…
edlee123 May 25, 2025
a61e299
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 5, 2025
0cf4c1f
Recovering changes in README, compose.yaml, and example_data
edlee123 Jun 5, 2025
27be954
Try to fix bash blocks for sphinx formatting
edlee123 Jun 5, 2025
9bd1689
Merge branch 'main' into graphrag_workshop
edlee123 Jun 6, 2025
68e44de
Merge branch 'main' into graphrag_workshop
edlee123 Jun 6, 2025
0a03771
Fix dataprep service port to be internal port
edlee123 Jun 7, 2025
7738e2f
Merge branch 'graphrag_workshop' of github.com:edlee123/GenAIExamples…
edlee123 Jun 7, 2025
9885a8f
Clean up comments
edlee123 Jun 7, 2025
e85ed3d
Merge branch 'main' into graphrag_workshop
chickenrae Jun 9, 2025
1ba7797
Merge branch 'main' into graphrag_workshop
edlee123 Jun 11, 2025
8e55578
Merge branch 'main' into graphrag_workshop
chickenrae Jun 12, 2025
19915b9
Merge branch 'main' into graphrag_workshop
ashahba Jun 13, 2025
324b92a
Merge branch 'main' into graphrag_workshop
ashahba Jun 13, 2025
2290cd7
Updated example data to refer to wikipedia source
edlee123 Jun 13, 2025
fe99232
Merge branch 'graphrag_workshop' of github.com:edlee123/GenAIExamples…
edlee123 Jun 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions GraphRAG/docker_compose/intel/cpu/xeon/GraphRAG_LLM_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# About GraphRAG LLMs

## Overview

GraphRAG uses three distinct LLMs, each optimized for different tasks in the pipeline:

1. Dataprep LLM
2. Retriever LLM
3. Final LLM

## 1. Dataprep LLM

Used during data ingestion phase to:

- Process and understand document structure
- Extract entities and relationships between entities
- Generate and store community summaries in Neo4j:

```python
# neo4j_llamaindex.py
async def generate_community_summary(self, text):
"""Generate summary for a given text using an LLM."""
messages = [
ChatMessage(
role="system",
content=(
"You are provided with a set of relationships from a knowledge graph... "
"Your task is to create a summary of these relationships..."
),
)
]
response = await self.llm.achat(trimmed_messages)
```

**Key Requirements:**

- High-quality model for accurate relationship understanding
- Larger context window for document processing
- Can be slower since it's one-time processing

## 2. Retriever LLM

Used during query processing to:

- Evaluate relevance of pre-computed community summaries
- Generate specific answers from relevant communities
- Process multiple communities in parallel

```python
def generate_answer_from_summary(self, community_summary, query):
"""Generate an answer from a community summary based on a given query using LLM."""
prompt = (
f"Given the community summary: {community_summary}, "
f"how would you answer the following query? Query: {query}"
)
response = self._llm.chat(messages)
```

**Key Requirements:**

- Fast inference for real-time processing
- Efficient batch processing capabilities
- Balance between quality and speed

## 3. Final LLM

Used as the last step to:

- Process all retriever-generated answers
- Synthesize information from multiple communities
- Generate coherent final response

```python
# In graphrag.py
llm = MicroService(
name="llm",
host=LLM_SERVER_HOST_IP,
port=LLM_SERVER_PORT,
endpoint="/v1/chat/completions",
service_type=ServiceType.LLM,
)
```

**Key Requirements:**

- Good at synthesizing multiple sources
- Strong natural language generation
- Maintains context across multiple inputs

## Data Flow

1. **Ingestion Phase**

- Documents → Dataprep LLM → Community Summaries
- Summaries stored in Neo4j

2. **Query Phase**
- Query → Retriever LLM → Individual Community Answers
- Answers → Final LLM → Coherent Response

## Configuration

Each LLM can be configured independently through environment variables:

- `DATAPREP_LLM_ENDPOINT` and `DATAPREP_LLM_MODEL_ID`
- `RETRIEVER_LLM_ENDPOINT` and `RETRIEVER_LLM_MODEL_ID`
- `FINAL_LLM_ENDPOINT` and `FINAL_LLM_MODEL_ID`

This allows for optimization of each LLM for its specific task in the pipeline.
Loading
Loading