by LycheeMem
Lightweight Long-Term Memory for LLM Agents.
# Add to your Claude Code skills
git clone https://github.com/LycheeMem/LycheeMemLycheeMemory is a compact memory framework for LLM agents. It starts from efficient conversational memory—through structured organization, lightweight consolidation, and adaptive retrieval—and gradually extends toward action-aware, usage-aware memory for more capable agentic systems.
pip install lycheemem. You can easily start the service from anywhere using lycheemem-cli!No comments yet. Be the first to share your thoughts!
LycheeMemory is part of the 3rd-generation Lychee (立知) large model series, which focuses on memory intelligence, continual learning, and long-context reasoning.
We welcome you to explore our related works:
LycheeMemory (ACL 2026, CCF-A): a unified framework for implicit long-term memory and explicit working memory collaboration in large language models
LycheeMem (this project): long-term memory infrastructure for LLM-based agents
LycheeDecode (ICLR 2026, CCF-A): selective recall from massive KV-cache context memory
LycheeCluster (ACL 2026, CCF-A): structured organization and hierarchical indexing for context memory
Install the core package:
pip install lycheemem
Recommended install with the default transformer memory reranker:
pip install "lycheemem[rerank]"
The rerank extra adds PyTorch / Transformers runtime dependencies. With it
installed, LycheeMemory enables the hosted LycheeMem/reranker checkpoint by
default. Without the extra, the core memory system still works and reranking
falls back safely.
Once installed, you can start the backend server instantly using the CLI:
lycheemem-cli
For development or if you prefer to run from source:
git clone https://github.com/LycheeMem/LycheeMem.git
cd LycheeMem
pip install -e .
Create a .env file in your working directory and fill in your values. The full template in .env.example also includes session/user DB paths, JWT settings, and working-memory thresholds; the snippet below shows the most important ones:
# LLM — litellm format: provider/model
LLM_MODEL=openai/gpt-4o-mini
LLM_API_KEY=sk-...
LLM_API_BASE= # optional
# Embedder
EMBEDDING_MODEL=openai/text-embedding-3-small
EMBEDDING_DIM=1536
EMBEDDING_API_KEY= # optional
EMBEDDING_API_BASE= # optional
Supported LLM providers (via litellm):
openai/gpt-4o-mini·gemini/gemini-2.0-flash·ollama_chat/qwen2.5· any OpenAI-compatible endpoint
LycheeMemory includes a transformer reranker for semantic memory search. It can improve evidence selection when the correct memory is already in the wider candidate pool.
For the smoothest experience, install LycheeMemory with the rerank extra:
pip install "lycheemem[rerank]"
After that, no extra model command is required. The reranker is enabled by default and loads the current v0 checkpoint from Hugging Face on first use:
EXPERIMENTAL_TRANSFORMER_RERANK=true
TRANSFORMER_RERANK_MODEL_PATH=LycheeMem/reranker
To disable it explicitly:
EXPERIMENTAL_TRANSFORMER_RERANK=false
If you prefer to pin the model to a local directory, download it once and point the same variable at that path:
mkdir -p ~/.cache/lycheemem/models
huggingface-cli download LycheeMem/reranker \
--local-dir ~/.cache/lycheemem/models/reranker-v0
export TRANSFORMER_RERANK_MODEL_PATH=~/.cache/lycheemem/models/reranker-v0
The base install still works without PyTorch or Transformers. If rerank dependencies or the checkpoint are unavailable, LycheeMemory log