A question on Discord found two bugs in my RAG system. Fixing them found a third
说明与用途
RAG 系统错误地分组来源、错误地计算记忆新鲜度,并且 Kafka sink 存在删除事件处理错误。修复后,来源按文档分组,记忆年龄使用最后一次说话时间,sink 能可靠处理删除和重试。
问题
RAG system misrepresented source citations, mis‑ranked memory recency, and had a Kafka sink bug that silently failed on delete events.
结果
Citations now correctly reflect unique documents, memory recency aligns with user interactions, and the Kafka sink reliably ingests changes without silent failures.
工作流
- Identify duplicate source citations by grouping chunks by document id before prompt construction.
- Change memory age calculation to use last spoken time instead of created_at, updating ranking formula.
- Implement Kafka Connect sink with stable event ids, delete handling, blank row removal, placeholder rejection, and offset safety.
- Test end‑to‑end ingestion of snapshots, updates, deletes, and blanks.
- Verify that recency tests now fail against old query to confirm fix.
- Deploy updated sink and monitor for 5xx failures and DLQ behavior.
证据
Retrieval returns chunks, not documents. Ossian took the top six and numbered them for the model…
The query measured it from created_at…
insert or update on table "ingest_events" violates foreign key constraint…
- 记录日期: 2026-09-18T23:00:36.832Z