Tencent Hunyuan has released Hy Memory 2.0, a toolkit that retains useful context for AI agents across sessions, tools and codebases. It combines an open-source Python framework, the local MemHub app and a specialized model that decides what belongs in long-term memory and how to update those records later.
MemHub shares history across coding assistants
MemHub comes as both a desktop application and a command-line tool. With user permission, it collects histories and work traces from Claude Code and Cursor, as well as Codex, OpenCode and Qwen Code. Imported material goes into a managed local directory and is made available to supported assistants through a shared runtime.
Supported assistants can use this common local memory layer. Deployment requires configuring application permissions and access to the directory containing the imported data.
Chat, work experience and exact code revisions
The framework provides three memory pipelines. Chat uses eight hierarchical layers, L0 through L7, to hold basic information, original dialogue and individual facts. It also stores summaries, schemas and future intentions, converting intentions into ordinary facts when they expire.
The Working pipeline records one fact per work session. It separately retains reusable experiences that meet a defined value threshold, with links connecting the two memory layers.
For programming, the Coding pipeline extends working memory with a versioned chain of code changes. Vector search first selects relevant facts, then the system attaches every revision of the affected code. Those revisions come from local Git diffs or deterministic replacement actions captured in tool traces, preserving exact edits that a summary can leave out.
Each history thread tracks one block within one function, in a specific file and branch. Threads are separated by user and workspace to keep revisions from unrelated repositories or identities out of the same chain.
The specialized model also works with Mem0 and MemOS
Hy-Memory-30B-A3B handles memory writing. It uses a mixture-of-experts architecture with 30 billion parameters, approximately three billion of them active. Its job is to select information worth retaining, determine how precisely to record it and revise persistent memory as new evidence arrives.
The model is not limited to the new framework. In Mem0, MemOS or Hy-Memory, it can take over from a general-purpose language model responsible for writing memory without requiring changes to the surrounding retrieval system.
Tencent compares memory writing with Claude Opus 5
Tencent reports a macro-average score of 55.49 for Hy-Memory-30B-A3B across four evaluation harnesses. In the same evaluation, Claude Opus 5 scored 54.62 and DeepSeek V4.1 Flash scored 53.64. The Qwen3-30B-A3B base model scored 44.37.
Tencent’s evaluation varied only the memory-writing model. Harness versions and prompts stayed fixed, as did retrieval settings, answer-generating models, judges and test examples. Each writer began with an empty memory bank and built its own memory state.
The macro average covered six measures: LoCoMo Judge and LongMemEval, along with PersonaMem-v2, Travel SPS, Shopping PS and Code Memory Bench. These results measure the writer’s contribution within fixed configurations rather than comparing complete agent systems with different retrieval setups or tools.
How Tencent trains the memory-writing model
Tencent uses Memory On-Policy Distillation during training. A frozen teacher model provides detailed supervision for sequences of memory states produced by the model being trained.
In the Attributed Memory Reinforcement Learning stage, Tencent evaluates completed memory banks and assigns credit to individual input chunks. Scores are normalized across rollouts at the same chunk position. The bank with the highest sum of chunk scores becomes the starting state for the next context window.
Tencent reports a score of 56.89 on EverMemOS, a harness it excluded from training. The company interprets that result as evidence that the learned memory-writing policy transfers beyond its training environments.
The SDK is on PyPI with three operating modes
The SDK is available on PyPI as hy-memory==2.0.1 under the Apache-2.0 license. It requires an OpenAI-compatible language-model endpoint and an embedding endpoint. Optional integrations include Qdrant and FAISS, Neo4j or MySQL, plus a local multilingual reranker.
The lite mode stores original content for vector retrieval without calling a language model. The pro mode adds model-based extraction and memory reconciliation. The ultra option also derives higher-level schemas and uses evolve() to revise memory across domains.
Hy-Memory-30B-A3B itself can be served using vLLM or SGLang through a standard OpenAI-compatible API. For direct fact extraction without extended reasoning, requests can set reasoning_effort: no_think.



