LycheeMem/LycheeMem
Lightweight Long-Term Memory for LLM Agents.
What it solves
LycheeMemory provides a lightweight, long-term memory infrastructure for LLM agents, solving the problem of context window limitations and the loss of information across different sessions. It allows agents to maintain persistent knowledge about users, preferences, and past events without relying solely on massive context windows or simple flat vector stores.
How it works
LycheeMemory organizes memory into four specialized stores:
- Working Memory: Manages the active conversation using a dual-threshold token budget. It triggers background compression (summarization) when the budget is nearly full to keep the context lean.
- Semantic Memory: Uses a hierarchical memory tree (SQLite + LanceDB) to store typed records (facts, preferences, events, constraints, etc.). It employs a "Record Fusion Engine" to merge similar memories into denser composite records and a transformer-based reranker to improve retrieval accuracy.
- Procedural Memory: Stores reusable skills and methods, utilizing HyDE (Hypothetical Document Embeddings) for retrieval.
- Visual Memory: A multimodal store that uses VLMs for image understanding and dual embeddings (caption + CLIP) for cross-modal retrieval, incorporating an Ebbinghaus forgetting curve to manage data.
The system can be integrated via a Python API, an HTTP MCP (Model Context Protocol) server, or native plugins for agent runtimes like OpenClaw, Claude Code, and Hermes.
Who it’s for
It is designed for developers building agentic systems that require persistent, long-term memory, automatic recall of user preferences, and the ability to learn from past failures and successes across multiple sessions.
Highlights
- Multi-layered Storage: Combines SQLite, LanceDB, and the filesystem for efficient retrieval and storage.
- Action-Aware Memory: Tracks usage statistics and failure patterns to seed future reinforcement learning signals.
- MCP Compatible: Easily integrates with any MCP-compatible client via an HTTP endpoint.
- Automatic Consolidation: Features a pipeline for typed extraction, decontextualization, and hierarchical clustering of memories.
- Transformer Reranker: Includes a dedicated reranker to improve the precision of evidence selection during semantic search.