# RAG oparty na grafie wiedzy (GraphRAG)

EN: **Graph-based retrieval-augmented generation (GraphRAG)** · id `graphrag` · aliases: GraphRAG, Graph RAG, knowledge-graph RAG, KG-RAG, RAG grafowy

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Aplikacje LLM i agenci](https://aiatlasgraph.com/t/applications.md) › [Wyszukiwanie i RAG](https://aiatlasgraph.com/t/retrieval.md) › RAG oparty na grafie wiedzy (GraphRAG)

## Description

- PL: Wariant RAG, w którym model buduje z korpusu graf encji i relacji, grupuje go w społeczności i wykorzystuje ich streszczenia do odpowiedzi.
- EN: A RAG variant in which a model builds an entity-relation graph from a corpus, clusters it into communities and uses their summaries to answer.

## In one sentence

- PL: Zanim asystent zacznie odpowiadać, zamienia stos dokumentów w mapę osób, miejsc i powiązań, a potem korzysta z tej mapy.
- EN: Before answering, the assistant turns a pile of documents into a map of people, places and links, then uses that map.

## Problem it solves

- PL: Zwykłe wyszukiwanie fragmentów nie odpowie na pytanie o całość, np. jakie główne wątki przewijają się w tysiącu notatek.
- EN: Plain passage search cannot answer questions about the whole, such as which main themes run through a thousand notes.

## What it does

- PL: Jak śledczy, który przypina zdjęcia i nitki na tablicy, a potem streszcza każdą grupę powiązanych osób.
- EN: Like an investigator pinning photos and string to a board, then summarising each cluster of connected people.

## Everyday example

- PL: Dziennikarz wrzuca setki wywiadów i pyta, jakie tematy łączą rozmówców; dostaje przegląd głównych wątków zamiast kilku cytatów.
- EN: A journalist uploads hundreds of interviews and asks what themes connect the speakers; they get an overview of main threads, not a few quotes.

## This concerns you if you…

- PL: masz duży zbiór dokumentów i pytasz o ogólny obraz
- PL: zależy ci na powiązaniach między osobami i firmami w tekście
- EN: have a large document collection and ask about the big picture
- EN: care about links between people and organisations in text

## Keywords

Microsoft GraphRAG · LightRAG · community summaries · Leiden algorithm · entity extraction · knowledge graph construction · Neo4j · local vs global search · query-focused summarization

## How it works

- PL: Podczas indeksowania model wyodrębnia encje i relacje z fragmentów tekstu, tworząc graf wiedzy. Algorytm wykrywania społeczności dzieli graf na grupy powiązanych encji, a model z góry pisze streszczenie każdej grupy. Pytania globalne obsługuje map-reduce: każde streszczenie daje odpowiedź cząstkową, które są łączone; pytania lokalne przeszukują sąsiedztwo encji.
- EN: During indexing a model extracts entities and relations from text chunks into a knowledge graph. A community-detection algorithm splits the graph into related clusters, and the model pre-writes a summary for each. Global questions use map-reduce: each summary yields a partial answer and these are combined; local questions search an entity's neighbourhood.

## Limits

- PL: Budowa indeksu wymaga wielu wywołań modelu, więc jest kosztowna i wolna przy dużych korpusach, a aktualizacja po zmianie danych bywa kłopotliwa. Błędy ekstrakcji encji przenoszą się do grafu; przy prostych pytaniach o konkretny fakt zwykły RAG często wystarcza.
- EN: Index construction takes many model calls, so it is costly and slow for large corpora, and updating after data changes can be awkward. Entity-extraction errors propagate into the graph; for simple factual questions plain RAG often suffices.

## Key terms

- PL: **encja**: Rozpoznany obiekt w tekście: osoba, firma, miejsce lub pojęcie.
- PL: **wykrywanie społeczności**: Dzielenie grafu na grupy węzłów gęściej połączonych ze sobą niż z resztą.
- PL: **pytanie globalne**: Pytanie o cały zbiór danych, a nie o pojedynczy fragment.
- EN: **entity**: A recognised object in text: a person, company, place or concept.
- EN: **community detection**: Splitting a graph into node groups more tightly linked to each other than to the rest.
- EN: **global query**: A question about the whole dataset rather than one passage.

## Know first

- [Grafy wiedzy (Knowledge graphs)](https://aiatlasgraph.com/t/kgraphs.md)
- [Dzielenie dokumentów (Document chunking)](https://aiatlasgraph.com/t/chunking.md)

## Sources

- [From Local to Global: A Graph RAG Approach to Query-Focused Summarization](<https://arxiv.org/abs/2404.16130>) `edge-graphrag-2024` · by Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley, Alex Chao, Apurva Mody, Steven Truitt, Jonathan Larson

---

AI Atlas revision 124 (2026-10-31) · HTML: https://aiatlasgraph.com/t/graphrag · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-31
