Menu

GraphRAG hybrid retrieval in TypeScript
📰

GraphRAG hybrid retrieval in TypeScript

DEV Community: typescript·Ashes Born (Shihua Du)·about 14 hours ago
#tB4NXRxq
#devtotypescript#devto#dev#community#evidence
Reading 0:00
15s threshold

Repository: sadofriod/graphrag-ts · npm package: @ashes_born/graph-rag-ts

graphrag-ts exposes two query paths: local retrieval uses entities, communities, and source evidence to answer specific questions; global retrieval analyzes community-summary batches and synthesizes a corpus-level answer. They share the indexed data, but not the same recall strategy.

1. Local Retrieval: Graph Structure Finds Topics, Chunks Find Evidence

GraphRAGRetrievalService first sends the query to parseQuery to extract entities, keywords, and themes, then uses entityMatcher to match indexed entities. The matcher supports exact, alias, fuzzy, and semantic channels and fuses their rankings with Reciprocal Rank Fusion (RRF). The current retrieval service passes an empty alias list, so its active path uses exact, fuzzy, and semantic matching.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.