The main concern of MiniRAG is cost, privacy and storage. MiniRAG is based on 3 observations:
- SLMs are weak at semantic understanding but strong at pattern matching
- Clear structural information can make up for limited semantic abilities
- Breaking down complex RAG tasks into simple steps maintains performance without needing advanced reasoning.
Like LightRAG, MiniRAG is also divided into 3 different parts: preprocess, retrieval.
During preprocess stage,
- MiniRAG split documents into chunks
- extract named entities from chunks
- create chunk nodes and entity nodes
- we create entity-chunk edges and entity-entity edges (for semantic or co-occurrence relationships)
- build a heterogeneous graph where both entity node and chunk node participate in retrieval.
During retrieval stage, 2 substages are identified.
- Query semantic mapping
- extract relevant entities from query
- predict answer type, such as event, concept, person, etc.
- convert query into simpler matching targets that SLMs can handle.
- Topology-enhanced graph retrieval
- key relationship identification
- query-guided path discovery
- retrieval of query-relevant text chunks
- candidate filtering
- similarity computation
- ranking & selection
- integration for augmented generation
This framework works, because MiniRAG makes the retrieval tasks easier for SLMs by replacing “understand everything semantically” with “match entities, relations, paths and chunks in a structured graph”.