Repolode
Tencent-Hunyuan

Tencent-Hunyuan/Hy-Memory

A Python SDK and MemHub desktop/CLI providing dual-system long-term memory for LLM agents across chat, working and coding scenes.

Stars
2,000
Forks
145
Open issues
86
Last commit
2 days ago

What is it?

Hy Memory is a Python SDK (hy-memory) that gives LLM agents persistent memory organized as a dual-system cognitive architecture. It separates memory into three scenes: hierarchical long-term memory for chat, a two-layer store of session facts and reusable experiences for productivity work, and a two-layer memory with a code version-evolution chain for software engineering tasks. Writes accept plain text or OpenAI-format messages, and searches return results grouped by channel.

The SDK supports three modes: lite for raw vector writes and searches without LLM calls, pro for LLM-based extraction and reconciliation, and ultra for schema induction and cross-domain consolidation triggered by evolve(). Storage backends include ChromaDB (default), Qdrant and FAISS for vectors, and Kuzu or Neo4j for graph memory. Any OpenAI-compatible LLM and embedding endpoint can be configured through environment variables.

MemHub is a local-first desktop app and CLI built on the SDK. It consolidates conversation history and coding traces from user-authorized AI tools such as Claude Code, Cursor, Codex, OpenCode and Qwen Code into one local data directory, so memories can be recalled across applications. Plugins for Hermes and OpenClaw are included.

Key features

  • 01Three scenes (chat, working, coding) with separate memory pipelines and storage.
  • 02Three modes from zero-LLM raw vector storage to full schema induction.
  • 03Pluggable vector stores (ChromaDB, Qdrant, FAISS) and graph stores (Kuzu, Neo4j).
  • 04Coding memory keeps a diff chain of code revisions, including reverted versions.
  • 05Works with any OpenAI-compatible LLM and embedding endpoint.
  • 06MemHub desktop and CLI for recalling memory across authorized AI coding tools.

Use cases

  • Adding persistent personal memory to a chat assistant or customer-facing agent.
  • Letting a coding agent recall earlier fixes and reverted code changes in the same repository and branch.
  • Unifying conversation and coding history from several AI tools into one local store.
  • Benchmarking or prototyping agent memory with a low-cost lite mode.

Quick start

  1. 1

    Install the core hy-memory package from PyPI

    pip install hy-memory==2.0.4
  2. 2

    Set your OpenAI API key (or configure an OpenAI-compatible LLM and embedding endpoint)

    export OPENAI_API_KEY="sk-your-key"
  3. 3

    Create a HyMemoryClient in pro mode and write and search chat memories using the Python example from the README

Things to know

  • Pro and ultra modes need an LLM and an embedding API key from an OpenAI-compatible service.
  • Ultra mode always uses a graph database, which adds setup overhead.

In collections

Topics

FAQ

What is Hy-Memory?
A Python SDK and MemHub desktop/CLI providing dual-system long-term memory for LLM agents across chat, working and coding scenes. Hy Memory is a Python SDK (hy-memory) that gives LLM agents persistent memory organized as a dual-system cognitive architecture. It separates memory into three scenes: hierarchical long-term memory for chat, a two-layer store of session facts and reusable experiences for productivity work, and a two-layer memory with a code version-evolution chain for software engineering tasks. Writes accept plain text or OpenAI-format messages, and searches return results grouped by channel.
Is Hy-Memory free to use? What license does it have?
Hy-Memory is open source under the Other license. Check the license terms before using it in commercial products.
Is Hy-Memory still maintained?
Actively maintained. The last commit to Hy-Memory was on Nov 6, 2026.
What can I use Hy-Memory for?
Adding persistent personal memory to a chat assistant or customer-facing agent. Letting a coding agent recall earlier fixes and reverted code changes in the same repository and branch. Unifying conversation and coding history from several AI tools into one local store. Benchmarking or prototyping agent memory with a low-cost lite mode.
How do I install Hy-Memory?
Install the core hy-memory package from PyPI: pip install hy-memory==2.0.4 Set your OpenAI API key (or configure an OpenAI-compatible LLM and embedding endpoint): export OPENAI_API_KEY="sk-your-key" Create a HyMemoryClient in pro mode and write and search chat memories using the Python example from the README
Where can I get Hy-Memory?
The source code and installation instructions are on GitHub: https://github.com/Tencent-Hunyuan/Hy-Memory

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects