[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Memento-Teams--Memento":3,"tool-Memento-Teams--Memento":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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[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":67,"owner_avatar_url":76,"owner_bio":77,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":77,"owner_website":77,"owner_url":78,"languages":79,"stars":84,"forks":85,"last_commit_at":86,"license":87,"difficulty_score":10,"env_os":88,"env_gpu":89,"env_ram":90,"env_deps":91,"category_tags":101,"github_topics":77,"view_count":23,"oss_zip_url":77,"oss_zip_packed_at":77,"status":16,"created_at":102,"updated_at":103,"faqs":104,"releases":134},1420,"Memento-Teams\u002FMemento","Memento","Official Code of Memento: Fine-tuning LLM Agents without Fine-tuning LLMs","Memento 是一款创新的开源框架，旨在让大语言模型（LLM）智能体在不更新模型权重的情况下，通过积累经验实现持续进化。它巧妙地将“微调”转化为基于记忆的在线强化学习过程，解决了传统方法中反复训练模型成本高、效率低且难以实时适应新任务的痛点。\n\n该工具采用独特的“规划器 - 执行器”双阶段架构：规划器利用案例推理（CBR）拆解复杂任务并检索历史成功经验，执行器则通过统一的 MCP 接口调用各类工具完成子任务。所有成功或失败的交互轨迹都会被存入“案例库”，供后续任务按需读取和复用，真正实现“从经验中学习而非依赖梯度更新”。\n\nMemento 特别适合 AI 研究人员、开发者以及需要构建自适应智能体的技术团队使用。其核心亮点在于无需修改模型参数即可显著提升智能体在 GAIA 等基准测试中的表现，并具备优秀的泛化能力。此外，它还内置了丰富的工具生态，支持网页搜索、代码执行及多模态分析等功能，帮助用户以低成本快速搭建具备持续学习能力的智能应用。","# Memento: Fine-tuning LLM Agents **without** Fine-tuning LLMs\n\n> A memory-based, continual-learning framework that helps LLM agents improve from experience **without** updating model weights.\n\n\u003Cp align=\"center\">\n  \u003Cb>Planner–Executor Architecture\u003C\u002Fb> • \u003Cb>Case-Based Reasoning\u003C\u002Fb> • \u003Cb>MCP Tooling\u003C\u002Fb> • \u003Cb>Memory-Augmented Learning\u003C\u002Fb>\n\u003C\u002Fp>\n\n---\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_b6c03800a0ee.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>Memento vs. Baselines on GAIA validation and test sets.\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_006c4baf994d.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>Ablation study of Memento across benchmarks.\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_4304a32bb1be.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>Continual learning curves across memory designs.\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_5f603c3e3a5a.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>Memento’s accuracy improvement on OOD datasets.\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## 📰 News\n- [2025.10.05] We’re excited to announce that our parametric Case-Based Reasoning inference code is now officially open-sourced! 🎉\n- [2025.09.05] We’ve added support to deploy a local LLM as the executor using vLLM, please see client\u002Fagent_local_server.py. 🎉\n- [2025.09.03] We’ve set up a WeChat group to make it easier to collaborate and exchange ideas on this project. Welcome to join the Group to share your thoughts, ask questions, or contribute your ideas! 🔥 🔥 🔥 [Join our WeChat Group Now!](Figure\u002Fwechat.jpg)\n- [2025.08.30] We’re excited to announce that our no-parametric Case-Based Reasoning inference code is now officially open-sourced! 🎉\n- [2025.08.28] We’ve created a Discord server to make discussions and collaboration around this project easier. Feel free to join and share your thoughts, ask questions, or contribute ideas! 🔥 🔥 🔥 [Join our Discord!](https:\u002F\u002Fdiscord.gg\u002Fy4FP2EDXyX)\n- [2025.08.27] Thanks for your interest in our work! We’ll release our CBR code next week and our Parametric Memory code next month. We’ll keep updating on our further development.\n- [2025.08.27] We add a new Crawler MCP in ```server\u002Fai_crawler.py``` for web crawling and query-aware content compression to reduce token cost.\n- [2025.08.26] We add the SerpAPI (https:\u002F\u002Fserpapi.com\u002Fsearch-api) MCP tool to help you avoid using the search Docker and speed up development.\n\n## 🔥 Key Features\n\n- **No LLM weight updates.** Memento reframes continual learning as **memory-based online reinforcement learning** over a **memory-augmented MDP**. A neural **case-selection policy** guides actions; experiences are stored and reused via efficient Read\u002FWrite operations.\n- **Two-stage planner–executor loop.** A CBR-driven **Planner** decomposes tasks and retrieves relevant cases; an **Executor** runs each subtask as an MCP client, orchestrating tools and writing back outcomes.\n- **Comprehensive tool ecosystem.** Built-in support for web search, document processing, code execution, image\u002Fvideo analysis, and more through a unified MCP interface.\n- **Strong benchmark performance.** Achieves competitive results across GAIA, DeepResearcher, SimpleQA, and HLE benchmarks.\n\n---\n\n## 🧠 Core Concept\n\n**Learn from experiences, not gradients.** Memento logs successful & failed trajectories into a **Case Bank** and **retrieves by value** to steer planning and execution—enabling low-cost, transferable, and online continual learning.\n\n---\n\n## 🏗️ Architecture\n\n### Core Components\n\n- **Meta-Planner**: Breaks down high-level queries into executable subtasks using GPT-4.1\n- **Executor**: Executes individual subtasks using o3 or other models via MCP tools\n- **Case Memory**: Stores final-step tuples **(s_T, a_T, r_T)** for experience replay\n- **MCP Tool Layer**: Unified interface for external tools and services\n\n### Tool Ecosystem\n\n- **Web Research**: Live search and controlled crawling via SearxNG\n- **Document Processing**: Multi-format support (PDF, Office, images, audio, video)\n- **Code Execution**: Sandboxed Python workspace with security controls\n- **Data Analysis**: Excel processing, mathematical computations\n- **Media Analysis**: Image captioning, video narration, audio transcription\n\n---\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Python 3.11+\n- OpenAI API key (or compatible API endpoint)\n- SearxNG instance for web search\n- FFmpeg (system-level binary required for video processing)\n- PyTorch 2.0+ with CUDA support (for Parametric Memory)\n\n📖 **For detailed installation instructions, see [INSTALL.md](INSTALL.md)**\n\n### Installation\n\n#### Method 1: Using uv (Recommended - Fast & Modern)\n\n```bash\n# Clone repository\ngit clone https:\u002F\u002Fgithub.com\u002FAgent-on-the-Fly\u002FMemento\ncd Memento\n\n# Install uv if not already installed\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n\n# Sync dependencies and create virtual environment automatically\nuv sync\n\n# Activate the virtual environment\nsource .venv\u002Fbin\u002Factivate  # On Windows: .venv\\Scripts\\activate\n```\n\n#### Method 2: Using pip with requirements.txt\n\n```bash\n# Clone repository\ngit clone https:\u002F\u002Fgithub.com\u002FAgent-on-the-Fly\u002FMemento\ncd Memento\n\n# Create and activate virtual environment\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate  # On Windows: .venv\\Scripts\\activate\n\n# Install dependencies\npip install -r requirements.txt\n```\n\n#### PyTorch Installation\n\n**For GPU support (Recommended for Parametric Memory):**\n\n```bash\n# CUDA 11.8\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n\n# CUDA 12.1\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n\n# CPU only\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcpu\n```\n\nFor more PyTorch installation options, visit: https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F\n\n\n### System Dependencies Installation\n\n#### FFmpeg Installation (Required)\n\n**FFmpeg is required for video processing functionality.** The `ffmpeg-python` package in our dependencies requires a system-level FFmpeg binary.\n\n**Windows:**\n```bash\n# Option 1: Using Conda (Recommended for isolated environment)\nconda install -c conda-forge ffmpeg\n\n# Option 2: Download from official website\n# Visit https:\u002F\u002Fffmpeg.org\u002Fdownload.html and add to PATH\n```\n\n**macOS:**\n```bash\n# Using Homebrew\nbrew install ffmpeg\n```\n\n**Linux:**\n```bash\n# Debian\u002FUbuntu\nsudo apt-get update && sudo apt-get install ffmpeg\n\n```\n\n#### Web Scraping & Search Setup\n\n```bash\n# Install and setup crawl4ai\ncrawl4ai-setup\ncrawl4ai-doctor\n\n# Install playwright browsers\nplaywright install\n```\n\n### Environment Variables Configuration\n\nAfter creating the `.env` file, you need to configure the following API keys and service endpoints:\n\n```bash\n#===========================================\n# OpenAI API Configuration\n#===========================================\nUSE_AZURE_OPENAI=False\n\nOPENAI_API_KEY=your_openai_api_key_here\nOPENAI_BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1  # or your custom endpoint\n\nAZURE_OPENAI_API_KEY=your_azure_openai_api_key_here\nAZURE_OPENAI_API_VERSION=your_azure_openai_api_version_here\nAZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint_here\n\n#===========================================\n# Tools & Services API\n#===========================================\n# Chunkr API (https:\u002F\u002Fchunkr.ai\u002F)\nCHUNKR_API_KEY=your_chunkr_api_key_here\n\n# Jina API\nJINA_API_KEY=your_jina_api_key_here\n\n# ASSEMBLYAI API\nASSEMBLYAI_API_KEY=your_assemblyai_api_key_here\n```\n\n**Note**: Replace `your_*_api_key_here` with your actual API keys. Some services are optional depending on which tools you plan to use.\n\n\n### SearxNG Setup\n\nFor web search capabilities, set up SearxNG:\nYou can follow https:\u002F\u002Fgithub.com\u002Fsearxng\u002Fsearxng-docker\u002F to set the docker and use our setting.\n\n```bash\n# In a new terminal\ncd .\u002FMemento\u002Fsearxng-docker\ndocker compose up -d\n```\n\n\n### Basic Usage\n\n#### Interactive Mode\n\n```bash\npython client\u002Fagent.py\n```\n\n#### Parametric Memory Mode (Advanced - With Memory Retriever)\n\n**Parametric Memory** enables the agent to learn from past experiences using a trained neural retriever model.\n\n**Step 1: Train the Memory Retriever**\n\nFirst, you need to train the retriever model with initial training data:\n\n```bash\ncd memory\n\n# Train the retriever model\npython train_memory_retriever.py \\\n  --train training_data.jsonl \\\n  --output_dir .\u002Fckpts\u002Fretriever \\\n  --use_plan \\\n  --val_ratio 0.1 \\\n  --batch_size 32 \\\n  --lr 2e-5 \\\n  --epochs 10 \\\n  --save_best\n```\n\n**Step 2: Configure Environment Variables**\n\nAdd the following to your `.env` file:\n\n```bash\n# Memory Configuration\nMEMORY_JSONL_PATH=..\u002Fmemory\u002Fmemory.jsonl\nTRAINING_DATA_PATH=..\u002Fmemory\u002Ftraining_data.jsonl\nRETRIEVER_MODEL_PATH=..\u002Fmemory\u002Fckpts\u002Fretriever\u002Fbest.pt\nMEMORY_TOP_K=8\nMEMORY_MAX_POS_EXAMPLES=8\nMEMORY_MAX_NEG_EXAMPLES=8\n```\n\n**Step 3: Run Parametric Memory Agent**\n\n```bash\ncd client\n\npython parametric_memory.py\n```\n---\n\n## 🔧 Configuration\n\n### Model Selection\n\n- **Planner Model**: Defaults to `gpt-4.1` for task decomposition\n- **Executor Model**: Defaults to `o3` for task execution\n- **Custom Models**: Support for any OpenAI-compatible API\n\n### Tool Configuration\n\n- **Search**: Configure SearxNG instance URL\n- **Code Execution**: Customize import whitelist and security settings\n- **Document Processing**: Set cache directories and processing limits\n\n---\n\n## 📊 Performance\n\n### Benchmark Results\n\n- **GAIA**: 87.88% (Val, Pass@3 Top-1) and **79.40%** (Test)\n- **DeepResearcher**: **66.6% F1 \u002F 80.4% PM**, with **+4.7–9.6** absolute gains on OOD datasets\n- **SimpleQA**: **95.0%**\n- **HLE**: **24.4% PM** (close to GPT-5 at 25.32%)\n\n### Key Insights\n\n- **Small, high-quality memory works best**: Retrieval **K=4** yields peak F1\u002FPM\n- **Planning + CBR consistently improves performance**\n- **Concise, structured planning outperforms verbose deliberation**\n\n---\n\n## 🛠️ Development\n\n### Project Structure\n\n```\nMemento\u002F\n├── client\u002F                      # Main agent implementation\n│   ├── agent.py                # Hierarchical client with planner–executor\n│   ├── no_parametric_cbr.py    # Non-parametric case-based reasoning\n│   ├── parametric_memory.py    # Parametric memory with neural retriever\n│   ├── run_parametric.sh       # Convenience script for parametric mode\n│   └── PARAMETRIC_MEMORY_GUIDE.md  # Detailed parametric memory guide\n├── server\u002F                      # MCP tool servers\n│   ├── code_agent.py           # Code execution & workspace management\n│   ├── search_tool.py          # Web search via SearxNG\n│   ├── serp_search.py          # SERP-based search tool\n│   ├── documents_tool.py       # Multi-format document processing\n│   ├── image_tool.py           # Image analysis & captioning\n│   ├── video_tool.py           # Video processing & narration\n│   ├── excel_tool.py           # Spreadsheet processing\n│   ├── math_tool.py            # Mathematical computations\n│   ├── craw_page.py            # Web page crawling\n│   └── ai_crawler.py           # Query-aware compression crawler\n├── interpreters\u002F                # Code execution backends\n│   ├── docker_interpreter.py\n│   ├── e2b_interpreter.py\n│   ├── internal_python_interpreter.py\n│   └── subprocess_interpreter.py\n├── memory\u002F                      # Memory components \u002F data\n│   ├── parametric_memory.py        # Case retriever for inference\n│   ├── train_memory_retriever.py  # Retriever training script\n│   ├── np_memory.py            # Non-parametric memory utilities\n│   ├── retrain.sh              # Convenience script for retraining\n│   ├── memory.jsonl            # Memory pool (cases with labels)\n│   ├── training_data.jsonl     # Training data for retriever\n│   └── ckpts\u002F                  # Model checkpoints\n│       └── retriever\u002F\n│           ├── best.pt         # Best performing model\n│           └── last.pt         # Last epoch model\n├── data\u002F                        # Sample data \u002F cases\n├── searxng-docker\u002F              # SearxNG Docker setup\n├── Figure\u002F                      # Figures for README\u002Fpaper\n├── README.md\n├── requirements.txt\n├── pyproject.toml\n└── LICENSE\n```\n\n### Adding New Tools\n\n1. Create a new FastMCP server in the `server\u002F` directory\n2. Implement your tool functions with proper error handling\n3. Register the tool with the MCP protocol\n4. Update the client's server list in `agent.py`\n\n### Custom Interpreters\n\nExtend the `interpreters\u002F` module to add new execution backends:\n\n```python\nfrom interpreters.base import BaseInterpreter\n\nclass CustomInterpreter(BaseInterpreter):\n    async def execute(self, code: str) -> str:\n        # Your custom execution logic\n        pass\n```\n\n---\n\n## 📋 TODO\n\n### Completed Features ✅\n\n- [x] **Add Case Bank Reasoning**: Implemented parametric memory-based case retrieval with neural retriever\n- [x] **Continual Learning Pipeline**: Automated training data collection and model retraining\n\n### Upcoming Features & Improvements\n\n- [ ] **Add User Personal Memory Mechanism**: Implement user-preference search\n- [ ] **Refine Tools & Add More Tools**: Enhance existing tools and expand the tool ecosystem\n- [ ] **Test More New Benchmarks**: Evaluate performance on additional benchmark datasets\n- [ ] **Memory Compression**: Implement efficient memory pruning and compression strategies\n- [ ] **Multi-modal Memory**: Extend memory to support images, videos, and other modalities\n\n---\n\n### Limitations\n\n- **Long-horizon tasks**: GAIA Level-3 remains challenging due to compounding errors\n- **Frontier knowledge**: HLE performance limited by tooling alone\n- **Open-source coverage**: Limited executor validation in fully open pipelines\n\n---\n\n## 🙏 Acknowledgement\n\n* Some of the code in the toolkits and interpreters is adapted from [Camel-AI](https:\u002F\u002Fgithub.com\u002Fcamel-ai\u002Fcamel).\n\n---\n\n## 📚 Citation\n\nIf Memento helps your work, please cite:\n\n```bibtex\n@article{zhou2025mementofinetuningllmagents,\n      title={Memento: Fine-tuning LLM Agents without Fine-tuning LLMs},\n      author={Huichi Zhou and Yihang Chen and Siyuan Guo and Xue Yan and Kin Hei Lee and Zihan Wang and Ka Yiu Lee and Guchun Zhang and Kun Shao and Linyi Yang and Jun Wang},\n      journal={arXiv preprint arXiv: 2508.16153},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.16153},\n      year={2025}\n}\n\n@article{huang2025deep,\n  title={Deep Research Agents: A Systematic Examination And Roadmap},\n  author={Huang, Yuxuan and Chen, Yihang and Zhang, Haozheng and Li, Kang and Fang, Meng and Yang, Linyi and Li, Xiaoguang and Shang, Lifeng and Xu, Songcen and Hao, Jianye and others},\n  journal={arXiv preprint arXiv:2506.18096},\n  year={2025}\n}\n```\n\nFor a broader overview, please check out our survey: [Github](https:\u002F\u002Fgithub.com\u002Fai-agents-2030\u002Fawesome-deep-research-agent)\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our contributing guidelines for:\n\n- Bug reports and feature requests\n- Code contributions and pull requests\n- Documentation improvements\n- Tool and interpreter extensions\n\n---\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_e96676a40959.png)](https:\u002F\u002Fwww.star-history.com\u002F#Agent-on-the-Fly\u002FMemento&Date)\n","# 重要提示：在不微调大型语言模型（LLMs）的情况下，对 LLM 代理进行精细调优\n\n> 一种基于记忆的持续学习框架，可帮助 LLM 代理从经验中不断改进，而无需更新模型权重。\n\n\u003Cp align=\"center\">\n  \u003Cb>规划器-执行器架构\u003C\u002Fb> • \u003Cb>基于案例的推理\u003C\u002Fb> • \u003Cb>MCP 工具集\u003C\u002Fb> • \u003Cb>增强记忆的学习\u003C\u002Fb>\n\u003C\u002Fp>\n\n---\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_b6c03800a0ee.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>与基线相比，Memento 在 GAIA 验证集和测试集上的表现。\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_006c4baf994d.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>对 Memento 在各类基准测试中的消融研究。\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_4304a32bb1be.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>不同记忆设计下的持续学习曲线。\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\" width=\"50%\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_5f603c3e3a5a.jpg\" width=\"90%\"\u002F>\n      \u003Cbr\u002F>\n      \u003Csub>\u003Cb>Memento 在未见过的数据集上所取得的准确率提升。\u003C\u002Fb>\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## 📰 新闻\n- [2025.10.05] 我们很高兴地宣布，我们的参数化基于案例的推理推理代码现已正式开源！🎉\n- [2025.09.05] 我们新增了支持，可通过 vLLM 将本地 LLM 作为执行器进行部署，请参阅 client\u002Fagent_local_server.py。🎉\n- [2025.09.03] 我们建立了微信群，以便更轻松地开展协作并交流本项目的相关想法。欢迎加入该群，分享您的见解、提出问题或贡献您的创意！🔥 🔥 🔥 [立即加入我们的微信群！](Figure\u002Fwechat.jpg)\n- [2025.08.30] 我们很高兴地宣布，我们的非参数化基于案例的推理推理代码现已正式开源！🎉\n- [2025.08.28] 我们创建了一个 Discord 服务器，以使围绕本项目的讨论与协作更加便捷。欢迎加入并分享您的想法、提出问题或贡献创意！🔥 🔥 🔥 [加入我们的 Discord！](https:\u002F\u002Fdiscord.gg\u002Fy4FP2EDXyX)\n- [2025.08.27] 感谢您对我们工作的关注！我们将在下周发布 CBR 代码，并在下个月发布参数化记忆代码。我们将持续更新本项目的最新进展。\n- [2025.08.27] 我们在 ```server\u002Fai_crawler.py``` 中新增了一项新的爬虫 MCP，用于网络爬取以及查询感知的内容压缩，以降低 token 成本。\n- [2025.08.26] 我们新增了 SerpAPI（https:\u002F\u002Fserpapi.com\u002Fsearch-api）MCP 工具，帮助您避免使用搜索 Docker，从而加快开发速度。\n\n## 🔥 核心功能\n\n- **无需更新 LLM 权重。** Memento 将持续学习重新构想为基于记忆的在线强化学习，其基础是**增强记忆的 MDP**。通过神经网络的**案例选择策略**来指导行动；经验则通过高效且快速的读写操作被存储并重复利用。\n- **两阶段的规划器-执行器循环。** 由 CBR 驱动的**规划器**会将任务分解并检索相关案例；**执行器**则以 MCP 客户端的身份运行每个子任务，协调工具并回传执行结果。\n- **全面的工具生态系统。** 通过统一的 MCP 界面，内置支持网页搜索、文档处理、代码执行、图像\u002F视频分析等多种功能。\n- **卓越的基准测试表现。** 在 GAIA、DeepResearcher、SimpleQA 和 HLE 等基准测试中均取得了具有竞争力的成绩。\n\n---\n\n## 🧠 核心概念\n\n**从经验中学习，而非依赖梯度。** Memento 会将成功与失败的轨迹记录到**案例库**中，并按值进行检索，以引导规划与执行——从而实现低成本、可迁移且在线的持续学习。\n\n---\n\n## 🏗️ 架构\n\n### 核心组件\n\n- **元规划器**：利用 GPT-4.1 将高阶查询分解为可执行的子任务。\n- **执行器**：通过 MCP 工具，使用 o3 或其他模型执行各个子任务。\n- **案例记忆**：存储最终步骤的元组 **(s_T, a_T, r_T)**，用于经验回放。\n- **MCP 工具层**：为外部工具和服务提供统一的接口。\n\n### 工具生态系统\n\n- **网络搜索**：通过 SearxNG 实现实时搜索与受控爬取。\n- **文档处理**：支持多种格式（PDF、Office 文档、图片、音频、视频）。\n- **代码执行**：配备沙盒化的 Python 工作区，并具备安全管控机制。\n- **数据分析**：支持 Excel 处理、数学计算。\n- **媒体分析**：图像标题生成、视频旁白、音频转录。\n\n---\n\n## 🚀 快速入门\n\n### 前提条件\n\n- Python 3.11+\n- OpenAI API 密钥（或兼容的 API 端点）\n- SearxNG 实例用于网络搜索\n- FFmpeg（系统级二进制文件，用于视频处理）\n- PyTorch 2.0+ 并支持 CUDA（适用于参数化记忆）\n\n📖 **如需详细安装指南，请参阅 [INSTALL.md](INSTALL.md)**\n\n### 安装\n\n#### 方法 1：使用 uv（推荐方案——快速又现代）\n\n```bash\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002FAgent-on-the-Fly\u002FMemento\ncd Memento\n\n# 如果尚未安装 uv，可直接运行以下命令\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n\n# 自动同步依赖并创建虚拟环境\nuv sync\n\n# 激活虚拟环境\nsource .venv\u002Fbin\u002Factivate  # 在 Windows 上：.venv\\Scripts\\activate\n```\n\n#### 方法 2：使用 pip 与 requirements.txt\n\n```bash\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002FAgent-on-the-Fly\u002FMemento\ncd Memento\n\n# 创建并激活虚拟环境\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate  # 在 Windows 上：.venv\\Scripts\\activate\n\n# 安装依赖\npip install -r requirements.txt\n```\n\n#### PyTorch 安装\n\n**针对 GPU 支持（参数化记忆推荐方案）：**\n\n```bash\n# CUDA 11.8\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\n\n# CUDA 12.1\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n\n# 仅支持 CPU\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcpu\n```\n\n如需更多 PyTorch 安装选项，请访问：https:\u002F\u002Fpytorch.org\u002Fget-started\u002Flocally\u002F\n\n### 系统依赖安装\n\n#### FFmpeg 安装（必需）\n\n**FFmpeg 是视频处理功能所必需的。** 我们的依赖中包含的 `ffmpeg-python` 包需要一个系统级的 FFmpeg 二进制文件。\n\n**Windows：**\n```bash\n# 方法 1：使用 Conda（推荐用于隔离环境）\nconda install -c conda-forge ffmpeg\n\n# 方法 2：从官方网站下载\n# 访问 https:\u002F\u002Fffmpeg.org\u002Fdownload.html 并将其添加到 PATH 中\n```\n\n**macOS：**\n```bash\n# 使用 Homebrew\nbrew install ffmpeg\n```\n\n**Linux：**\n```bash\n# Debian\u002FUbuntu\nsudo apt-get update && sudo apt-get install ffmpeg\n\n```\n\n#### 网页爬取与搜索设置\n\n```bash\n# 安装并配置 crawl4ai\ncrawl4ai-setup\ncrawl4ai-doctor\n\n# 安装 Playwright 浏览器\nplaywright install\n```\n\n### 环境变量配置\n\n在创建 `.env` 文件后，您需要配置以下 API 密钥和服务端点：\n\n```bash\n#===========================================\n\n# OpenAI API 配置\n#===========================================\nUSE_AZURE_OPENAI=False\n\nOPENAI_API_KEY=your_openai_api_key_here\nOPENAI_BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1  # 或者使用您自定义的 API 端点\n\nAZURE_OPENAI_API_KEY=your_azure_openai_api_key_here\nAZURE_OPENAI_API_VERSION=your_azure_openai_api_version_here\nAZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint_here\n\n#===========================================\n# 工具与服务 API\n#===========================================\n# Chunkr API（https:\u002F\u002Fchunkr.ai\u002F）\nCHUNKR_API_KEY=your_chunkr_api_key_here\n\n# Jina API\nJINA_API_KEY=your_jina_api_key_here\n\n# ASSEMBLYAI API\nASSEMBLYAI_API_KEY=your_assemblyai_api_key_here\n```\n\n**注意**：请将 `your_*_api_key_here` 替换为您的实际 API 密钥。部分服务为可选，具体取决于您计划使用的工具。\n\n### SearxNG 设置\n\n若需实现网页搜索功能，请配置 SearxNG：\n您可以参考 https:\u002F\u002Fgithub.com\u002Fsearxng\u002Fsearxng-docker\u002F 来设置 Docker 并使用我们的配置方案。\n\n```bash\n# 在新终端中\ncd .\u002FMemento\u002Fsearxng-docker\ndocker compose up -d\n```\n\n### 基本用法\n\n#### 交互式模式\n\n```bash\npython client\u002Fagent.py\n```\n\n#### 参数化记忆模式（高级模式——带记忆检索器）\n\n**参数化记忆**使代理能够借助训练有素的神经检索器模型，从过往经验中进行学习。\n\n**步骤 1：训练记忆检索器**\n\n首先，您需要使用初始训练数据来训练检索器模型：\n\n```bash\ncd memory\n\n# 训练检索器模型\npython train_memory_retriever.py \\\n  --train training_data.jsonl \\\n  --output_dir .\u002Fckpts\u002Fretriever \\\n  --use_plan \\\n  --val_ratio 0.1 \\\n  --batch_size 32 \\\n  --lr 2e-5 \\\n  --epochs 10 \\\n  --save_best\n```\n\n**步骤 2：配置环境变量**\n\n在您的 `.env` 文件中添加以下内容：\n\n```bash\n# 记忆配置\nMEMORY_JSONL_PATH=..\u002Fmemory\u002Fmemory.jsonl\nTRAINING_DATA_PATH=..\u002Fmemory\u002Ftraining_data.jsonl\nRETRIEVER_MODEL_PATH=..\u002Fmemory\u002Fckpts\u002Fretriever\u002Fbest.pt\nMEMORY_TOP_K=8\nMEMORY_MAX_POS_EXAMPLES=8\nMEMORY_MAX_NEG_EXAMPLES=8\n```\n\n**步骤 3：运行参数化记忆代理**\n\n```bash\ncd client\n\npython parametric_memory.py\n```\n---\n\n## 🔧 配置\n\n### 模型选择\n\n- **规划器模型**：默认采用 `gpt-4.1` 以支持任务分解\n- **执行器模型**：默认采用 `o3` 以实现任务执行\n- **自定义模型**：支持任何兼容 OpenAI 的 API\n\n### 工具配置\n\n- **搜索**：配置 SearxNG 实例的 URL\n- **代码执行**：自定义导入白名单及安全设置\n- **文档处理**：设置缓存目录及处理限制\n\n---\n\n## 📊 性能\n\n### 基准测试结果\n\n- **GAIA**：87.88%（验证集，Pass@3 Top-1）和 **79.40%**（测试集）\n- **DeepResearcher**：**66.6% F1 \u002F 80.4% PM**，在 OOD 数据集上实现了 **+4.7–9.6** 的绝对性能提升\n- **SimpleQA**：**95.0%**\n- **HLE**：**24.4% PM**（接近 GPT-5，达到 25.32%）\n\n### 关键洞察\n\n- **小型、高质量的记忆效果最佳**：当检索器的 **K=4** 时，F1\u002FPM 值达到峰值\n- **规划 + CBR 能持续提升性能**\n- **简洁、结构化的规划方式，优于冗长的决策过程**\n\n---\n\n## 🛠️ 开发\n\n### 项目结构\n\n```\nMemento\u002F\n├── client\u002F                      # 主要代理实现\n│   ├── agent.py                # 分层客户端，结合规划器与执行器\n│   ├── no_parametric_cbr.py    # 非参数化基于案例推理\n│   ├── parametric_memory.py    # 带神经检索器的参数化记忆\n│   ├── run_parametric.sh       # 用于参数化模式的便捷脚本\n│   └── PARAMETRIC_MEMORY_GUIDE.md  # 详细参数化记忆指南\n├── server\u002F                      # MCP 工具服务器\n│   ├── code_agent.py           # 代码执行与工作区管理\n│   ├── search_tool.py          # 通过 SearxNG 进行网页搜索\n│   ├── serp_search.py          # 基于 SERP 的搜索工具\n│   ├── documents_tool.py       # 多格式文档处理\n│   ├── image_tool.py           # 图片分析与标注\n│   ├── video_tool.py           # 视频处理与旁白生成\n│   ├── excel_tool.py           # 电子表格处理\n│   ├── math_tool.py            # 数学计算\n│   ├── craw_page.py            # 网页抓取\n│   └── ai_crawler.py           # 查询感知压缩爬虫\n├── interpreters\u002F                # 代码执行后端\n│   ├── docker_interpreter.py\n│   ├── e2b_interpreter.py\n│   ├── internal_python_interpreter.py\n│   └── subprocess_interpreter.py\n├── memory\u002F                      # 记忆组件 \u002F 数据\n│   ├── parametric_memory.py        # 基于案例的检索器，用于推理\n│   ├── train_memory_retriever.py  # 检索器训练脚本\n│   ├── np_memory.py            # 非参数化记忆实用工具\n│   ├── retrain.sh              # 用于重新训练的便捷脚本\n│   ├── memory.jsonl            # 记忆池（带有标签的案例）\n│   ├── training_data.jsonl     # 检索器的训练数据\n│   └── ckpts\u002F                  # 模型检查点\n│       └── retriever\u002F\n│           ├── best.pt         # 最佳性能模型\n│           └── last.pt         # 上一阶段的模型\n├── data\u002F                        # 样本数据 \u002F 案例\n├── searxng-docker\u002F              # SearxNG Docker 配置\n├── Figure\u002F                      # 用于 README\u002F论文的图表\n├── README.md\n├── requirements.txt\n├── pyproject.toml\n└── LICENSE\n```\n\n### 添加新工具\n\n1. 在 `server\u002F` 目录下创建一个新的 FastMCP 服务器\n2. 实现您的工具函数，并确保具备完善的错误处理机制\n3. 将工具注册到 MCP 协议中\n4. 更新 `agent.py` 中客户端的服务器列表\n\n### 自定义解释器\n\n扩展 `interpreters\u002F` 模块，以新增多种执行后端：\n\n```python\nfrom interpreters.base import BaseInterpreter\n\nclass CustomInterpreter(BaseInterpreter):\n    async def execute(self, code: str) -> str:\n        # 您的自定义执行逻辑\n        pass\n```\n\n---\n\n## 📋 待办事项\n\n### 已完成的功能 ✅\n\n- [x] **增加案例库推理**：已实现基于参数化记忆的案例检索，并结合神经检索器\n- [x] **持续学习流程**：自动化收集训练数据并进行模型重新训练\n\n### 即将推出的功能与改进方向\n\n- [ ] **加入用户个人记忆机制**：实现用户偏好搜索功能\n- [ ] **优化工具，新增更多工具**：完善现有工具，拓展工具生态系统\n- [ ] **测试更多新基准**：在更多基准数据集上评估性能\n- [ ] **内存压缩**：实施高效的内存剪枝与压缩策略\n- [ ] **多模态记忆**：将记忆扩展至支持图片、视频及其他模态\n\n---\n\n### 局限性\n\n- **长周期任务**：GAIA 第三级任务仍具有挑战性，因为存在复合误差\n- **前沿知识**：HLE 的性能仅受限于工具本身\n- **开源覆盖范围**：完全开放的管道中，执行器的验证尚显不足\n\n---\n\n## 🙏 感谢\n\n* 一些工具包和解释器中的代码源自 [Camel-AI](https:\u002F\u002Fgithub.com\u002Fcamel-ai\u002Fcamel)。\n\n---\n\n## 📚 引用\n\n如果《Memento》对您的工作有所帮助，请务必进行引用：\n\n```bibtex\n@article{zhou2025mementofinetuningllmagents,\n      title={Memento：在不微调大语言模型的前提下，对大语言模型代理进行微调},\n      author={周虎驰、陈一航、郭思远、严雪、李金黑、王梓涵、李家耀、张古春、邵坤、杨林毅、王俊},\n      journal={arXiv预印本 arXiv: 2508.16153},\n      url={https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.16153},\n      year={2025}\n}\n\n@article{huang2025deep,\n  title={深度研究代理：系统性考察与路线图},\n  author={黄宇轩、陈一航、张浩政、李康、方萌、杨林毅、李小光、尚立峰、徐松岑、郝建业等},\n  journal={arXiv预印本 arXiv:2506.18096},\n  year={2025}\n}\n```\n\n如需更全面的概览，请参阅我们的调查：[GitHub](https:\u002F\u002Fgithub.com\u002Fai-agents-2030\u002Fawesome-deep-research-agent)\n\n---\n\n## 🤝 贡献\n\n我们热烈欢迎各位的贡献！请查看我们的贡献指南，了解以下内容：\n\n- 错误报告与功能请求\n- 代码贡献与拉取请求\n- 文档改进\n- 工具与解释器扩展\n\n---\n\n## 星星历史\n\n[![星星历史图表](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_readme_e96676a40959.png)](https:\u002F\u002Fwww.star-history.com\u002F#Agent-on-the-Fly\u002FMemento&Date)","# Memento 快速上手指南\n\nMemento 是一个基于记忆的持续学习框架，旨在帮助 LLM 智能体通过经验积累提升能力，而**无需更新模型权重**。它采用“规划器 - 执行器”架构，结合基于案例的推理（CBR）和 MCP 工具生态，实现低成本、可迁移的在线学习。\n\n## 1. 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux, macOS 或 Windows\n*   **Python**: 3.11 或更高版本\n*   **GPU (可选但推荐)**: 如需使用参数化记忆（Parametric Memory）功能，需要支持 CUDA 的 GPU 及 PyTorch 2.0+\n*   **API Key**: OpenAI API Key（或兼容的 endpoint，如 Azure OpenAI）\n*   **外部服务**:\n    *   **SearxNG**: 用于网络搜索（需部署 Docker 实例）\n    *   **FFmpeg**: 系统级二进制文件，用于视频处理\n    *   **Playwright**: 用于网页抓取\n\n## 2. 安装步骤\n\n### 2.1 克隆项目\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FAgent-on-the-Fly\u002FMemento\ncd Memento\n```\n\n### 2.2 安装依赖\n\n推荐使用 `uv` 进行快速安装（国内网络若受阻可尝试方法二）：\n\n**方法一：使用 uv (推荐)**\n```bash\n# 安装 uv\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n\n# 同步依赖并创建虚拟环境\nuv sync\n\n# 激活虚拟环境\nsource .venv\u002Fbin\u002Factivate  # Windows: .venv\\Scripts\\activate\n```\n\n**方法二：使用 pip**\n```bash\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate  # Windows: .venv\\Scripts\\activate\n\n# 安装依赖 (国内用户可添加清华源加速)\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n**安装 PyTorch (如需参数化记忆功能)**\n根据您的需求选择 CUDA 版本或 CPU 版本：\n```bash\n# CUDA 12.1 (示例)\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n\n# 仅 CPU\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcpu\n```\n\n### 2.3 安装系统依赖\n\n**安装 FFmpeg**\n*   **Ubuntu\u002FDebian**: `sudo apt-get update && sudo apt-get install ffmpeg`\n*   **macOS**: `brew install ffmpeg`\n*   **Windows**: 建议通过 conda 安装 `conda install -c conda-forge ffmpeg` 或手动下载配置 PATH。\n\n**配置网页抓取工具**\n```bash\ncrawl4ai-setup\ncrawl4ai-doctor\nplaywright install\n```\n\n### 2.4 部署 SearxNG (网络搜索必需)\n在项目根目录下启动 SearxNG Docker 容器：\n```bash\ncd .\u002FMemento\u002Fsearxng-docker\ndocker compose up -d\n```\n\n### 2.5 配置环境变量\n\n复制 `.env` 模板并填入您的 API Key：\n```bash\ncp .env.example .env\n```\n\n编辑 `.env` 文件，配置关键信息：\n```bash\n# OpenAI 配置\nOPENAI_API_KEY=your_openai_api_key_here\nOPENAI_BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\n\n# 可选：其他工具 API (Chunkr, Jina, AssemblyAI 等按需配置)\nCHUNKR_API_KEY=your_chunkr_api_key_here\nJINA_API_KEY=your_jina_api_key_here\n```\n\n## 3. 基本使用\n\n### 3.1 交互式模式 (基础版)\n这是最简单的启动方式，智能体将加载默认配置并与您交互：\n\n```bash\npython client\u002Fagent.py\n```\n\n### 3.2 参数化记忆模式 (进阶版)\n如果您希望智能体利用训练好的神经检索器从历史经验中学习，请按以下步骤操作：\n\n**第一步：训练记忆检索器**\n```bash\ncd memory\n\npython train_memory_retriever.py \\\n  --train training_data.jsonl \\\n  --output_dir .\u002Fckpts\u002Fretriever \\\n  --use_plan \\\n  --val_ratio 0.1 \\\n  --batch_size 32 \\\n  --lr 2e-5 \\\n  --epochs 10 \\\n  --save_best\n```\n\n**第二步：配置记忆路径**\n在 `.env` 文件中添加以下配置：\n```bash\nMEMORY_JSONL_PATH=..\u002Fmemory\u002Fmemory.jsonl\nTRAINING_DATA_PATH=..\u002Fmemory\u002Ftraining_data.jsonl\nRETRIEVER_MODEL_PATH=..\u002Fmemory\u002Fckpts\u002Fretriever\u002Fbest.pt\nMEMORY_TOP_K=8\nMEMORY_MAX_POS_EXAMPLES=8\nMEMORY_MAX_NEG_EXAMPLES=8\n```\n\n**第三步：运行带记忆的智能体**\n```bash\ncd client\npython parametric_memory.py\n```\n\n---\n*更多详细配置、工具自定义及开发指南，请参阅项目根目录下的 `INSTALL.md` 及 `client\u002FPARAMETRIC_MEMORY_GUIDE.md`。*","某电商数据团队需要构建一个智能助手，每日自动从多个新闻源和财报中抓取竞品动态，并生成结构化分析报告。\n\n### 没有 Memento 时\n- **重复犯错**：模型每次遇到新的网站反爬策略或复杂的表格格式时都会重新“试错”，无法记住之前的成功破解方案，导致任务频繁中断。\n- **成本高昂**：为了提升准确率，团队不得不频繁对大模型进行微调（Fine-tuning），消耗大量 GPU 算力和时间，且难以实时生效。\n- **缺乏积累**：助手无法将处理过的成功案例转化为经验，面对相似的新任务（如分析另一家竞品）时，仍需从头开始规划，效率低下。\n- **工具调度僵化**：在调用搜索、代码解释器等工具时，一旦某步出错，系统缺乏基于历史经验的自我修正机制，只能报错停止。\n\n### 使用 Memento 后\n- **经验复用**：Memento 将成功的抓取策略和失败的教训存入“案例库”，遇到类似反爬或格式问题时，直接检索历史最佳实践，一次性通过。\n- **零权重更新**：无需修改模型参数，仅通过读写记忆即可实现持续学习，大幅降低了算力成本，且新经验能秒级生效。\n- **越用越聪明**：随着运行次数增加，案例库不断丰富，Memento 能自动迁移过往经验到新竞品分析中，规划路径更精准，执行速度显著提升。\n- **自愈能力强**：基于案例推理（CBR），当子任务执行受阻时，Planner 能参考历史相似场景的修复方案，自动调整工具调用顺序或参数，完成闭环。\n\nMemento 让 AI 代理像人类专家一样通过“积累经验”而非“重新训练”来进化，实现了低成本、实时的持续能力提升。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMemento-Teams_Memento_b6c03800.jpg","Memento-Teams","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FMemento-Teams_c6fd81f4.png",null,"https:\u002F\u002Fgithub.com\u002FMemento-Teams",[80],{"name":81,"color":82,"percentage":83},"Python","#3572A5",100,2378,277,"2026-04-05T04:46:56","MIT","Linux, macOS, Windows","可选（参数化记忆模式推荐）。需支持 CUDA 11.8 或 12.1 的 NVIDIA GPU；CPU 模式亦可运行但功能受限。","未说明",{"notes":92,"python":93,"dependencies":94},"1. 必须安装系统级 FFmpeg 二进制文件以支持视频处理。2. 需自行部署 SearxNG 实例（可通过 Docker）用于网络搜索。3. 参数化记忆模式需要训练检索模型，非参数化模式无需训练。4. 需配置 OpenAI API Key 或其他兼容接口，以及可选的 Chunkr、Jina、AssemblyAI 等工具密钥。5. 推荐使用 uv 进行依赖管理和环境创建。","3.11+",[95,96,97,98,99,100],"torch>=2.0","torchvision","torchaudio","ffmpeg-python","crawl4ai","playwright",[26,13,15],"2026-03-27T02:49:30.150509","2026-04-06T08:45:47.048456",[105,110,115,120,124,129],{"id":106,"question_zh":107,"answer_zh":108,"source_url":109},6515,"代码中的内存（Memory）在初始化后未动态更新，这会导致基准线计算错误吗？","不会导致基准线计算错误。在原始代码中，内存实际上是在 for 循环内部重新加载的，因此每次迭代都能看到最新的更新。该问题仅出现在整理后的版本中，其中遗漏了重新加载的步骤。","https:\u002F\u002Fgithub.com\u002FMemento-Teams\u002FMemento\u002Fissues\u002F19",{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},6516,"为什么 Planner 会输出空字符串从而导致 JSON 解析错误（而非 JSON 格式错误）？","这是因为 Planner 期望接收 JSON 格式的规划。如果模型的结构化输出能力较弱，可能会产生格式错误的 JSON 或空字符串。发布的代码是与论文实验设置对齐的最小可运行单元，不包含重试机制。为避免此问题，建议：(1) 使用具有更好结构化生成能力的更强模型；(2) 添加一个重试循环，验证 JSON 并在失败时重新生成规划。此外，需检查消息历史构建逻辑，确保第一个循环结束时 planner_msgs 中以 \"user\" 消息结尾，否则第二个循环的规划器输出可能为空。","https:\u002F\u002Fgithub.com\u002FMemento-Teams\u002FMemento\u002Fissues\u002F3",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},6517,"Deep Researcher 实现中的案例记忆三元组 (case triplets) 具体由什么组成？","在 Deep Researcher 的实现中，案例记忆三元组由 \u003C任务 (task), 规划 (plan), 奖励 (reward)> 组成。给定任务后，Planner 会检索相关的案例三元组，并使用 LLM 规划子任务。这与代码实现逻辑一致。","https:\u002F\u002Fgithub.com\u002FMemento-Teams\u002FMemento\u002Fissues\u002F13",{"id":121,"question_zh":122,"answer_zh":123,"source_url":119},6518,"当前发布的 Deep Researcher 代码是否包含重规划（re-plan）模块？如果没有，未来会发布吗？","当前发布的代码中未找到重规划模块。关于是否会发布以及重规划的触发机制（是否使用案例库检索规划），目前代码主要展示了基于 \u003C任务，规划，奖励> 的一次性规划流程，执行器的观察并未触发内存更新和检索。具体的重规划功能细节需关注后续更新或参考论文中关于 M-MDP 算法的描述。",{"id":125,"question_zh":126,"answer_zh":127,"source_url":128},6519,"GAIA 测试集 79.40% 的结果是基于 pass@1 还是 pass@3？","该结果通常指 pass@1（即单次尝试的成功率），除非论文明确说明使用了多次采样取最优（pass@k）。在标准的 GAIA 基准测试报告中，若无特殊标注，默认均为 pass@1 指标。","https:\u002F\u002Fgithub.com\u002FMemento-Teams\u002FMemento\u002Fissues\u002F4",{"id":130,"question_zh":131,"answer_zh":132,"source_url":133},6520,"SubprocessInterpreter 初始化时传入 workspace_dir 参数报错怎么办？","这是一个已修复的代码 Bug。此前 `server\u002Fcode_agent.py` 在初始化 `SubprocessInterpreter` 时传入了 `workspace_dir` 参数，但该类的构造函数中并未定义此参数。维护者已确认并修复了此问题，请拉取最新代码即可解决。","https:\u002F\u002Fgithub.com\u002FMemento-Teams\u002FMemento\u002Fissues\u002F23",[]]