π§ 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
pip install numpy jieba
git clone https://github.com/mhx0628/thought-retriever
Quick Start
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