🧠 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

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Paper for star0628/thought-retriever