[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-facebookresearch--Pearl":3,"tool-facebookresearch--Pearl":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",150720,2,"2026-04-11T11:33:10",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":32,"env_os":92,"env_gpu":92,"env_ram":92,"env_deps":93,"category_tags":99,"github_topics":76,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":100,"updated_at":101,"faqs":102,"releases":133},6647,"facebookresearch\u002FPearl","Pearl","A Production-ready Reinforcement Learning AI Agent Library brought by the Applied Reinforcement Learning team at Meta. ","Pearl 是由 Meta 应用强化学习团队开源的一款生产级强化学习智能体库，旨在帮助开发者和研究人员构建能够适应复杂现实环境的 AI 智能体。与传统方法不同，Pearl 专注于让智能体在反馈稀疏、环境观测有限或随机性极高的场景中，优先优化长期的累积回报，而非仅仅追求即时奖励，从而有效解决了强化学习算法难以落地到实际生产环境的痛点。\n\n该工具特别适合从事 AI 算法研究的研究员、需要部署高可靠性智能体的工程师，以及希望探索前沿强化学习技术的开发者。Pearl 的核心亮点在于其“生产就绪”的设计理念：它不仅提供了模块化架构以支持灵活定制，还深度集成了类似 PyTorch 的状态序列化机制，支持智能体及其子组件（如策略学习器）的便捷保存与加载。此外，内置的组件对比功能进一步简化了调试与测试流程。凭借在 NeurIPS 2023 上的亮相及持续的迭代更新，Pearl 正成为连接学术创新与工业级应用的重要桥梁，让用户能更轻松地打造状态一流的强化学习解决方案。","![alt](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_Pearl_readme_c3e35d55af38.png)\n# Pearl - A Production-ready Reinforcement Learning AI Agent Library\n### Proudly brought by Applied Reinforcement Learning @ Meta\n\n- v0.1 - Pearl beta-version is now released! Announcements: [Twitter Post](https:\u002F\u002Fx.com\u002FZheqingZhu\u002Fstatus\u002F1732880717263352149?s=20), [LinkedIn Post](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Fzheqingzhubill_github-facebookresearchpearl-a-production-ready-activity-7138647748102258688-rz-g?utm_source=share&utm_medium=member_desktop)\n  - Highlighted on Meta NeurIPS 2023 Official Website: [Website](https:\u002F\u002Fai.meta.com\u002Fevents\u002Fneurips-2023\u002F)\n  - Highlighted by AI at Meta official handle on Twitter and LinkedIn: [Twitter Post](https:\u002F\u002Fx.com\u002FAIatMeta\u002Fstatus\u002F1734633932975407202?s=20), [LinkedIn Post](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Faiatmeta_neurips2023-activity-7140398603868549120-5T7E?utm_source=share&utm_medium=member_desktop).\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Ffacebookresearch\u002FPearl\u002Fgraph\u002Fbadge.svg?token=CARFOP3E30)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Ffacebookresearch\u002FPearl)\n\nMore details of the library at our [official website](https:\u002F\u002Fpearlagent.github.io).\n\nThe Pearl paper is [available at Arxiv](https:\u002F\u002Fchs6.short.gy\u002Fpearl_paper).\n\nOur NeurIPS 2023 Presentation Slides is released [here](https:\u002F\u002Fpearlagent.github.io\u002Fpearl_detailed_intro.pdf).\n\n## Overview\nPearl is a new production-ready Reinforcement Learning AI agent library open-sourced by the Applied Reinforcement Learning team at Meta. Furthering our efforts on open AI innovation, Pearl enables researchers and practitioners to develop Reinforcement Learning AI agents. These AI agents prioritize cumulative long-term feedback over immediate feedback and can adapt to environments with limited observability, sparse feedback, and high stochasticity. We hope that Pearl offers the community a means to build state-of-the-art Reinforcement Learning AI agents that can adapt to a wide range of complex production environments.\n\n## News\n\n### January 22, 2025 - Pearl components serialization\nPearl components can now produce state dicts just like PyTorch modules, and these state dicts can be saved and loaded with `torch.save` and `torch.load`!\n\nHere's a basic example:\n```python\nagent = PearlAgent(...)\n# Save the agent's state dict\ntorch.save(agent.state_dict(), 'agent_state.pth')\n\nagent2 = PearlAgent(...)  # agent2 must have the same structure as agent\n# Load the agent's state dict\nagent2.load_state_dict(torch.load('agent_state.pth'))\n\nassert agent2.compare(agent) == \"\"  # `compare` is a newly introduced method\n```\nNote that this works for subcomponents as well, such as `PolicyLearner`, `ExplorationModule`, etc.\n\nIf your component has attributes that are not parameters, buffers, or sub-modules, they are not included automatically in the state dict.\nIn those cases, (just like in PyTorch) define methods `get_extra_state` and `set_extra_state` for including such attributes in the state dict\n(see, for example, [`ActorCriticBase.get_extra_state`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fblob\u002F01c16fd482ade4e6c5d3bc7a83f3c7065f9afa8d\u002Fpearl\u002Fpolicy_learners\u002Fsequential_decision_making\u002Factor_critic_base.py#L415)).\n\nWhen defining your own components, you must now define a `compare` method which returns a string listing the differences between two components\n(see, for example, [`PearlAgent.compare`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fblob\u002F01c16fd482ade4e6c5d3bc7a83f3c7065f9afa8d\u002Fpearl\u002Fpearl_agent.py#L286)).\nThis method serves as a general comparison method for testing purposes.\n\n## Getting Started\n\n### Installation\nTo install Pearl, you can simply clone this repository and run `pip install -e .` (you need `pip` version ≥ 21.3 and `setuptools` version ≥ 64):\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl.git\ncd Pearl\npip install -e .\n```\n\n### Quick Start\nTo kick off a Pearl agent with a classic reinforcement learning environment, here's a quick example.\n```py\nfrom pearl.pearl_agent import PearlAgent\nfrom pearl.action_representation_modules.one_hot_action_representation_module import (\n    OneHotActionTensorRepresentationModule,\n)\nfrom pearl.policy_learners.sequential_decision_making.deep_q_learning import (\n    DeepQLearning,\n)\nfrom pearl.replay_buffers import (\n    BasicReplayBuffer,\n)\nfrom pearl.utils.instantiations.environments.gym_environment import GymEnvironment\n\nenv = GymEnvironment(\"CartPole-v1\")\n\nnum_actions = env.action_space.n\nagent = PearlAgent(\n    policy_learner=DeepQLearning(\n        state_dim=env.observation_space.shape[0],\n        action_space=env.action_space,\n        hidden_dims=[64, 64],\n        training_rounds=20,\n        action_representation_module=OneHotActionTensorRepresentationModule(\n            max_number_actions=num_actions\n        ),\n    ),\n    replay_buffer=BasicReplayBuffer(10_000),\n)\n\nobservation, action_space = env.reset()\nagent.reset(observation, action_space)\ndone = False\nwhile not done:\n    action = agent.act(exploit=False)\n    action_result = env.step(action)\n    agent.observe(action_result)\n    agent.learn()\n    done = action_result.done\n```\nUsers can replace the environment with any real-world problems.\n\n## Tutorials\n\nWe provide a few tutorial Jupyter notebooks (and are currently working on more!):\n\n1. [A single item recommender system](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Fsingle_item_recommender_system_example\u002Fsingle_item_recommender_system.ipynb). We derived a small contrived recommender system environment using the MIND dataset (Wu et al. 2020).\n\n2. [Contextual bandits](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Fcontextual_bandits\u002Fcontextual_bandits_tutorial.ipynb). Demonstrates contextual bandit algorithms and their implementation using Pearl using a contextual bandit environment for providing data from UCI datasets, and tested the performance of neural implementations of SquareCB, LinUCB, and LinTS.\n\n3. [Frozen Lake](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Ffrozen_lake\u002Ffrozen_lake.ipynb). A simple example showing how to use a one-hot observation wrapper to learn the classic problem with DQN.\n\n4. [Deep Q-Learning (DQN) and Double DQN](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Fsequential_decision_making\u002FDQN_and_DoubleDQN_example.ipynb). Demonstrates how to run DQN and Double DQN on the Cart-Pole environment.\n\n5. [Actor-critic algorithms with safety constraints](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Factor_critic_and_rc_safety_module\u002Factor_critic_and_safe_actor_critic.ipynb). Demonstrates how to run Actor Critic methods, including a version with safe constraints.\n\n\n## Design and Features\n![alt](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_Pearl_readme_43337713e756.png)\nPearl was built with a modular design so that industry practitioners or academic researchers can select any subset and flexibly combine features below to construct a Pearl agent customized for their specific use cases. Pearl offers a diverse set of unique features for production environments, including dynamic action spaces, offline learning, intelligent neural exploration, safe decision making, history summarization, and data augmentation.\n\nYou can find many Pearl agent candidates with mix-and-match set of reinforcement learning features in utils\u002Fscripts\u002Fbenchmark_config.py\n\n## Adoption in Real-world Applications\nPearl is in progress supporting real-world applications, including recommender systems, auction bidding systems and creative selection. Each of them requires a subset of features offered by Pearl. To visualize the subset of features used by each of the applications above, see the table below.\n\u003Ccenter>\n\n|Pearl Features | Recommender Systems | Auction Bidding | Creative Selection |\n|:-------------:|:-------------------:|:---------------:|:------------------:|\n|Policy Learning| ✅ |✅|✅|\n|Intelligent Exploration|✅|✅ |✅|\n|Safety| | ✅ | |\n|History Summarization| | ✅ | |\n|Replay Buffer| ✅ |✅ |✅ |\n|Contextual Bandit| | |✅|\n|Offline RL|✅|✅||\n|Dynamic Action Space|✅||✅|\n|Large-scale Neural Network|✅|||\n\n\u003C\u002Fcenter>\n\n## Comparison to Other Libraries\n\u003Ccenter>\n\n|Pearl Features | Pearl  | ReAgent (Superseded by Pearl) | RLLib | SB3|Tianshou | Dopamine |\n|:-------------:|:------:|:-----------------------------:|:-----:|:--:|:-----:|:----:|\n|Agent Modularity|✅|❌|❌|❌|❌|❌|\n|Dynamic Action Space|✅|✅|❌|❌|❌|❌|\n|Offline RL|✅|✅|✅|✅|✅|❌|\n|Intelligent Exploration|✅|❌|❌|❌|⚪ (limited support)|❌|\n|Contextual Bandit|✅|✅|⚪ (only linear support)|❌|❌|❌|\n|Safe Decision Making|✅|❌|❌|❌|❌|❌|\n|History Summarization|✅|❌|✅|❌|⚪ (requires modifying environment state)|❌|\n|Data Augmented Replay Buffer|✅|❌|✅|✅|✅|❌|\n\n\u003C\u002Fcenter>\n\n## Cite Us\n```\n@article{pearl2023paper,\n    title = {Pearl: A Production-ready Reinforcement Learning Agent},\n    author = {Zheqing Zhu, Rodrigo de Salvo Braz, Jalaj Bhandari, Daniel Jiang, Yi Wan, Yonathan Efroni, Ruiyang Xu, Liyuan Wang, Hongbo Guo, Alex Nikulkov, Dmytro Korenkevych, Urun Dogan, Frank Cheng, Zheng Wu, Wanqiao Xu},\n    eprint = {arXiv preprint arXiv:2312.03814},\n    year = {2023}\n}\n```\n\n## License\nPearl is MIT licensed, as found in the LICENSE file.\n","![alt](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_Pearl_readme_c3e35d55af38.png)\n# Pearl - 一款面向生产的强化学习智能体库\n### 由 Meta 应用强化学习团队倾力打造\n\n- v0.1 - Pearl 测试版现已发布！相关公告：[Twitter 帖子](https:\u002F\u002Fx.com\u002FZheqingZhu\u002Fstatus\u002F1732880717263352149?s=20)、[LinkedIn 帖子](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Fzheqingzhubill_github-facebookresearchpearl-a-production-ready-activity-7138647748102258688-rz-g?utm_source=share&utm_medium=member_desktop)\n  - 在 Meta NeurIPS 2023 官方网站上被重点推荐：[官网](https:\u002F\u002Fai.meta.com\u002Fevents\u002Fneurips-2023\u002F)\n  - Meta 官方账号在 Twitter 和 LinkedIn 上也进行了重点推介：[Twitter 帖子](https:\u002F\u002Fx.com\u002FAIatMeta\u002Fstatus\u002F1734633932975407202?s=20)、[LinkedIn 帖子](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Faiatmeta_neurips2023-activity-7140398603868549120-5T7E?utm_source=share&utm_medium=member_desktop)。\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![codecov](https:\u002F\u002Fcodecov.io\u002Fgh\u002Ffacebookresearch\u002FPearl\u002Fgraph\u002Fbadge.svg?token=CARFOP3E30)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Ffacebookresearch\u002FPearl)\n\n更多关于该库的详细信息，请访问我们的[官方网站](https:\u002F\u002Fpearlagent.github.io)。\n\nPearl 论文已在 [Arxiv](https:\u002F\u002Fchs6.short.gy\u002Fpearl_paper) 上公开。\n\n我们 NeurIPS 2023 的演示文稿已在此发布：[这里](https:\u002F\u002Fpearlagent.github.io\u002Fpearl_detailed_intro.pdf)。\n\n## 概述\nPearl 是由 Meta 应用强化学习团队开源的一款全新的生产级强化学习智能体库。作为我们在开放人工智能创新方面努力的延续，Pearl 使研究人员和从业者能够开发强化学习智能体。这些智能体更注重长期累积反馈而非即时反馈，并且能够适应观测性有限、反馈稀疏且高度随机的环境。我们希望 Pearl 能为社区提供一种构建先进强化学习智能体的工具，使其能够适应各种复杂的生产环境。\n\n## 新闻\n\n### 2025年1月22日 - Pearl 组件序列化\nPearl 组件现在可以像 PyTorch 模块一样生成状态字典，这些状态字典可以使用 `torch.save` 和 `torch.load` 进行保存和加载！\n\n以下是一个基本示例：\n```python\nagent = PearlAgent(...)\n# 保存智能体的状态字典\ntorch.save(agent.state_dict(), 'agent_state.pth')\n\nagent2 = PearlAgent(...)  # agent2 必须与 agent 具有相同的结构\n# 加载智能体的状态字典\nagent2.load_state_dict(torch.load('agent_state.pth'))\n\nassert agent2.compare(agent) == \"\"  # `compare` 是新引入的方法\n```\n请注意，这同样适用于子组件，例如 `PolicyLearner`、`ExplorationModule` 等。\n\n如果您的组件包含非参数、非缓冲区或非子模块的属性，则这些属性不会自动包含在状态字典中。\n在这种情况下，（就像在 PyTorch 中一样）需要定义 `get_extra_state` 和 `set_extra_state` 方法，以便将这些属性纳入状态字典中。\n（例如，参见 [`ActorCriticBase.get_extra_state`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fblob\u002F01c16fd482ade4e6c5d3bc7a83f3c7065f9afa8d\u002Fpearl\u002Fpolicy_learners\u002Fsequential_decision_making\u002Factor_critic_base.py#L415)）。\n\n在定义您自己的组件时，现在必须实现一个 `compare` 方法，该方法会返回一个字符串，列出两个组件之间的差异。\n（例如，参见 [`PearlAgent.compare`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fblob\u002F01c16fd482ade4e6c5d3bc7a83f3c7065f9afa8d\u002Fpearl\u002Fpearl_agent.py#L286)）。\n此方法可用作通用的比较方法，以供测试之用。\n\n## 开始使用\n\n### 安装\n要安装 Pearl，只需克隆本仓库并运行 `pip install -e .` 即可（需使用 ≥ 21.3 版本的 `pip` 和 ≥ 64 版本的 `setuptools`）：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl.git\ncd Pearl\npip install -e .\n```\n\n### 快速入门\n要启动一个使用经典强化学习环境的 Pearl 智能体，以下是一个快速示例。\n```py\nfrom pearl.pearl_agent import PearlAgent\nfrom pearl.action_representation_modules.one_hot_action_representation_module import (\n    OneHotActionTensorRepresentationModule,\n)\nfrom pearl.policy_learners.sequential_decision_making.deep_q_learning import (\n    DeepQLearning,\n)\nfrom pearl.replay_buffers import (\n    BasicReplayBuffer,\n)\nfrom pearl.utils.instantiations.environments.gym_environment import GymEnvironment\n\nenv = GymEnvironment(\"CartPole-v1\")\n\nnum_actions = env.action_space.n\nagent = PearlAgent(\n    policy_learner=DeepQLearning(\n        state_dim=env.observation_space.shape[0],\n        action_space=env.action_space,\n        hidden_dims=[64, 64],\n        training_rounds=20,\n        action_representation_module=OneHotActionTensorRepresentationModule(\n            max_number_actions=num_actions\n        ),\n    ),\n    replay_buffer=BasicReplayBuffer(10_000),\n)\n\nobservation, action_space = env.reset()\nagent.reset(observation, action_space)\ndone = False\nwhile not done:\n    action = agent.act(exploit=False)\n    action_result = env.step(action)\n    agent.observe(action_result)\n    agent.learn()\n    done = action_result.done\n```\n用户可以用任何实际问题替换环境。\n\n## 教程\n\n我们提供了一些 Jupyter 笔记本教程（并且目前正在制作更多！）：\n\n1. [单件商品推荐系统](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Fsingle_item_recommender_system_example\u002Fsingle_item_recommender_system.ipynb)。我们基于 MIND 数据集（Wu et al. 2020）构建了一个小型虚构的推荐系统环境。\n\n2. [上下文 bandit](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Fcontextual_bandits\u002Fcontextual_bandits_tutorial.ipynb)。展示了上下文 bandit 算法及其在 Pearl 中的实现，使用来自 UCI 数据集的上下文 bandit 环境，并测试了 SquareCB、LinUCB 和 LinTS 的神经网络实现性能。\n\n3. [冰冻湖泊](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Ffrozen_lake\u002Ffrozen_lake.ipynb)。一个简单的示例，说明如何使用 one-hot 观测包装器来学习经典的 DQN 问题。\n\n4. [深度 Q 学习 (DQN) 和双 DQN](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Fsequential_decision_making\u002FDQN_and_DoubleDQN_example.ipynb)。演示如何在 Cart-Pole 环境上运行 DQN 和双 DQN。\n\n5. [带有安全约束的演员-评论家算法](https:\u002F\u002Fnbviewer.org\u002Fgithub\u002Ffacebookresearch\u002FPearl\u002Fblob\u002Fmain\u002Ftutorials\u002Factor_critic_and_rc_safety_module\u002Factor_critic_and_safe_actor_critic.ipynb)。演示如何运行演员-评论家方法，包括带有安全约束的版本。\n\n## 设计与特性\n![alt](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_Pearl_readme_43337713e756.png)\nPearl 采用模块化设计，因此行业从业者或学术研究人员可以自由选择任意子集，并灵活组合以下功能，以构建专为特定用例定制的 Pearl 智能体。Pearl 为生产环境提供了一系列独特的功能，包括动态动作空间、离线学习、智能神经探索、安全决策、历史摘要和数据增强。\n\n您可以在 utils\u002Fscripts\u002Fbenchmark_config.py 中找到许多通过混合搭配强化学习功能而生成的 Pearl 智能体候选方案。\n\n## 在真实场景中的应用\nPearl 目前正逐步支持各类实际应用场景，包括推荐系统、拍卖竞价系统和创意内容筛选等。这些场景各自需要 Pearl 提供的部分功能。下表展示了上述各应用所使用的功能子集：\n\n\u003Ccenter>\n\n|Pearl 功能 | 推荐系统 | 拍卖竞价 | 创意内容筛选 |\n|:-------------:|:-------------------:|:---------------:|:------------------:|\n|策略学习| ✅ |✅|✅|\n|智能探索|✅|✅ |✅|\n|安全性| | ✅ | |\n|历史摘要| | ✅ | |\n|回放缓冲区| ✅ |✅ |✅ |\n|上下文 bandit| | |✅|\n|离线强化学习|✅|✅||\n|动态动作空间|✅||✅|\n|大规模神经网络|✅|||\n\n\u003C\u002Fcenter>\n\n## 与其他库的对比\n\u003Ccenter>\n\n|Pearl 功能 | Pearl  | ReAgent（已被 Pearl 取代） | RLLib | SB3|天授 | 多巴胺 |\n|:-------------:|:------:|:-----------------------------:|:-----:|:--:|:-----:|:----:|\n|智能体模块化|✅|❌|❌|❌|❌|❌|\n|动态动作空间|✅|✅|❌|❌|❌|❌|\n|离线强化学习|✅|✅|✅|✅|✅|❌|\n|智能探索|✅|❌|❌|❌|⚪（有限支持）|❌|\n|上下文 bandit|✅|✅|⚪（仅支持线性模型）|❌|❌|❌|\n|安全决策|✅|❌|❌|❌|❌|❌|\n|历史摘要|✅|❌|✅|❌|⚪（需修改环境状态）|❌|\n|数据增强型回放缓冲区|✅|❌|✅|✅|✅|❌|\n\n\u003C\u002Fcenter>\n\n## 引用我们\n```\n@article{pearl2023paper,\n    title = {Pearl: 一款适用于生产环境的强化学习智能体},\n    author = {朱哲青、罗德里戈·德·萨尔沃·布拉兹、贾拉吉·班达里、丹尼尔·江、万毅、约纳坦·埃夫罗尼、许睿阳、王丽媛、郭洪波、亚历克斯·尼库尔科夫、德米特罗·科伦凯维奇、乌润·多甘、弗兰克·程、吴铮、徐万乔},\n    eprint = {arXiv 预印本 arXiv:2312.03814},\n    year = {2023}\n}\n```\n\n## 许可证\nPearl 采用 MIT 许可证，详情请参阅 LICENSE 文件。","# Pearl 快速上手指南\n\nPearl 是由 Meta 应用强化学习团队开源的生产级强化学习智能体库。它专为复杂生产环境设计，支持动态动作空间、离线学习、安全决策及历史状态摘要等高级特性，帮助开发者构建适应稀疏反馈和高随机性环境的 AI 智能体。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux 或 macOS（Windows 用户建议使用 WSL2）。\n*   **Python 版本**：推荐 Python 3.8 及以上版本。\n*   **依赖工具**：\n    *   `pip` 版本 ≥ 21.3\n    *   `setuptools` 版本 ≥ 64\n*   **前置知识**：熟悉 PyTorch 基础及强化学习基本概念（如 Agent, Environment, Replay Buffer）。\n\n> **提示**：国内用户建议在安装 Python 依赖时使用清华或阿里镜像源，以加速下载过程。\n\n## 安装步骤\n\n通过克隆 GitHub 仓库并以可编辑模式安装是最推荐的安装方式，便于后续开发和调试。\n\n1.  **克隆仓库**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl.git\n    cd Pearl\n    ```\n\n2.  **执行安装**\n    使用 pip 进行本地安装（国内用户可添加 `-i` 参数指定镜像源）：\n    ```bash\n    # 标准安装命令\n    pip install -e .\n\n    # 国内加速安装示例（使用清华源）\n    # pip install -e . -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n\n## 基本使用\n\n以下是一个基于经典 `CartPole-v1` 环境的快速启动示例，展示了如何初始化环境、构建 DQN 智能体并进行训练循环。\n\n```py\nfrom pearl.pearl_agent import PearlAgent\nfrom pearl.action_representation_modules.one_hot_action_representation_module import (\n    OneHotActionTensorRepresentationModule,\n)\nfrom pearl.policy_learners.sequential_decision_making.deep_q_learning import (\n    DeepQLearning,\n)\nfrom pearl.replay_buffers import (\n    BasicReplayBuffer,\n)\nfrom pearl.utils.instantiations.environments.gym_environment import GymEnvironment\n\n# 1. 初始化环境\nenv = GymEnvironment(\"CartPole-v1\")\n\nnum_actions = env.action_space.n\n\n# 2. 构建 Pearl 智能体\nagent = PearlAgent(\n    policy_learner=DeepQLearning(\n        state_dim=env.observation_space.shape[0],\n        action_space=env.action_space,\n        hidden_dims=[64, 64],\n        training_rounds=20,\n        action_representation_module=OneHotActionTensorRepresentationModule(\n            max_number_actions=num_actions\n        ),\n    ),\n    replay_buffer=BasicReplayBuffer(10_000),\n)\n\n# 3. 重置环境与智能体\nobservation, action_space = env.reset()\nagent.reset(observation, action_space)\n\ndone = False\n# 4. 运行交互循环\nwhile not done:\n    # 选择动作 (exploit=False 表示包含探索)\n    action = agent.act(exploit=False)\n    \n    # 环境步进\n    action_result = env.step(action)\n    \n    # 观察结果并学习\n    agent.observe(action_result)\n    agent.learn()\n    \n    done = action_result.done\n```\n\n**说明**：\n*   该示例使用了 `DeepQLearning` 策略和 `BasicReplayBuffer`。\n*   您可以轻松替换 `policy_learner` 或 `environment` 以适应具体的业务场景（如推荐系统、竞价系统等）。\n*   Pearl 的模块化设计允许您灵活组合不同的组件（如安全约束模块、上下文多臂老虎机算法等）。","某大型电商平台的推荐算法团队正在构建一个能够根据用户长期行为动态调整策略的智能导购 Agent，以应对复杂的用户交互环境。\n\n### 没有 Pearl 时\n- **短视决策严重**：传统模型过度优化即时点击率，导致频繁推送低质内容，损害了用户的长期留存和生命周期价值。\n- **环境适应性差**：面对用户行为数据稀疏、反馈延迟高以及市场波动大等随机性强的场景，自研算法难以收敛，训练极不稳定。\n- **工程落地困难**：从实验原型到生产部署需要重写大量代码，缺乏标准化的组件接口，导致状态保存、模型加载和版本对比耗时耗力。\n- **可观测性不足**：在部分用户行为无法完全捕捉（有限可观测）的情况下，代理容易陷入局部最优，无法做出全局最优的序列决策。\n\n### 使用 Pearl 后\n- **长周期回报优先**：Pearl 内置的强化学习机制专注于累积长期反馈，使 Agent 能牺牲短期小利以换取用户长期的活跃度和满意度提升。\n- **鲁棒性强**：专为高随机性、稀疏反馈及有限可观测环境设计，Agent 能在数据噪声大的生产环境中快速适应并保持策略稳定。\n- **生产级就绪**：利用 Pearl 类似 PyTorch 的状态字典序列化功能，团队可轻松实现断点续训、模型热更新及自动化测试对比，大幅缩短上线周期。\n- **序列决策优化**：通过先进的序贯决策模块，Agent 能有效处理复杂的多步交互逻辑，在信息不全时依然能推导出最优行动路径。\n\nPearl 将学术界前沿的强化学习成果转化为生产级利器，帮助企业在复杂多变的业务场景中构建出真正具备长远眼光的智能代理。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ffacebookresearch_Pearl_a742cf7e.png","facebookresearch","Meta Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ffacebookresearch_449342bd.png","",null,"https:\u002F\u002Fopensource.fb.com","https:\u002F\u002Fgithub.com\u002Ffacebookresearch",[80,84],{"name":81,"color":82,"percentage":83},"Jupyter Notebook","#DA5B0B",54.4,{"name":85,"color":86,"percentage":87},"Python","#3572A5",45.6,2988,197,"2026-04-10T19:17:04","MIT","未说明",{"notes":94,"python":95,"dependencies":96},"README 中未详细列出具体的操作系统、GPU 型号、显存大小、内存需求及具体的 Python 版本号。安装仅需克隆仓库并运行 'pip install -e .'。该库基于 PyTorch 构建（支持 state_dict 保存\u002F加载），并包含 Gym 环境示例。","未明确指定版本，但需 pip >= 21.3 和 setuptools >= 64",[97,98],"torch (通过 state_dict 序列化推断)","gym (通过 GymEnvironment 示例推断)",[14,13],"2026-03-27T02:49:30.150509","2026-04-11T23:23:13.958798",[103,108,113,118,123,128],{"id":104,"question_zh":105,"answer_zh":106,"source_url":107},30007,"遇到 CUDA 显存不足（Out of Memory）错误怎么办？","显存持续增加通常与动作空间（action space）过大有关。如果更新版本后问题依旧，请尝试减小动作空间的规模。在之前的版本中，用户通过减少动作空间成功解决了该问题。目前暂无自动清理不再需要的张量的特定方法，主要需优化模型输入规模。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fissues\u002F72",{"id":109,"question_zh":110,"answer_zh":111,"source_url":112},30008,"为什么无法在 TensorBoard 中查看 TD3 算法的损失值（loss values）？","这通常是因为使用了旧版本的 Pearl 代码，导致与新版本的函数名不匹配（例如 `_critic_loss` 被重命名为 `_critic_learn_batch`）。解决方法是：1. 更新本地仓库到最新版本；2. 如果无法更新，需手动在当前版本代码中插入 `report` 设置以修复损失值记录功能。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fissues\u002F69",{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},30009,"如何保存训练好的代理（Agent）以便后续复用？","Pearl 现已支持组件序列化功能。您可以参考项目主页关于 \"Pearl Components Serialization\" 的公告（2025 年 1 月 22 日更新），其中包含了保存和加载训练好代理的具体方法和教程。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fissues\u002F74",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},30010,"如果离线学习的数据不是由均匀策略（uniform policy）收集的，该如何评估策略？","在没有其他假设的情况下，评估离线学习策略性能的正确方法是使用“贪婪”动作（greedy action）。在离线学习场景中，`exploration_module` 仅影响 `agent.act()` 过程中的探索行为。为了评估相对于学习到的奖励模型的最佳表现，应设置 `NoExploration()`，这意味着代理将采取相对于学习到的奖励函数的贪婪动作，而不是在评估时进行探索。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fissues\u002F65",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},30011,"在哪里可以找到 Pearl 的实际应用示例或教程？","项目已发布首个推荐系统环境的教程，请访问 GitHub 仓库首页的 \"Tutorials\" 部分。此外，NeurIPS 演示幻灯片也已共享。更多基于 Gymnasium 等环境的示例（如 DeepQ 训练、保存及演示运行）将在后续陆续更新。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fissues\u002F14",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},30012,"在完全可观察的环境（如 Pendulum）中使用 LSTM 历史摘要模块为何表现不佳？","在完全可观察的环境中，LSTM 历史摘要模块可能并非最佳选择，实验显示其回报值（return）显著低于不使用该模块的情况（例如 DDPG 在 Pendulum 环境中回报值仍为负一千多，而正常情况应收敛至 -250 左右）。对于此类环境，建议移除 LSTM 模块直接使用标准算法，因为完全可观察状态本身已包含足够信息，无需额外的历史序列建模。","https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002FPearl\u002Fissues\u002F47",[]]