Hy Memory
Dual-system cognitive memory engine and Python SDK for LLM agents covering chat, working, and coding scenes.
At a Glance
About Hy Memory
Hy Memory is a memory engine and Python SDK (hy-memory) from Tencent Hunyuan for self-evolving LLM agents. It provides separate memory pipelines for chat, productivity work, and software engineering. The repository also includes MemHub, a local-first desktop and CLI product built on top of it.
What It Is
Hy Memory is a library that agents call to write and search long-term memory. It needs only an LLM endpoint and an embedding endpoint, and any OpenAI-compatible service works. Users call add() with plain text or OpenAI-format messages and search() to retrieve memories, with CRUD operations and an evolve() call also available.
Three Memory Scenes
The chat scene organizes personal memory into a hierarchy from raw conversation through atomic facts, session summaries, schemas, and prospective intentions. The working scene records a session's facts plus reusable experiences, based on a tool-call trace. The coding scene uses the same two layers and adds a version-evolution chain that stores the real diff of each code revision, sourced from local Git diffs or replace actions in the tool trace. When scene is omitted, automatic routing classifies writes that include tool calls.
Modes and Storage
The lite mode does raw embedding writes and searches with no LLM calls. The pro mode adds LLM extraction and reconciliation. The ultra mode adds System 2 schema induction and a cross-domain sweeper triggered by evolve(). Vector stores include ChromaDB, Qdrant, and FAISS, and graph stores include Kuzu and Neo4j. Working and coding metadata live in local SQLite.
MemHub and Integrations
MemHub unifies conversation history and coding traces from user-authorized AI applications such as Claude Code, Cursor, Codex, OpenCode, and Qwen Code into one local data directory for governed cross-application recall. The repository also lists an OpenClaw plugin and an open model, Hy-Memory-30B-A3B, on Hugging Face.
Community Discussions
Be the first to start a conversation about Hy Memory
Share your experience with Hy Memory, ask questions, or help others learn from your insights.
Pricing
Open Source (Apache-2.0)
Hy-Memory core engine and Python SDK (hy-memory) licensed under Apache-2.0, free to use, modify and distribute; self-hosted.
- Apache-2.0 licensed code, parameters and weights
- Python SDK (hy-memory)
- Chat, Working and Coding memory pipelines
- MemHub local-first desktop and CLI product built on Hy Memory
- Third-party components remain subject to their respective licenses
Capabilities
Key Features
- Hierarchical long-term chat memory (L0–L7)
- Two-layer working memory of facts and reusable experiences
- Coding memory with version-evolution diff chain
- Automatic scene routing
- Source isolation via include/exclude filters
- Lite, pro, and ultra modes
- System 2 schema induction via evolve()
- Workspace and branch isolation
- Per-call embedding endpoint override
- MemHub local-first desktop and CLI for cross-application memory
