README.md
January 3, 2026 ยท View on GitHub
๐ซ LiCoMemory: Lightweight and Cognitive Agentic Memory for Efficient Long-Term Reasoning
If you like our project, please give us a star โญ on GitHub for the latest update.
LiCoMemory is a novel end-to-end agentic memory framework that supports real-time updating and retrieval, enabling efficient and scalable retrieval over multi-session dialogues. LiCoMemory introduces Cognigraph, a lightweight hierarchical graph that utilizes entities and relations as semantic indexing layers, and employs temporal and hierarchy-aware search with integrated reranking for adaptive and coherent knowledge retrieval.
๐ซ Key Features
- Multi-Session Memory: Efficiently stores and retrieves information across multiple dialogue sessions, enabling long-term conversation memory.
- Dynamic Graph Construction: Supports real-time graph update and retrieval augmentation during human-agent interaction.
- Hierarchical Cognigraph: Maintains a multi-layered yet lightweight graph structure for efficient update and accurate retrieval.
- Time-Aware Retrieval: Leverages a unified rerank to achieve balance between entity-level, session-level and temporal-level similarity.
๐ Get Started
Requirements.txt is included to help get you started. To run LiCoMemory, use the following command:
python main.py -opt config/Memory.yaml -dataset_name <dataset_name> -root <root_name> -query 1
Parameters
-opt: Path to the configuration YAML file (e.g.,config/Memory.yaml)-dataset_name: Name of the dataset (e.g.,locomo_0,longmem_ku/lm_1)-external_graph: (Optional) Path to external graph file to load from-root: (Optional) Root directory name for storing results-query: (Optional) Whether to run query and evaluation (1to enable,0to disable). If not specified, will prompt user
Configuration
Update config/Memory.yaml to configure:
- Dataset Path: Set
data_rootto your dataset directory - API Keys: Configure your LLM and embedding API keys
- Key Parameters:
force: Set True for compulsary graph reconstruction; Set False for loading existing graph structure from given pathenable_visual: Set True for a visual feedback of the retrieved contentenable_CogniRank: Set True to enable the unified rerankenable_llm_eval: Set True to utilize LLM judging for the answer; Set False to enable the exact match evaluationenable_summary: Set True to activate session summary generation
๐งฐ Experimental Settings
We have incorporated several baseline methods:
The following datasets are utilized for testing:
- LOCOMO focuses on extremely long multi-session dialogues, containing 1,986 questions in five distinct categories: single-hop, multi-hop, temporal, open-domain and adversial reasoning.
- LongmemEval is a comprehensive benchmark for evaluating long-term memory in conversational agents, consists of 500 questions across six types: single-session user (S.S.U.), single-session assistant (S.S.A.), single-session preference (S.S.P.), multi-session, temporal reasoning, and knowledge update.
Use the scirpts in the folder 'dataset' to modify the original dataset into the intended format for LiCoMemory.
โ๏ธ Experimental Results
LiCoMemory achieves state-of-the-art QA accuracy and recall with lower latency, retrieval volume and token consumption than competing memory frameworks on two long-term dialogue benchmarks across different backbone models, verifying the advantages of its CogniGraph structure and precise retrieval design.
Subset breakdowns also confirm LiCoMemory's consistent superiority across all task types, with the largest improvements in temporal-reasoning and multi-session related queries.
Acknowledgements
We acknowledge these excellent works for providing open-source code and inspiration: Zep, Mem0, A-Mem, LoCoMo, LongMemEval, MemOS, MemoryBank.