LycheeMem/LycheeMem

Lightweight Long-Term Memory for LLM Agents.

What it solves

LycheeMemory provides a lightweight, long-term memory framework for LLM agents, solving the problem of context window limitations and the loss of critical information over long interactions. It enables agents to maintain persistent, structured memory across sessions, reducing token consumption and costs while improving recall accuracy.

How it works

LycheeMemory organizes information into four specialized stores:

  • Working Memory: Manages the active conversation window using a dual-threshold token budget. When limits are reached, it compresses older turns into summary anchors to free up space.
  • Semantic Memory: Stores information as typed MemoryRecords (e.g., facts, preferences, constraints) using SQLite and LanceDB. It uses a hierarchical memory tree and a Record Fusion Engine to deduplicate and cluster related information into composite records.
  • Procedural Memory: Stores reusable skills and methods, utilizing HyDE (Hypothetical Document Embeddings) for retrieval.
  • Visual Memory: A multimodal module that uses VLMs for image understanding and dual embeddings (caption and CLIP visual) for cross-modal retrieval, incorporating an Ebbinghaus forgetting curve for storage management.

The system employs a four-module pipeline for encoding, fusion, and consolidation, and optionally uses a transformer-based reranker to improve the precision of semantic memory search.

Who it’s for

It is designed for developers building agentic systems that require long-term persistence, such as those using OpenClaw, Claude Code, or Hermes, as well as anyone needing a plug-and-play memory backend via Python API or MCP (Model Context Protocol).

Highlights

  • Multi-Runtime Support: Native plugins for OpenClaw, Claude Code, and Hermes, plus a standalone MCP server.
  • Efficient Token Management: Reduces token consumption (up to 71% in some benchmarks) by compressing working memory and using smart retrieval.
  • Semantic Structuring: Categorizes memories into seven distinct types (fact, preference, event, constraint, procedure, failure pattern, tool affordance).
  • Multimodal Capabilities: Supports text-to-image and image-to-text retrieval.
  • Action-Aware: Tracks usage statistics and action-outcome loops to seed future reinforcement learning signals.

Related

  • Project
  • Project
  • Project
  • Project
  • Project