Skip to content

Commit

Permalink
Updated what is graphrag from the field guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jexp committed Nov 27, 2024
1 parent 20dbe33 commit 2907a06
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 23 deletions.
72 changes: 68 additions & 4 deletions src/content/docs/concepts/intro-to-graphrag.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,76 @@ title: Intro to GraphRAG
description: RAG with a knowledge graph
---

![GraphRAG Overview](../../../assets/images/graphrag-diagram.svg)

## About GraphRAG

GraphRAG is Retrieval Augmented Generation (RAG) using a Knowledge Graph.

## Further reading
Have you ever stumbled upon the term GraphRAG while diving into the world of Retrieval Augmented Generation (RAG) systems? If so, you’re not alone. This term is making waves, but its meaning can be elusive. Sometimes, it’s a specific retrieval method; other times, it’s an entire software suite, like Microsoft’s GraphRAG “data pipeline and transformation suite.” With such varied uses, it’s no wonder even the most dedicated followers of RAG discussions can feel a bit lost.

So, what exactly is GraphRAG?

> For us, it’s a set of RAG patterns that leverage a graph structure for retrieval. Each pattern demands a unique data structure, or graph pattern, to function effectively.
![GraphRAG Overview](../../../assets/images/graphrag-diagram.svg)


On this site, we’ll dive into the GraphRAG pattern details, breaking down each pattern’s attributes and strategies.

If you’re looking for an introduction to RAG, check out [What Is Retrieval-Augmented Generation (RAG)?](https://neo4j.com/blog/what-is-retrieval-augmented-generation-rag/).

Each of our presented patterns is also linked directly to its [GraphRAG Pattern Catalog](/reference/) entry.
This catalog is an open source initiative to stay up to date on the latest pattern evolution.

NOTE: We just started collecting patterns and are definitely still missing a lot of them. Please help us build a comprehensive catalog for GraphRAG patterns and join the discussion on the [GraphRAG Discord](https://discord.com/invite/graphrag) channel.

To give you a clearer picture, the patterns explained in this post include:

### Basic GraphRAG Patterns

* [Basic Retriever](/reference/graphrag/basic-retriever/)
* [Pattern Matching](reference/graphrag/pattern-matching/)
* [Cypher Templates](/reference/graphrag/cypher-templates/)
* [Graph-Enhanced Vector Search](reference/graphrag/graph-enhanced-vector-search/)
* [Metadata Filtering](reference/graphrag/metadata-filtering/)
* [Parent-Child Retriever](reference/graphrag/parent-child-retriever/)

### Advanced GraphRAG patterns

* [Dynamic Cypher Generation](/reference/graphrag/dynamic-cypher-generation/)
* [Global Community Summary Retriever](/reference/graphrag/global-community-summary-retriever/)
* [Local Retriever](reference/graphrag/local-retriever/)
* [Hypothetical Question Retriever](reference/graphrag/hypothetical-question-retriever/)


### Knowledge Graph Models

* [Domain Graph](reference/knowledge-graph/domain-graph/)
* [Lexical Graph](reference/knowledge-graph/lexical-graph/)
* [Parent-Child Lexical Graph](reference/knowledge-graph/lexical-graph-parent-child/)
* [Lexical Graph with Sibling Structure](reference/knowledge-graph/lexical-graph-sibling-structure/)
* [Lexical Graph with Extracted Entities](reference/knowledge-graph/lexical-graph-extracted-entities/)
* [Lexical Graph with Extracted Entities and Community Summaries](reference/knowledge-graph/lexical-graph-extracted-entities-community-summaries/)
* [Lexical Graph with Hierarchical Structure](reference/knowledge-graph/lexical-graph-hierarchical-structure/)
* [Lexical Graph with Hypothetical Questions](reference/knowledge-graph/lexical-graph-hypothetical-questions/)
* [Memory Graph](reference/knowledge-graph/memory-graph/)
* [Text Sequence](reference/knowledge-graph/text-seq/)

### Thematic Classification

According to Gao et al., there are three RAG paradigms: naive RAG, advanced RAG, and modular RAG:

![](https://cdn-images-1.medium.com/max/1024/0*okG4Sok4aweO7SIQ)


In an advanced RAG paradigm, pre-retrieval and post-retrieval phases are added to the naive RAG paradigm.
A modular RAG system contains more complex patterns, which require orchestration and routing of the user query.

### The phases of an advanced RAG system:

* Pre-retrieval — Query rewriting, query entity extraction, query expansion, etc.
* Retrieval of relevant context
* Post-retrieval: Reranking, pruning, etc.
* Answer generation

- How-to: [chunking](/guides/chunking/)
Here, we want to focus on the *retrieval phase* and compile a catalog of the most-often referenced GraphRAG retrieval patterns and their required graph patterns.
Please note that the patterns here are not an exhaustive list.
11 changes: 0 additions & 11 deletions src/content/docs/reference/graphrag/search.md

This file was deleted.

45 changes: 40 additions & 5 deletions src/content/docs/reference/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
---
title: Reference Material
description: A reference page in my new Starlight docs site.
title: GraphRAG Patterns Catalog
description: List of GraphRAG retriever patterns and accompanying Knowledge Graph Models
---

Reference pages are ideal for outlining how things work in terse and clear terms.
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting.
## GraphRAG Patterns Catalog

In this GraphRAG Patterns catalog you can find an ever growing set of patterns for knowledge graph models, GraphRAG retrievers and Data Preparation tasks.

### GraphRAG Patterns

* [Basic Retriever](/reference/graphrag/basic-retriever/)
* [Cypher Templates](/reference/graphrag/cypher-templates/)
* [Dynamic Cypher Generation](/reference/graphrag/dynamic-cypher-generation/)
* [Global Community Summary Retriever](/reference/graphrag/global-community-summary-retriever/)
* [Graph-Enhanced Vector Search](reference/graphrag/graph-enhanced-vector-search/)
* [Hypothetical Question Retriever](reference/graphrag/hypothetical-question-retriever/)
* [Local Retriever](reference/graphrag/local-retriever/)
* [Metadata Filtering](reference/graphrag/metadata-filtering/)
* [Parent-Child Retriever](reference/graphrag/parent-child-retriever/)
* [Pattern Matching](reference/graphrag/pattern-matching/)
* [Text2Cypher](reference/graphrag/text2cypher/)

### Knowledge Graph Models

* [Domain Graph](reference/knowledge-graph/domain-graph/)
* [Lexical Graph](reference/knowledge-graph/lexical-graph/)
* [Parent-Child Lexical Graph](reference/knowledge-graph/lexical-graph-parent-child/)
* [Lexical Graph with Sibling Structure](reference/knowledge-graph/lexical-graph-sibling-structure/)
* [Lexical Graph with Extracted Entities](reference/knowledge-graph/lexical-graph-extracted-entities/)
* [Lexical Graph with Extracted Entities and Community Summaries](reference/knowledge-graph/lexical-graph-extracted-entities-community-summaries/)
* [Lexical Graph with Hierarchical Structure](reference/knowledge-graph/lexical-graph-hierarchical-structure/)
* [Lexical Graph with Hypothetical Questions](reference/knowledge-graph/lexical-graph-hypothetical-questions/)
* [Memory Graph](reference/knowledge-graph/memory-graph/)
* [Text Sequence](reference/knowledge-graph/text-seq/)

### Data Preparation

* [Chunking](/guides/chunking)
* [Named Entity Recognition](/preparation/ner)

## Further reading

- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework
* [GraphRAG Patterns Field Guide](https://neo4j.com/developer-blog/graphrag-field-guide-rag-patterns/)
* [Writing Software Patterns](https://www.martinfowler.com/articles/writingPatterns.html)
* [Patterns of Software Architecture 5 - Pattern Languages](https://github.com/ppizarro/coursera/blob/master/POSA/Books/Pattern-Oriented%20Software%20Architecture/Pattern-Oriented%20Software%20Architecture%20Volume%205%20-%20%20On%20Patterns%20and%20Pattern%20Languages%20-%200471486485.pdf)
18 changes: 15 additions & 3 deletions src/content/docs/reference/knowledge-graph/memory-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ title: Memory Graph
description: Structured, navigable, annotated and summarized content
---

Reference pages are ideal for outlining how things work in terse and clear terms.
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting.
## Memory Graph

A memory graph is a graph that captures information from conversations either automatically through a framework, or intentionally by the user storing facts or relationships.

Conversations are rich interactions which pull in facts, optionions, sources, arguments, discussions.

Entities and relationships are

* Questions
* Answers
* Facts
* Sources
* Rating / Feedback

## Further reading

- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework
* [Memory Graphs in Model Context Protocol](https://github.com/modelcontextprotocol/servers/tree/main/src/memory)
* [Langchain Chat Message History w/ Neo4j](https://python.langchain.com/docs/integrations/memory/neo4j_chat_message_history/)

0 comments on commit 2907a06

Please sign in to comment.