AI 中文总结
post-graph-rag是一款开源PostgreSQL原生图RAG引擎,解决现有图RAG的基础设施、图质量、时间累积问题,在三语料库对比中构建更优图且支持时间演化特性
AI 中文摘要
基于图的检索增强生成(Graph-based RAG)能够关联单篇文本无法涵盖的事实,但当前实现存在三重开销:基础设施层面需同时维护向量数据库、图数据库和文档数据库并保证三者一致性;图质量层面,因抽取流水线从不拒绝输出,导致图中充斥无实际意义的边;长期运行层面,仅累积的图会将已被取代的事实与当前事实同等对待。post-graph-rag是一款解决上述全部问题的开源引擎:带嵌入的文本块、规范实体图和社区摘要均存储于同一PostgreSQL数据库中,其中pgvector用于搜索,边表用于遍历。抽取阶段的不变约束在数据写入前生效:模糊谓词、代词名称和裸数值会被拒绝;谓词可归一化至可选词汇表;实体通过模型提供的别名解析为每个规范名称对应一个顶点;被拒绝的关系会在否定标记下保留正谓词。时间层允许关系携带文本中的有效性周期,使后续文档可仅通过文档顺序取代早期不兼容的断言,并支持“截至某时间点”的查询。在三个语料库上以相同抽取和嵌入模型与LightRAG对比,post-graph-rag在所有场景下构建了更密集的图,每实体的关系数最高达LightRAG的2.4倍,且更便于查询:不同边标签在每关系中的占比为0.46至0.58(受控词汇表下为0.11),而LightRAG为0.77至1.33;其查询延迟更低,且支持基线所不具备的时间演化特性:在新序列和十年文件中分别有13和8个关系被取代,而LightRAG为0。上述为工程测量结果,非基准测试结果。代码链接:this https URL, this https URL
英文摘要
Graph RAG connects facts no single passage states, but implementations pay three times: in infrastructure, keeping vector store, graph database and document store in sync; in quality, because a pipeline that never refuses extractor output stores edges asserting nothing; and over time, because a graph that only accumulates treats superseded and current facts alike. post-graph-rag is an open-source engine addressing all three. Chunks with embeddings, a canonical entity graph and community summaries live in one PostgreSQL database, with pgvector for search and edge tables for traversal. Extraction output is validated before writing: vague predicates, pronominal names and bare quantities are rejected, predicates normalise onto an optional vocabulary, and entities resolve to one vertex per canonical name. A bi-temporal layer records when a relation held and when the system believed it, superseding incompatible earlier assertions from document order. Against LightRAG on three corpora with extraction and embedding models fixed, it builds a denser and more queryable graph, and supersedes relationships where a baseline with no temporal model supersedes none. On LongMemEval, 500 questions of long-horizon chat memory, it scores 94.0 percent with gemini-3.6-flash against 71.2 for Zep's gpt-4o and 60.2 for full context, leading on all six question types. The largest single contribution is temporal grounding in the prompt: carrying each relation's validity period through to synthesis moves temporal reasoning from 0.496 to 0.881, ablated paired on one graph per instance. On ECT-QA, earnings-call transcripts restating every metric each quarter, it scores 0.807 under that benchmark's own protocol against 0.599, 0.406 and 0.405 published for TG-RAG, LightRAG and GraphRAG. Code: post-graph-rag https://github.com/crajah/post-graph-rag; post-graph https://github.com/crajah/post-graph
Comments35 pages, 8 figures, 15 tables