liveBook · Manning

Community summary

As explained in Domain-Specific Small Language Models

A high-level summary of a group of related graph entities used as an intermediate unit for search and response generation.

A community summary is a high-level overview of a group of closely related entities in a knowledge graph. It gives GraphRAG a prepared unit of context for global search: instead of answering a broad question from individual document chunks alone, the system can draw on summaries of multiple parts of the graph. section 14.1 section 14.4

Community summaries cross the boundary between indexing and query time:

  • During indexing, an LLM extracts entities and relationships from document chunks. A graph groups densely connected entities into communities, and an LLM pregenerates a summary for each group. section 14.1
  • At query time, each summary supports a partial answer to the user's question. The partial answers are combined into one final response. section 14.1

The distinction from local search matters. Global search uses the pregenerated community summaries; local search combines knowledge-graph entities with relevant source-document chunks and embeddings. The summaries therefore serve as intermediate answers' context, not as a replacement for every retrieval method. section 14.1.1

From a movie graph to a broad answer

A movie knowledge graph can contain movies, actors, directors, genres, and production companies. Relationships among them form communities. Summarizing each community before a question arrives lets global search generate an answer from each relevant group and then combine those answers. section 14.1

This shifts summarization work into offline indexing. Its usefulness still depends on the source documents and the resulting graph: poor input documents can degrade graph quality. In the described GraphRAG approach, community-based answers improved comprehensiveness and diversity relative to a conventional RAG baseline. section 14.1

How Domain-Specific Small Language Models covers it

How deep it goes
Traces offline graph extraction, community detection, summarization, and query-time answer combination; distinguishes but does not develop embedding-based local search.
Examples
Uses a movie knowledge graph and prompts for summarizing community text and combining intermediate answers.
What it assumes
Defines knowledge-graph nodes and edges and explains communities as densely connected groups before using them for summarization.
What you can do after
Build it from scratch using extracted entities, graph communities, per-community summaries, and combined query-time answers.
How it connects
Connects knowledge graphs, community detection, the Leiden algorithm, GraphRAG, and global search.

Also explained in

Compare how 2 books explain community summary →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.