CoolFace
Apppublic

star0628/thought-retriever

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes
App README

🧠 Thought-Retriever

Don't Just Retrieve Raw Data β€” Retrieve Thoughts

A self-evolving long-term memory system for LLM-based agents, based on the paper by UIUC, MIT & CMU (TMLR 2026).

v2.0.0 β€” Chinese Optimization

  • β€”πŸ‡¨πŸ‡³ Chinese Embedding Engine: jieba tokenization + TF-IDF, 3-5x better for Chinese
  • β€”πŸ‡¨πŸ‡³ Chinese Prompt Templates: Auto language detection
  • β€”πŸ§Ή Smart Filtering: Skip meaningless messages, clean LLM output labels
  • β€”πŸ›‘ Robust Parsing: Support Chinese "是/否/ζœ‰ζ•ˆ/ζ— ζ•ˆ"

Quick Install

bash
pip install numpy jieba
git clone https://github.com/mhx0628/thought-retriever

Quick Start

python
from thought_retriever import ThoughtMemory, ThoughtConfig

config = ThoughtConfig(project_path=".", language="zh")
memory = ThoughtMemory(config=config)

memory.add_knowledge("小明今年10ε²οΌŒε–œζ¬’η”»η”»ε’ŒθΈ’θΆ³ηƒ")
results = memory.retrieve("ε°ζ˜Žε–œζ¬’δ»€δΉˆ")

Key Features

  • β€”πŸ§  Thought Memory: Distills Q&A into reusable "knowledge diamonds"
  • β€”πŸ”„ Self-Evolving: The more queries you process, the smarter the memory gets
  • β€”πŸŽš Abstraction Hierarchy: Shallow facts β†’ deep insights
  • β€”πŸ›‘ Dual Filters: Anti-hallucination + anti-redundancy
  • β€”πŸ”Œ Model-Agnostic: Works with any LLM
  • β€”πŸŒ Offline-First: 4-tier fallback embedding engine

Links

  • β€”GitHub: https://github.com/mhx0628/thought-retriever
  • β€”Gitee: https://gitee.com/ma-hongxing-1/thought-retriever
  • β€”Paper: https://arxiv.org/abs/2604.12231
  • β€”CHANGELOG: https://github.com/mhx0628/thought-retriever/blob/main/CHANGELOG.md