BytedTsinghua-SIA/MemAgent
An RL-trained memory agent framework that enables LLMs to extrapolate to 3.5M token contexts from 32K training.

MemAgent is a long-context processing framework that optimizes LLM performance through end-to-end reinforcement learning without modifying model architecture. It demonstrates near-lossless extrapolation from 8K context trained on 32K text to 3.5M token QA tasks, achieving 95%+ accuracy on 512K RULER benchmarks. The repository includes RL-MemAgent-14B and RL-MemAgent-7B model weights along with a training framework for RL-based agent workflow optimization.
Frequently asked
- What is BytedTsinghua-SIA/MemAgent?
- An RL-trained memory agent framework that enables LLMs to extrapolate to 3.5M token contexts from 32K training.
- Is MemAgent open source?
- Yes — BytedTsinghua-SIA/MemAgent is open source, released under the Apache-2.0 license.
- What language is MemAgent written in?
- BytedTsinghua-SIA/MemAgent is primarily written in Python.
- How popular is MemAgent?
- BytedTsinghua-SIA/MemAgent has 1.1k stars on GitHub.
- Where can I find MemAgent?
- BytedTsinghua-SIA/MemAgent is on GitHub at https://github.com/BytedTsinghua-SIA/MemAgent.