[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-BytedTsinghua-SIA--MemAgent":3,"tool-BytedTsinghua-SIA--MemAgent":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":78,"owner_location":78,"owner_email":78,"owner_twitter":78,"owner_website":78,"owner_url":79,"languages":80,"stars":101,"forks":102,"last_commit_at":103,"license":104,"difficulty_score":10,"env_os":105,"env_gpu":106,"env_ram":107,"env_deps":108,"category_tags":122,"github_topics":78,"view_count":23,"oss_zip_url":78,"oss_zip_packed_at":78,"status":16,"created_at":123,"updated_at":124,"faqs":125,"releases":161},3052,"BytedTsinghua-SIA\u002FMemAgent","MemAgent","A MemAgent framework that can be extrapolated to 3.5M, along with a training framework for RL training of any agent workflow.","MemAgent 是一款专为处理超长文本上下文而设计的开源框架，旨在让大语言模型在不改变底层架构的前提下，轻松应对从几千字到数百万字的巨量信息。它主要解决了传统模型受限于固定上下文窗口、难以处理长文档且计算成本高昂的痛点。通过引入创新的多轮卷积强化学习（Multi-Conv RL）机制，MemAgent 能够以线性时间复杂度高效处理任意长度的输入，实现了从 8K 训练长度向 350 万 token 任务的神奇“外推”，且在极长语境下性能损失极低。\n\n这一工具特别适合 AI 研究人员、大模型开发者以及需要处理长篇法律文档、学术著作或复杂代码库的技术团队使用。其核心亮点在于无需重新设计模型结构，仅通过端到端的强化学习训练，即可赋予模型卓越的长文记忆与理解能力。官方已开放 7B 和 14B 版本的模型权重，并提供了便捷的快速启动脚本，支持本地 vLLM 部署及在线服务集成，让用户能迅速体验在百万级 token 语境下进行高精度问答的强大功能。","\u003Cdiv style=\"display: flex; justify-content: space-between;\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_3ec18508a9cd.png\" width=\"35%\">\n    \u003Cimg src=\"data:image\u002Fsvg+xml,%3Csvg xmlns='http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg' width='1' height='1'\u002F%3E\" width=\"26%\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_747e1fe3e359.png\" width=\"35%\">\n\u003C\u002Fdiv>\n\u003Cbr>\n\u003Cdiv align=\"center\">\n\n\u003Ch1 style=\"display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0;\">\n  MemAgent: Reshaping Long-Context LLM with Multi-Conv RL based Memory Agent\n\u003C\u002Fh1>\n\n[![Paper](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpaper-5f16a8?style=for-the-badge&logo=arxiv&logoColor=white)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2507.02259)\n[![Blog](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBlog-3858bf?style=for-the-badge&logo=homepage&logoColor=white)](https:\u002F\u002Fmemagent-sialab.github.io\u002F)\n[![Dataset](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDatasets-4d8cd8?style=for-the-badge&logo=huggingface&logoColor=white)](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FBytedTsinghua-SIA\u002Fhotpotqa)\n[![Weights](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FModel%20Weights-63cad3?style=for-the-badge&logo=huggingface&logoColor=white)](https:\u002F\u002Fhuggingface.co\u002FBytedTsinghua-SIA\u002FRL-MemoryAgent-14B)\n\u003C\u002Fdiv>\n\n---\n\n> [!IMPORTANT]\n> **🔥 News!!!**\n> - **[2025\u002F07]** We provide a **quickstart** script that makes using **MemAgent** super easy, see the **Quickstart** section below.\n> - **[2025\u002F06]** We release **RL-MemAgent-14B** and **RL-MemAgent-7B** models achieving nearly lossless performance on 3.5M token contexts task.\n\n---\n## 📖Introduction\n\nWe propose a novel long-context processing framework — **MemAgent**, which directly optimizes long-context tasks through end-to-end Reinforcement Learning without altering the underlying model architecture. MemAgent has demonstrated superb long-context capabilities, being able to extrapolate from an 8K context trained on 32K text to a 3.5M QA task with performance loss \u003C 5% and achieves 95%+ accuracy in 512K RULER test.\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_39ebb9ce0155.png\" alt=\"overview\" style=\"width: 66%; height: auto;\">\n\u003C\u002Fdiv>\n\n### Highlights:\n- **🚀 Novel memory mechanism** Introduces MemAgent architecture enabling arbitrarily long input processing within fixed context windows, overcoming traditional context window length limitations.\n- **⚡ Linear time Complexity** Breaks through computational bottlenecks in long-text processing, achieving linear scaling of resources with text length.\n- **🎯 RL-driven extrapolation** Through RL training with MemAgent architecture, enables models to extrapolate to vastly longer texts with minimal performance degradation.\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_720216ed0218.png\" alt=\"overview\" style=\"width: 66%; height: auto;\">\n\u003C\u002Fdiv>\n\n### Multi-conv RL Framework\nWe use Reinforcement Learning from Verifiable Rewards (RLVR) to train MemAgent, extending the DAPO algorithm to support end-to-end optimization of Agent Workflows with multi-turn context-independent conversations.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_53ea1b5fe07a.png\" width=\"49%\" style=\"display:inline-block\"> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_d729e0cd2188.png\" width=\"49%\" style=\"display:inline-block\">\n\n### Results\n\n**RL-MemAgent** demonstrates exceptional stability in ultra-long context processing：\n- **14B model:** Performance degradation \u003C5.5% on 3.5M token tasks, achieving truly lossless extrapolation.\n- **7B model:** Only 11% performance decline in longest contexts, significantly outperforming existing long-context models\n\n![Performance Comparison](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_f5bba9375068.png)\n\n## Quickstart\n\n`quickstart.py` offers a straightforward way to begin using MemAgent, supporting both local deployment and integration with online model services.\n\n\n### vLLM Local Deployment\n\n\n1.  **Start the `vllm` server:**\n\n    ```bash\n    vllm serve BytedTsinghua-SIA\u002FRL-MemoryAgent-14B --tensor_parallel_size 2\n    ```\n\n2.  **Run `quickstart.py`:**\n\n    ```bash\n    python quickstart.py --model BytedTsinghua-SIA\u002FRL-MemoryAgent-14B\n    ```\n\n### Online LLM Service\n\nFor online LLM services, you'll need to configure your model endpoint and API key as environment variables.\n\n\ne.g.  `gpt-4o-2024-11-20`:\n- **Normal online services**: Simply use `https:\u002F\u002F{endpoint}`.\n- **Azure OpenAI**: Use the format `https:\u002F\u002F{endpoint}\u002Fopenai\u002Fdeployments\u002Fgpt-4o-2024-11-20`.\n\n```bash\nexport URL=\nexport API_KEY=\npython quickstart.py --model gpt-4o-2024-11-20\n```\n\n## Reproducibility\n\n### Performance\n\nIn reproduction, you may find that the validation score during training is not equal to the final score (about 50% vs 80%). \nThis behavior is expected because during training we actually used a stricter version of the verifier to prevent reward hacking, while during testing we used a more lenient verifier. Specifically\n\n- In the [training verifier](https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fblob\u002Fmain\u002Fverl\u002Futils\u002Freward_score\u002Fhotpotqa.py), the model’s answer must be placed inside `\\boxed{}` with exact case matching and no additional characters.\n\n- In the [testing verifier](https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fblob\u002Fmain\u002Ftaskutils\u002Fmemory_eval\u002Futils\u002F__init__.py), articles like “a\u002Fthe” are ignored, as are case differences and punctuation.\n\nThe stricter training verifier was inherited from earlier math-related RL work, whereas the more relaxed testing verifier aligns with practices in long-context projects such as Ruler and Qwen-Long.\n\n\n### Testing Results\n\n```bash\npip install httpx==0.23.1 aiohttp -U ray[serve,default] vllm\n```\n\n1. Prepare QA data\n\n```bash\ncd taskutils\u002Fmemory_data\nbash download_qa_dataset.sh\n```\n\n2. Download the dataset\n\n```bash\ncd ..\u002F..\nbash hfd.sh BytedTsinghua-SIA\u002Fhotpotqa --dataset --tool aria2c -x 10\nexport DATAROOT=$(pwd)\u002Fhotpotqa\n```\n\n3. Preparing models\n\nThe model used in tests will be downloaded from HuggingFace. However, Qwen2.5-Instruct series models needs to be downloaded manually and properly config their `config.json` to activate YaRN. Please follow the instruction in [Qwen2.5-Instruct Repo](https:\u002F\u002Fhuggingface.co\u002FQwen\u002FQwen2.5-7B-Instruct)\n\n\n```bash\nbash hfd.sh Qwen\u002FQwen2.5-7B-Instruct --tool aria2c -x 10\nbash hfd.sh Qwen\u002FQwen2.5-14B-Instruct --tool aria2c -x 10\nbash hfd.sh Qwen\u002FQwen2.5-32B-Instruct --tool aria2c -x 10\n# then change the config.json manually\n```\n\n```bash\nexport MODELROOT=\u002Fyour\u002Fpath\u002Fto\u002Fmodels # move to your model root directory, this env variable is used in the run.py script\nmv Qwen2.5-7B-Instruct $MODELROOT\u002FQwen2.5-7B-Instruct-128K\nmv Qwen2.5-14B-Instruct $MODELROOT\u002FQwen2.5-14B-Instruct-128K\nmv Qwen2.5-32B-Instruct $MODELROOT\u002FQwen2.5-32B-Instruct-128K\n```\n\n4. Running\n\n**Note:** This will take a few days to run all the tests, you may want to specify which tests\u002Fmodels to run.\n\n```bash\ncd taskutils\u002Fmemory_eval\npython run.py\n```\n\n**Note:** This scripts will use all available GPUs to serve the \nmodels. If you have multiple GPU nodes, you can create a ray cluster and run the script in one of cluster nodes. Use `SERVE_PORT` and `DASH_PORT` to specify the ports for the ray cluster.\n\n```bash\ncd taskutils\u002Fmemory_eval\nSERVE_PORT=8000 DASH_PORT=8265 python run.py # port numbers here are default values, you may need to specify them as the serve\u002Fdashboard port in your ray cluster\n```\n\n\n## Training\n\nFistly specify `PROJ_ROOT` (for checkpoints) and `DATASET_ROOT` (for training data, should be the same as used in testing) in `run_memory_7B.sh` and `run_memory_14B.sh`. \n\nThen run this script directly to launch a single-node training, or config a ray cluster properly and run the script in one of the cluster nodes.\n\n\n## Data\n\n\nPlease run the following commnads in this section under the`taskutils\u002Fmemory_data` directory.\n\n```bash\ncd taskutils\u002Fmemory_data\npip install nltk pyyaml beautifulsoup4 html2text wonderwords tenacity fire\n```\n\n1. Train & dev split: hotpotqa_train.parquet & hotpotqa_dev.parquet\n\n- Download qa dataset and synthetic data, skip this step if you have downloaded it in the previous step:\n\n```bash\nbash download_qa_dataset.sh\n```\n\n```bash\npython processing.py # Dataprocess, synthetic long context multihop-QA\n```\n\n- Deploy Qwen-7B in localhost:8000 and Qwen-7B-Instruct in localhost:8001\n\n- filtering\n\n```bash\npython filter.py -i hotpotqa_dev_process.parquet -o hotpotqa_dev_result --noresume\npython filter.py -i hotpotqa_train_process.parquet -o hotpotqa_train_result --noresume\npython3 filter2.py # Filtering out sample which can be answered correctly by LLM without any context:\n```\n\n### 2. Main task: eval\\_{50|100|200|...}.json\n\n```bash\nexport DATAROOT=\"your_dir_to_hotpotqa_dev.parquet\"\npython convert_to_eval.py # Convert the `hotpotqa_dev` to `eval_200.json`\npython different_docs_eval.py.py # Create eval dataset with different number of documents\n```\n\n\n### 3. OOD task: eval_{rulersubset}_{8192|16384|...}.json\n\n```bash\nexport DATAROOT=\"your_dir_to_hotpotqa_dev.parquet\"\npython download_paulgraham_essay.py\nbash download_qa_dataset.sh\nbash ruler_data_prepare.sh \n```\n\n## Engineering\n\n### Sync mode: From tool-calling to general workflow\n\nInspired by [Search-R1](https:\u002F\u002Fgithub.com\u002FPeterGriffinJin\u002FSearch-R1), we implement a framework for general multi-conversation workflow with indepedent context. Therefore the context is not limited to be a concatenated string of all previous conversations as in original tool-calling. This framework make it possible to optimize a multi-step agent in a end-to-end manner. Memory agent is one of the examples of this framework, demonstrating how the reinforcement learning can be applied to optimize the agent's performance in a multi-step workflow.\n\nSee the `recurrent\u002Fimpls\u002Fmemory.py` for implementation details and `recurrent\u002Finterface.py, recurrent\u002Fgeneration_manager.py` for our interface design.\n\n### Async mode: Agent as a function\n\nBased on [the server mode generation](https:\u002F\u002Fgithub.com\u002Fvolcengine\u002Fverl\u002Fpull\u002F1138), we further implement a brand new framework which **allows users to implement an agent as a function which calling LLMs in openai-api style**, without worrying about batched tensor operation such as tokenization, padding, state tracing, which often requires a lot of boilerplate code or even a state machine.\n\n\nIn this view, each agent is a function that returns one or more list of `{\"role\":\"\", \"content\":\"\"}` dicts:\n![unfied_agent](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_ec9c05698a7d.png)\n\n  - vanilla：`[{\"role\":\"user\",\"content\":pmt},{\"role\":\"assistant\"\"content\":rsp}]`\n  - multi-turn tool-calling：`[{\"role\":\"user\",\"content\":pmt},{\"role\":\"assistant\",\"content\":rsp1},{\"role\":\"tool\",\"content\":obs},{\"role\":\"assistant\",\"content\":rsp2}]`,\n  - context-indepedent multi-conversation：`[{\"role\":\"user\",\"content\":pmt1},{\"role\":\"assistant\",\"content\":rsp1}], [{\"role\":\"user\",\"content\":pmt2},{\"role\":\"assistant\",\"content\":rsp2}]`\n\nWe modify the `chat_template` to support tool-response masking without any tensor operations.\n\nSee the `rollout` method implementation of agent class defined in `recurrent\u002Fimpls\u002Fasync_*.py` for more details and `recurrent\u002Finterface.py, recurrent\u002Fasync_generation_manager.py` for our framework design.\n\n\n### RayActor Process pool\n\nComputation-intensive reward computation or tool calling may stuck the head node from sending generation requests to LLMs. To promote the efficiency of cpu-intensive tasks, we create a RayActor in each node that runs a process pool and accepts tasks from the head node.\n\nTherefore, the cpu task can be executed asynchronously by submitting to ray actor, so does the gpu task：LLM generation.\n\nSee `verl\u002Fworkers\u002Freward_manager\u002Fthread.py` for more details.\n\n## Acknowledgements\n\nWe thank [verl](https:\u002F\u002Fgithub.com\u002Fvolcengine\u002Fverl) team for providing a flexible and powerful infrastructure.\n\nWe thank the authors of [the server mode generation](https:\u002F\u002Fgithub.com\u002Fvolcengine\u002Fverl\u002Fpull\u002F1138) for their great work, which provides a solid foundation for our async agent framework.\n\n## Citation\n\nIf you find this work useful, please consider citing our paper:\n\n```bibtex\n@article{yu2025memagent,\n  title={MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agent},\n  author={Yu, Hongli and Chen, Tinghong and Feng, Jiangtao and Chen, Jiangjie and Dai, Weinan and Yu, Qiying and Zhang, Ya-Qin and Ma, Wei-Ying and Liu, Jingjing and Wang, Mingxuan and others},\n  journal={arXiv preprint arXiv:2507.02259},\n  year={2025}\n}\n```\n","\u003Cdiv style=\"display: flex; justify-content: space-between;\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_3ec18508a9cd.png\" width=\"35%\">\n    \u003Cimg src=\"data:image\u002Fsvg+xml,%3Csvg xmlns='http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg' width='1' height='1'\u002F%3E\" width=\"26%\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_747e1fe3e359.png\" width=\"35%\">\n\u003C\u002Fdiv>\n\u003Cbr>\n\u003Cdiv align=\"center\">\n\n\u003Ch1 style=\"display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0;\">\n  MemAgent：基于多轮强化学习的记忆智能体重塑长上下文大模型\n\u003C\u002Fh1>\n\n[![论文](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpaper-5f16a8?style=for-the-badge&logo=arxiv&logoColor=white)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2507.02259)\n[![博客](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FBlog-3858bf?style=for-the-badge&logo=homepage&logoColor=white)](https:\u002F\u002Fmemagent-sialab.github.io\u002F)\n[![数据集](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDatasets-4d8cd8?style=for-the-badge&logo=huggingface&logoColor=white)](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FBytedTsinghua-SIA\u002Fhotpotqa)\n[![模型权重](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FModel%20Weights-63cad3?style=for-the-badge&logo=huggingface&logoColor=white)](https:\u002F\u002Fhuggingface.co\u002FBytedTsinghua-SIA\u002FRL-MemoryAgent-14B)\n\u003C\u002Fdiv>\n\n---\n\n> [!IMPORTANT]\n> **🔥 最新消息!!!**\n> - **[2025\u002F07]** 我们提供了一个**快速入门**脚本，让使用**MemAgent**变得极其简单，请参阅下方的**快速入门**部分。\n> - **[2025\u002F06]** 我们发布了**RL-MemAgent-14B**和**RL-MemAgent-7B**模型，在350万 token 上下文的任务中实现了几乎无损的性能。\n\n---\n## 📖引言\n\n我们提出了一种全新的长上下文处理框架——**MemAgent**，它通过端到端的强化学习直接优化长上下文任务，而无需改变底层模型架构。MemAgent展现了卓越的长上下文能力，能够在3.5万文本上训练的8K上下文基础上，外推至350万的问答任务，性能损失低于5%，并在51.2万 RULER 测试中达到95%以上的准确率。\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_39ebb9ce0155.png\" alt=\"overview\" style=\"width: 66%; height: auto;\">\n\u003C\u002Fdiv>\n\n### 亮点：\n- **🚀 新型记忆机制** 引入了MemAgent架构，能够在固定上下文窗口内处理任意长度的输入，突破了传统上下文窗口长度的限制。\n- **⚡ 线性时间复杂度** 打破了长文本处理中的计算瓶颈，实现了资源消耗与文本长度的线性增长。\n- **🎯 强化学习驱动的外推** 通过MemAgent架构的强化学习训练，使模型能够在外推至更长文本时保持极低的性能下降。\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_720216ed0218.png\" alt=\"overview\" style=\"width: 66%; height: auto;\">\n\u003C\u002Fdiv>\n\n### 多轮强化学习框架\n我们使用可验证奖励的强化学习（RLVR）来训练MemAgent，并扩展了DAPO算法，以支持多轮独立于上下文的对话中代理工作流的端到端优化。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_53ea1b5fe07a.png\" width=\"49%\" style=\"display:inline-block\"> \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_d729e0cd2188.png\" width=\"49%\" style=\"display:inline-block\">\n\n### 结果\n\n**RL-MemAgent**在超长上下文处理中表现出色：\n- **14B模型：** 在350万 token 的任务中性能下降不到5.5%，实现了真正的无损外推。\n- **7B模型：** 在最长上下文中仅出现11%的性能下降，显著优于现有的长上下文模型。\n\n![性能对比](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_f5bba9375068.png)\n\n## 快速入门\n\n`quickstart.py` 提供了一种简单的方式来开始使用MemAgent，既支持本地部署，也支持与在线模型服务的集成。\n\n\n### vLLM 本地部署\n\n\n1.  **启动 `vllm` 服务器：**\n\n    ```bash\n    vllm serve BytedTsinghua-SIA\u002FRL-MemoryAgent-14B --tensor_parallel_size 2\n    ```\n\n2.  **运行 `quickstart.py`：**\n\n    ```bash\n    python quickstart.py --model BytedTsinghua-SIA\u002FRL-MemoryAgent-14B\n    ```\n\n### 在线 LLM 服务\n\n对于在线 LLM 服务，您需要将模型端点和 API 密钥配置为环境变量。\n\n\n例如，`gpt-4o-2024-11-20`：\n- **普通在线服务**：只需使用 `https:\u002F\u002F{endpoint}`。\n- **Azure OpenAI**：使用格式 `https:\u002F\u002F{endpoint}\u002Fopenai\u002Fdeployments\u002Fgpt-4o-2024-11-20`。\n\n```bash\nexport URL=\nexport API_KEY=\npython quickstart.py --model gpt-4o-2024-11-20\n```\n\n## 可重复性\n\n### 性能\n\n在复现过程中，您可能会发现训练过程中的验证分数与最终分数并不相同（约50% vs 80%）。这种现象是正常的，因为在训练时我们实际上使用了一个更为严格的验证器来防止奖励作弊，而在测试时则使用了一个较为宽松的验证器。具体来说：\n\n- 在【训练验证器】（https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fblob\u002Fmain\u002Fverl\u002Futils\u002Freward_score\u002Fhotpotqa.py）中，模型的答案必须放在 `\\boxed{}` 内，且大小写完全匹配，不得包含任何额外字符。\n\n- 在【测试验证器】（https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fblob\u002Fmain\u002Ftaskutils\u002Fmemory_eval\u002Futils\u002F__init__.py）中，诸如“a\u002Fthe”之类的冠词会被忽略，大小写差异和标点符号也不予考虑。\n\n更为严格的训练验证器源自早期的数学相关强化学习工作，而较为宽松的测试验证器则符合Ruler和Qwen-Long等长上下文项目中的实践。\n\n\n### 测试结果\n\n```bash\npip install httpx==0.23.1 aiohttp -U ray[serve,default] vllm\n```\n\n1. 准备 QA 数据\n\n```bash\ncd taskutils\u002Fmemory_data\nbash download_qa_dataset.sh\n```\n\n2. 下载数据集\n\n```bash\ncd ..\u002F..\nbash hfd.sh BytedTsinghua-SIA\u002Fhotpotqa --dataset --tool aria2c -x 10\nexport DATAROOT=$(pwd)\u002Fhotpotqa\n```\n\n3. 准备模型\n\n测试中使用的模型将从HuggingFace下载。然而，Qwen2.5-Instruct系列模型需要手动下载，并正确配置其`config.json`以激活YaRN。请按照【Qwen2.5-Instruct仓库】中的说明操作（https:\u002F\u002Fhuggingface.co\u002FQwen\u002FQwen2.5-7B-Instruct）\n\n\n```bash\nbash hfd.sh Qwen\u002FQwen2.5-7B-Instruct --tool aria2c -x 10\nbash hfd.sh Qwen\u002FQwen2.5-14B-Instruct --tool aria2c -x 10\nbash hfd.sh Qwen\u002FQwen2.5-32B-Instruct --tool aria2c -x 10\n\n# 然后手动修改 config.json\n```\n\n```bash\nexport MODELROOT=\u002Fyour\u002Fpath\u002Fto\u002Fmodels # 切换到你的模型根目录，这个环境变量在 run.py 脚本中会被使用\nmv Qwen2.5-7B-Instruct $MODELROOT\u002FQwen2.5-7B-Instruct-128K\nmv Qwen2.5-14B-Instruct $MODELROOT\u002FQwen2.5-14B-Instruct-128K\nmv Qwen2.5-32B-Instruct $MODELROOT\u002FQwen2.5-32B-Instruct-128K\n```\n\n4. 运行\n\n**注意：** 完成所有测试可能需要几天时间，你可以选择指定要运行的测试或模型。\n\n```bash\ncd taskutils\u002Fmemory_eval\npython run.py\n```\n\n**注意：** 该脚本会使用所有可用的 GPU 来服务模型。如果你有多个 GPU 节点，可以创建一个 Ray 集群，并在其中一个节点上运行该脚本。使用 `SERVE_PORT` 和 `DASH_PORT` 来指定 Ray 集群的端口。\n\n```bash\ncd taskutils\u002Fmemory_eval\nSERVE_PORT=8000 DASH_PORT=8265 python run.py # 这里的端口号是默认值，你可能需要根据你的 Ray 集群中的服务\u002F仪表板端口进行调整\n```\n\n\n## 训练\n\n首先，在 `run_memory_7B.sh` 和 `run_memory_14B.sh` 中指定 `PROJ_ROOT`（用于保存检查点）和 `DATASET_ROOT`（用于训练数据，应与测试时使用的数据相同）。\n\n然后直接运行此脚本以启动单节点训练，或者正确配置 Ray 集群，并在集群中的某个节点上运行该脚本。\n\n\n## 数据\n\n\n请在 `taskutils\u002Fmemory_data` 目录下执行本节中的以下命令。\n\n```bash\ncd taskutils\u002Fmemory_data\npip install nltk pyyaml beautifulsoup4 html2text wonderwords tenacity fire\n```\n\n1. 训练集与验证集划分：hotpotqa_train.parquet 和 hotpotqa_dev.parquet\n\n- 下载 QA 数据集和合成数据，如果你已经在上一步下载过，则可跳过此步骤：\n\n```bash\nbash download_qa_dataset.sh\n```\n\n```bash\npython processing.py # 数据处理，生成长上下文多跳 QA 合成数据\n```\n\n- 在本地部署 Qwen-7B（端口 8000）和 Qwen-7B-Instruct（端口 8001）\n\n- 数据过滤\n\n```bash\npython filter.py -i hotpotqa_dev_process.parquet -o hotpotqa_dev_result --noresume\npython filter.py -i hotpotqa_train_process.parquet -o hotpotqa_train_result --noresume\npython3 filter2.py # 过滤掉那些无需任何上下文即可被 LLM 正确回答的样本：\n```\n\n### 2. 主任务：eval_{50|100|200|...}.json\n\n```bash\nexport DATAROOT=\"your_dir_to_hotpotqa_dev.parquet\"\npython convert_to_eval.py # 将 `hotpotqa_dev` 转换为 `eval_200.json`\npython different_docs_eval.py.py # 创建包含不同数量文档的评估数据集\n```\n\n\n### 3. OOD 任务：eval_{rulersubset}_{8192|16384|...}.json\n\n```bash\nexport DATAROOT=\"your_dir_to_hotpotqa_dev.parquet\"\npython download_paulgraham_essay.py\nbash download_qa_dataset.sh\nbash ruler_data_prepare.sh \n```\n\n\n## 工程实现\n\n### 同步模式：从工具调用到通用工作流\n\n受 [Search-R1](https:\u002F\u002Fgithub.com\u002FPeterGriffinJin\u002FSearch-R1) 的启发，我们实现了一个支持独立上下文的通用多轮对话工作流框架。因此，上下文不再像原始的工具调用那样被限制为所有先前对话的拼接字符串。该框架使得我们可以以端到端的方式优化多步智能体。记忆智能体便是这一框架的一个示例，展示了如何利用强化学习来优化智能体在多步工作流中的表现。\n\n具体实现细节请参见 `recurrent\u002Fimpls\u002Fmemory.py`，接口设计则可在 `recurrent\u002Finterface.py` 和 `recurrent\u002Fgeneration_manager.py` 中找到。\n\n### 异步模式：将智能体作为函数\n\n基于 [服务器模式下的生成](https:\u002F\u002Fgithub.com\u002Fvolcengine\u002Fverl\u002Fpull\u002F1138)，我们进一步实现了一个全新的框架，**允许用户以类似于 OpenAI API 的方式调用 LLM 来实现智能体功能**，而无需担心分批张量操作，如分词、填充、状态追踪等，这些通常需要大量的样板代码，甚至状态机。\n\n在这种视角下，每个智能体都是一条返回一个或多个 `{\"role\":\"\", \"content\":\"\"}` 字典列表的函数：\n![unfied_agent](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_readme_ec9c05698a7d.png)\n\n  - 原生模式：`[{\"role\":\"user\",\"content\":pmt},{\"role\":\"assistant\"\"content\":rsp}]`\n  - 多轮工具调用模式：`[{\"role\":\"user\",\"content\":pmt},{\"role\":\"assistant\",\"content\":rsp1},{\"role\":\"tool\",\"content\":obs},{\"role\":\"assistant\",\"content\":rsp2}]`\n  - 上下文独立多轮对话模式：`[{\"role\":\"user\",\"content\":pmt1},{\"role\":\"assistant\",\"content\":rsp1}], [{\"role\":\"user\",\"content\":pmt2},{\"role\":\"assistant\",\"content\":rsp2}]`\n\n我们修改了 `chat_template` 以支持工具响应屏蔽，且无需任何张量操作。\n\n更多详细信息请参见 `recurrent\u002Fimpls\u002Fasync_*.py` 中定义的智能体类的 `rollout` 方法实现，以及 `recurrent\u002Finterface.py` 和 `recurrent\u002Fasync_generation_manager.py` 中的框架设计。\n\n\n### RayActor 进程池\n\n计算密集型的奖励计算或工具调用可能会阻塞主节点向 LLM 发送生成请求。为了提高 CPU 密集型任务的效率，我们在每个节点上创建了一个 RayActor，运行一个进程池并接受来自主节点的任务。\n\n因此，CPU 任务可以通过提交给 RayActor 来异步执行，GPU 任务（即 LLM 生成）也是如此。\n\n更多详情请参见 `verl\u002Fworkers\u002Freward_manager\u002Fthread.py`。\n\n## 致谢\n\n我们感谢 [verl](https:\u002F\u002Fgithub.com\u002Fvolcengine\u002Fverl) 团队提供的灵活而强大的基础设施。\n\n我们还感谢 [服务器模式生成](https:\u002F\u002Fgithub.com\u002Fvolcengine\u002Fverl\u002Fpull\u002F1138) 的作者们所做的出色工作，他们的成果为我们构建异步智能体框架奠定了坚实的基础。\n\n## 引用\n\n如果你觉得这项工作对你有所帮助，请考虑引用我们的论文：\n\n```bibtex\n@article{yu2025memagent,\n  title={MemAgent: Reshaping Long-Context LLM with Multi-Conv RL-based Memory Agent},\n  author={Yu, Hongli and Chen, Tinghong and Feng, Jiangtao and Chen, Jiangjie and Dai, Weinan and Yu, Qiying and Zhang, Ya-Qin and Ma, Wei-Ying and Liu, Jingjing and Wang, Mingxuan and others},\n  journal={arXiv preprint arXiv:2507.02259},\n  year={2025}\n}\n```","# MemAgent 快速上手指南\n\nMemAgent 是一个基于多轮对话强化学习（Multi-Conv RL）的长上下文处理框架，能够在不改变模型架构的情况下，实现从 8K 训练上下文到 3.5M token 任务的高效外推。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐 Ubuntu 20.04+)\n- **GPU**: 支持 CUDA 的 NVIDIA GPU（本地部署 14B 模型建议显存总和 ≥ 48GB，需多卡并行）\n- **Python**: 3.9 或更高版本\n\n### 前置依赖\n在开始之前，请确保已安装以下基础工具：\n- `git`\n- `aria2c` (用于加速数据集和模型下载)\n- `pip`\n\n安装 Python 依赖包：\n```bash\npip install httpx==0.23.1 aiohttp -U ray[serve,default] vllm\npip install nltk pyyaml beautifulsoup4 html2text wonderwords tenacity fire\n```\n\n> **提示**：国内用户建议使用国内镜像源加速安装，例如：\n> ```bash\n> pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple httpx==0.23.1 aiohttp -U ray[serve,default] vllm\n> ```\n\n## 安装步骤\n\n1. **克隆项目代码**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent.git\n   cd MemAgent\n   ```\n\n2. **获取模型权重**\n   \n   项目提供两种使用方式：本地部署或使用在线 API。\n   \n   **方式 A：本地部署 (推荐)**\n   从 Hugging Face 下载预训练模型（国内用户可使用镜像站或配置加速）：\n   ```bash\n   # 使用 hfd.sh 脚本下载 14B 模型\n   bash hfd.sh BytedTsinghua-SIA\u002FRL-MemoryAgent-14B --tool aria2c -x 10\n   ```\n   *注：若脚本不可用，可直接使用 `huggingface-cli` 或浏览器下载。*\n\n   **方式 B：在线服务**\n   无需下载模型，但需要准备支持 OpenAI 格式的 API 端点和 Key。\n\n## 基本使用\n\nMemAgent 提供了 `quickstart.py` 脚本，支持一键启动测试。\n\n### 场景一：本地 vLLM 部署\n\n1. **启动 vLLM 服务**\n   使用多卡并行加载模型（以 14B 模型为例，需 2 张卡）：\n   ```bash\n   vllm serve BytedTsinghua-SIA\u002FRL-MemoryAgent-14B --tensor_parallel_size 2\n   ```\n\n2. **运行快速测试**\n   在新终端中执行：\n   ```bash\n   python quickstart.py --model BytedTsinghua-SIA\u002FRL-MemoryAgent-14B\n   ```\n\n### 场景二：调用在线 LLM 服务\n\n如果您使用 Azure OpenAI 或其他兼容 OpenAI 接口的云服务，请配置环境变量后运行：\n\n```bash\n# 替换为您的实际端点和密钥\nexport URL=https:\u002F\u002F{your-endpoint}\u002Fopenai\u002Fdeployments\u002Fgpt-4o-2024-11-20\nexport API_KEY={your-api-key}\n\n# 运行脚本，指定模型名称\npython quickstart.py --model gpt-4o-2024-11-20\n```\n\n> **注意**：\n> - 普通在线服务 URL 格式通常为 `https:\u002F\u002F{endpoint}`。\n> - Azure OpenAI 需在 URL 后追加 `\u002Fopenai\u002Fdeployments\u002F{deployment-name}`。","某法律科技团队需要构建一个智能系统，用于自动分析长达数百万字的跨国并购案卷（包含数十年间的合同、邮件及法庭记录），并从中提取关键风险点。\n\n### 没有 MemAgent 时\n- **上下文截断导致信息遗漏**：传统大模型受限于固定窗口（如 128K），被迫对案卷进行切片处理，导致跨章节的关键证据链断裂，无法识别隐蔽的长期依赖关系。\n- **检索增强生成（RAG）精度不足**：依赖向量数据库检索片段时，常因语义匹配偏差丢失核心细节，且难以处理需要通读全文才能理解的复杂逻辑推理。\n- **推理成本与延迟极高**：为覆盖长文本需多次调用模型或堆叠计算资源，导致单次分析耗时数小时，无法满足业务实时性要求。\n- **模型性能随长度急剧下降**：现有长文本模型在处理超过训练长度（如从 32K 扩展到百万级）时，准确率大幅跳水，无法保证法律结论的可靠性。\n\n### 使用 MemAgent 后\n- **无损处理超长上下文**：MemAgent 凭借独特的记忆机制，直接端到端处理 350 万字以上的完整案卷，无需切片即可捕捉跨越数十万 token 的关键线索。\n- **端到端强化学习优化**：通过多轮对话独立的 RL 训练，MemAgent 在 512K 甚至 3.5M 长度的测试中保持 95% 以上的准确率，精准定位深层风险。\n- **线性扩展的计算效率**：突破传统计算瓶颈，资源消耗随文本长度呈线性增长而非指数爆炸，将原本数小时的分析任务缩短至分钟级。\n- **卓越的长度外推能力**：即使在远超训练数据长度（从 32K 外推至 3.5M）的场景下，性能损失仍控制在 5% 以内，确保法律分析的严谨性。\n\nMemAgent 通过强化学习驱动的记忆架构，彻底解决了超大篇幅文档分析中的信息断层与性能衰减难题，让全量上下文理解成为现实。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FBytedTsinghua-SIA_MemAgent_f42c489d.png","BytedTsinghua-SIA","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FBytedTsinghua-SIA_4c713504.png","The Joint SIA-Lab of Tsinghua AIR & Bytedance Seed - Scalable Intelligent Advanced Technology Joint Research Center",null,"https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA",[81,85,89,93,97],{"name":82,"color":83,"percentage":84},"Python","#3572A5",94.1,{"name":86,"color":87,"percentage":88},"Shell","#89e051",3.9,{"name":90,"color":91,"percentage":92},"Jupyter Notebook","#DA5B0B",1.6,{"name":94,"color":95,"percentage":96},"Jinja","#a52a22",0.3,{"name":98,"color":99,"percentage":100},"Roff","#ecdebe",0.2,975,68,"2026-04-03T14:32:02","Apache-2.0","Linux","必需。基于 vLLM 部署，需 NVIDIA GPU。14B 模型示例命令使用 `--tensor_parallel_size 2`，暗示至少需要 2 张显卡或多卡并行以承载显存。具体显存需求未明确说明，但运行 3.5M token 上下文任务通常需要高显存（建议 80GB+ 总显存或量化版本）。","未说明（建议大容量以支持长上下文数据处理）",{"notes":109,"python":110,"dependencies":111},"1. 核心依赖 vLLM 进行本地模型服务部署。2. 训练和评估严重依赖 Ray 分布式框架，多节点运行需配置 Ray 集群。3. 部分对比实验需手动下载 Qwen2.5-Instruct 系列模型并修改 config.json 以激活 YaRN 扩展技术。4. 数据预处理需要额外安装 nltk, beautifulsoup4 等库。5. 项目主要面向 Linux 环境，利用 Ray 和 vLLM 特性，未提及 Windows\u002FmacOS 支持。","未说明",[112,113,114,115,116,117,118,119,120,121],"vllm","ray[serve,default]","httpx==0.23.1","aiohttp","nltk","pyyaml","beautifulsoup4","html2text","wonderwords","tenacity",[26,13,15],"2026-03-27T02:49:30.150509","2026-04-06T07:13:34.617269",[126,131,136,141,146,151,156],{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},14053,"MemAgent 中的“记忆”是离散 token 还是稠密向量？","MemAgent 使用离散 token 作为记忆。这样做是为了保持与现有训练和推理基础设施的兼容性，并实现人类可读性。","https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fissues\u002F4",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},14054,"运行脚本时遇到 pydantic_core.ValidationError 验证错误怎么办？","该问题通常与 vLLM 版本有关。请确保安装 vLLM 版本为 0.8.2。此外，请注意不要将 verl 作为独立包安装，应直接使用仓库内的 verl 代码。尝试更换 vLLM 版本通常能解决此问题。","https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fissues\u002F9",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},14055,"如何设置 RECURRENT_MAX_CONTEXT_LEN 参数？超过该长度的 token 会如何处理？","RECURRENT_MAX_CONTEXT_LEN 用于控制 MemAgent 处理的总 token 数量。如果输入超过此限制，超出的 token 将被直接忽略（截断）。通常建议将该值设置为一个极大的整数（如 100000000000）以表示“无限”长度。","https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fissues\u002F15",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},14056,"有没有直接使用预训练模型 BytedTsinghua-SIA\u002FRL-MemoryAgent-14B 的示例？如何处理长文本？","项目已提供快速开始脚本（quickstart script），支持本地部署或在线 LLM 服务调用。该脚本中展示了如何将长上下文切割成块（chunks）进行处理，您可以参考该脚本了解具体用法。","https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fissues\u002F3",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},14057,"HotpotQA 数据集上的训练性能较低（约 52%）是否正常？需要训练多少步？","在实验中，模型性能在前 400 步内稳定提升，通常在约 150 步时即可达到较好的效果（耗时约 32 GPU·天）。具体的收敛步数因情况而异，30 步仅是一个占位符。如果遇到运行时错误，请检查 vLLM、transformers 和 verl 的版本兼容性。","https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fissues\u002F8",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},14058,"该项目基于 veRL 的哪个初始提交版本（Commit ID）？","该项目基于 veRL 的修改版本，初始提交 ID 大约在 https:\u002F\u002Fgithub.com\u002Fvolcengine\u002Fverl\u002Fcommit\u002F940caadf72d7bc0762ae564620b41c27c439b577 附近。由于未保留干净的 git 历史，具体差异可能需要手动对比。","https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fissues\u002F7",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},14059,"复现时的指标与论文中展示的指标不一致是什么原因？","如果您仅减小了 batch_size 和 n_rollout，可能会导致训练动态变化从而影响指标。此外，硬件配置不同也会导致训练步数和时间差异较大（例如 8*A800 跑 300 步需 1 天多，而 8*H800 跑 70 步需 2 天）。建议检查超参数设置是否与论文一致，并确保运行足够的步数以观察性能稳定增长。","https:\u002F\u002Fgithub.com\u002FBytedTsinghua-SIA\u002FMemAgent\u002Fissues\u002F12",[]]