How We Brewed RAGU: A System for Quickly Building a Knowledge Graph from Raw Texts

Mikhail Komarov, Yana Dementeva7 Nov 2025

Problem

Ordinary RAG takes the top chunks by embedding similarity, so it handles single-fact questions. It fails on questions about the whole corpus, such as "what is the main topic of the text" or "which authors contributed most to NLP". Microsoft's GraphRAG answers these through a knowledge graph, but every indexing step (entities, relations, descriptions) calls a large LLM. Indexing is slow, expensive and not always good.

Example from the article: the CheGeKa benchmark, about 200 Wikipedia articles, yields about 60 thousand entities and slightly over a million relations to extract.

Solution in brief

RAGU swaps the large LLM in GraphRAG indexing for small models trained to extract entities and relations, normalize entities and describe both. The core model is Qwen3-0.6B fine-tuned on Russian NEREL data extended with Claude-made normalization and descriptions. Descriptions of one entity are clustered and summarized before entering the graph.

Questions this case answers
  • How to build a corpus-wide question answering index from raw texts with small extraction models instead of a large language model
  • How to keep entity descriptions within a model's context when one entity occurs thousands of times in the corpus
  • How to build a cheap graph-RAG knowledge base with small models instead of LLM-based extraction
  • How to answer corpus-wide (abstractive) questions that plain chunk-based RAG misses

Tools and methods

  • GraphRAG — graph-based retrieval and community summaries for corpus-wide questions
  • RAGU-LM — Qwen3-0.6B fine-tuned for entity and relation extraction with descriptions
  • NEREL — Russian dataset with 29 entity types and 49 relation types
  • Claude — normalizes entities and writes descriptions for the NEREL extension
  • Natasha, runne_contrastive_ner, BERT-RE — small-model pipeline, tried and dropped
  • LLM-as-a-judge — compares system answers with reference answers
Continue reading — it's free

Google or a one-time email code. No password.