Tencent's Hy Memory 2.0 Beats Claude Opus 5 at Remembering What Agents Need

Tencent Hunyuan open-sources a 30B memory writer model, a dual-system memory SDK, and MemHub to unify memory across AI tools.

·
·
·
Tencent's Hy Memory 2.0 Beats Claude Opus 5 at Remembering What Agents Need
  • Tencent open-sourced Hy Memory 2.0, a dual-system cognitive memory SDK for LLM agents under Apache-2.0.
  • Hy-Memory-30B-A3B is a 30B MoE memory-writer model with ~3B active parameters.
  • Beats Claude Opus 5 on cross-harness memory benchmarks (55.49 vs 54.62 macro average).
  • Three scene pipelines: Chat (8-layer hierarchy), Working (facts + experiences), Coding (plus diff chain).
  • MemHub desktop app unifies memory across Claude Code, Cursor, Codex, OpenCode, Qwen Code.
  • Trained via on-policy distillation plus attributed reinforcement learning with chunk-level credit assignment.

Tencent Hunyuan has released Hy Memory 2.0, a memory stack for agents that must retain useful context across sessions, tools, and codebases. The release combines an open-source Python framework, a local desktop and command-line application for coding-agent traces, and a specialized model that writes and reconciles long-term memory.

The stack addresses a persistent agent-engineering problem: deciding which details deserve storage, how they should be represented, and when new evidence should update or replace an existing memory. Tencent reports that its dedicated writer achieves a 55.49 macro average across four evaluation harnesses, compared with 54.62 for Claude Opus 5.

One stack, three jobs

The release separates memory management into components that teams can adopt together or individually.

Component Role Key details
Hy Memory Memory framework and Python SDK Provides specialized pipelines for chat, productivity work, and coding.
MemHub Local desktop and CLI application Collects user-authorized histories and traces from Claude Code, Cursor, Codex, OpenCode, and Qwen Code.
Hy-Memory-30B-A3B Long-term-memory writer Runs the write path for Hy-Memory, Mem0, and MemOS, with roughly 3 billion parameters active per token.

MemHub stores imported data in a managed local directory and exposes it through one runtime. Its local-first design gives developers a common memory layer across supported coding assistants, while application permissions and access to the local store remain deployment considerations.

Why train the writer?

Many agent stacks use a general-purpose language model to extract facts, remove duplicates, and resolve contradictions before storing embeddings in a vector database. Memory quality then depends on prompts, model behavior, and the selected API.

Hy-Memory-30B-A3B is trained specifically for that write path. It determines what to retain, how precisely to express it, and how later evidence should modify the persistent memory bank. The model can replace the general-purpose writer in Mem0, MemOS, or Hy-Memory without changing the surrounding retrieval system.

Benchmarks isolate the writer

Tencent reports the following macro-average results across four harnesses:

Memory writer Score
Hy-Memory-30B-A3B 55.49
Claude Opus 5 54.62
DeepSeek V4.1 Flash 53.64
Qwen3-30B-A3B base model 44.37
Cross-harness scores for Hy-Memory-30B-A3B and competing memory writers
Tencent’s reported cross-harness comparison of memory-writer models.

The evaluation changes only the memory writer. Harness versions, prompts, retrieval settings, answer models, judges, and test examples remain fixed. Each writer starts with an empty bank and constructs its own memory state.

The macro average covers six measures: LoCoMo Judge, LongMemEval, PersonaMem-v2, Travel SPS, Shopping PS, and Code Memory Bench. This protocol measures the effect of memory writing within fixed systems; it does not compare complete agent stacks with different retrieval, generation, or tool configurations.

Training follows the write path

The model uses two training stages that run inside the same harness configurations used for deployment:

  1. Memory On-Policy Distillation: A frozen teacher provides dense supervision for memory-state chains generated by the student.
  2. Attributed Memory Reinforcement Learning: The training system evaluates completed memory banks, assigns credit to individual chunks, and carries the selected bank into the next context window.
Training pipeline with on-policy distillation followed by attributed memory reinforcement learning
Hy-Memory-30B-A3B uses distillation followed by chunk-attributed reinforcement learning.

During reinforcement learning, each rollout produces a sequence of memory banks, one after every processed chunk. Scores are normalized among rollouts at the same chunk position, allowing the strongest rollout to vary as the sequence develops. The system selects the bank with the highest sum of chunk scores and uses it as the parent state for the next window.

This attribution scheme rewards memory edits that improve later retrieval and answers. Tencent held the EverMemOS harness out of training and reports a leading score of 56.89 on that evaluation, offering evidence that the learned write policy transfers beyond its training harnesses.

Each workload gets its own memory

Hy-Memory defines three pipelines because chat histories, work sessions, and source-code changes produce different kinds of durable context.

Pipeline Memory structure Intended use
Chat Eight hierarchical layers, L0 through L7 Stores basic information, raw dialogue, atomic facts, summaries, schemas, and prospective intentions. Expired intentions become ordinary facts.
Working One fact per session plus reusable experiences Captures productivity sessions and retains experiences that pass a value threshold. The two layers are cross-linked.
Coding Working memory plus a versioned diff chain Preserves exact revisions that summary-oriented fact extraction can omit.

The coding diff chain decorates retrieved facts with source history. Vector search still selects the relevant facts, after which the chain attaches every revision of the affected code. Hy-Memory derives those revisions from local Git diffs or deterministic replacement actions recorded in tool traces.

Each coding thread represents one block of one function in one file on one branch. Threads are isolated by user and workspace, which prevents revisions from unrelated repositories or identities from entering the same chain.

The Apache-2.0-licensed SDK is published on PyPI as hy-memory==2.0.1. It requires an OpenAI-compatible language-model endpoint and an embedding endpoint, with optional integrations for Qdrant, FAISS, Neo4j, MySQL, and a local multilingual reranker.

code
pip install "hy-memory==2.0.1"

Developers can select one of three operating modes according to the cost and sophistication required by the application.

Mode Behavior
lite Stores raw content for vector retrieval without language-model calls.
pro Adds language-model extraction and memory reconciliation for standard workloads.
ultra Adds higher-level schema induction and a cross-domain sweeper invoked through evolve().

The client exposes direct methods for adding content and searching a user’s stored memories:

python
from hy_memory import HyMemoryClient

client = HyMemoryClient(mode="pro")
client.add(
    "I love sci-fi movies, especially Interstellar",
    user_id="user_1",
)

results = client.search(
    "What movies does the user like?",
    user_ids=["user_1"],
    limit=10,
)

for mem in results["memories"]["normal"]:
    print(f"[{mem['score']:.2f}] {mem['content']}")

Hy-Memory-30B-A3B can be served through vLLM or SGLang behind a standard OpenAI-compatible API. Requests may set reasoning_effort: no_think when the task calls for direct fact extraction without an extended reasoning trace.

Adoption without a rewrite

Teams already using Mem0 or MemOS can replace the writer while retaining their current storage and retrieval architecture. Teams adopting the full SDK gain separate memory policies for conversation, work, and code, along with explicit deployment modes that control model use.

MemHub extends that architecture across supported coding assistants by placing authorized traces in a common local store. The approach gives developers a path to portable memory across tools, while the benchmark results provide a narrower finding: within Tencent’s fixed evaluation setups, a specialized writer produced better memory banks than the tested general-purpose models.

Trending
  • No trending articles

Comments

avatar

Next Reads