CogMem:基於圖推理的大型語言模型認知記憶系統

CogMem: A Cognitive Memory System with Graph-Based Reasoning for LLM Agents

檔案

日期

2026

作者

類型

語言

英文

摘要

大型語言模型(LLM)代理的長期記憶仍面臨諸多挑戰:現有系統或僅依賴單模態嵌入檢索,遺漏詞彙形式不同但主題相關的記憶;或僅採用局部相似度,無法辨識圖中全域具重要性的節點;或僅回傳孤立的記憶片段,未能重建明確的推理路徑。本研究提出 CogMem,一套基於圖結構的認知記憶架構,透過三項核心機制解決上述限制:(1)結合個人化 PageRank 擴展的混合式檢索:融合語義搜尋與 BM25 關鍵字檢索,作用於由 LLM 生成的實體名稱與關鍵字欄位,並進一步擴展以找出局部相似度之外、結構上位居核心的橋接節點;(2)結合 Cross-Encoder 重排序的路徑式檢索:明確重建具型別關係脈絡的三跳推理鏈,以支援跨輪次的多跳推理;(3)基於社群偵測的記憶演化機制:採用 Leiden 社群偵測演算法,透過遞迴式 LLM 抽象化,將相關記憶整併為階層式洞見(Insight)。CogMem 維護一個具八種有向邊型別(其中七種由 LLM分類、一種由系統管理)的型別化知識圖,用以編碼因果與時序語意。在 LOCOMO 基準測試中,於相同條件下與 A-Mem 比較,CogMem 於所有推理類別的 F1 分數皆取得一致的提升:多跳推理(Multi-Hop)+51%、開放領域(Open-Domain)+51%、單跳(
Single-Hop)+24%、時序(Temporal)+33%。此優勢在三種 LLM 骨幹模型(GPT-4o-mini、gpt-oss:20b、gemma3:4b)皆能泛化。在 BEAM 基準測試中,CogMem 在四個評估系統中取得了最高的平均準確率 (0.486),證實了其超越 LOCOMO 的泛化能力。儘管圖結構建構更為豐富,CogMem 透過平行化流程仍達成 44% 的記憶寫入加速,且所有圖元件皆隨對話長度線性成長(O(M)),驗證其在長期對話代理中的實務可部署性。
Long-term memory for LLM agents remains challenging: existing systems either rely on single-modal embedding retrieval that misses lexically diverse but topically related memories, apply only local similarity without identifying globally significant nodes, or return isolated memory fragments without reconstructing explicit reasoning paths. We present CogMem, a graph-based cognitive memory architecture that addresses these limitations through three mechanisms: (1) hybrid retrieval with Personalized PageRank expansion, combining semantic search and BM25 keyword matching over LLM-generated entity name and keywords to surface structurally central bridge nodes beyond local similarity; (2) path-based retrieval with Cross-Encoder reranking, explicitly reconstructing 3-hop reasoning chains with typed relational context for multi-hop inference; and (3) community-based memory evolution, employing Leiden community detection to consolidate related memories into hierarchical Insights via recursive LLM abstraction. CogMem maintains a typed knowledge graph with eight directed edge types (seven LLM-classified, one system-managed) encoding causal and temporal semantics. Evaluated on the LOCOMO benchmark against A-Mem under identical conditions, CogMem achieves F1 improvements across all four reasoning categories : Multi-Hop (+51%), Open-Domain (+51%), Single-Hop (+24%), and Temporal (+33%). These gains generalize across LLM backbones (GPT-4o-mini, gpt-oss:20b, gemma3:4b). On the BEAM benchmark, CogMem achieves the highest macro-average accuracy (0.486) across three evaluated systems, indicating generalization beyond LOCOMO. Despite richer graph construction, CogMem achieves 44% faster ingestion through a parallelized pipeline, and all graph components scale linearly with conversation length (O(M)), confirming practical deployability for long-term conversational agents.
顯示完整詮釋資料 統計資料

引用此條目

Yao, L. (2026). CogMem: A Cognitive Memory System with Graph-Based Reasoning for LLM Agents. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/89697

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享

永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/89697