Files
microsoft--agent-lightning/README.md
T
wehub-resource-sync 0ca394426f
Dashboard / Chromatic (push) Has been cancelled
Deploy Documentation / deploy (push) Has been cancelled
CPU Test / Lint - fast (push) Has been cancelled
CPU Test / Lint - next (push) Has been cancelled
CPU Test / Lint - slow (push) Has been cancelled
CPU Test / Lint - JavaScript (push) Has been cancelled
CPU Test / Build documentation (push) Has been cancelled
CPU Test / Test (AgentOps, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (LLM proxy, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (Others, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (Store, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (Utilities, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (Weave, legacy, Python 3.10) (push) Has been cancelled
CPU Test / Test (AgentOps, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (LLM proxy, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Others, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Others, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (Store, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (Utilities, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (Weave, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (Store, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Utilities, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (Weave, stable, Python 3.11) (push) Has been cancelled
CPU Test / Test (AgentOps, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (LLM proxy, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Others, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Store, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Utilities, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (Weave, stable, Python 3.12) (push) Has been cancelled
CPU Test / Test (AgentOps, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (LLM proxy, latest, Python 3.13) (push) Has been cancelled
CPU Test / Test (JavaScript) (push) Has been cancelled
docs: make Chinese README the default
2026-07-13 10:42:17 +00:00

10 KiB
Raw Blame History

Note

本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
English · 原始项目 · 上游 README
原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。

Agent-lightning-banner

Agent Lightning

Unit Tests Documentation PyPI version License Ask DeepWiki Discord

点亮 AI 智能体的终极训练器。

加入我们的 Discord 社区,与其他用户和贡献者交流。

核心特性

  • 让你的智能体在几乎 零代码改动(ZERO CODE CHANGE 的情况下变成可优化的强者!💤
  • 支持使用 任意(ANY 智能体框架(LangChain、OpenAI Agent SDK、AutoGen、CrewAI、Microsoft Agent Framework...)构建;甚至无需智能体框架(Python OpenAI)也能用。随心所欲!🤖
  • 在多智能体系统中 选择性(Selectively 优化一个或多个智能体。🎯
  • 支持 强化学习(Reinforcement Learning、自动提示词优化(Automatic Prompt Optimization)、监督微调(Supervised Fine-tuning)等多种 算法(Algorithms🤗

更多内容请参阅我们的文档网站.

Agent-Lightning Core Quickstart

安装

pip install agentlightning

如需最新每夜构建版本(前沿功能),可从 Test PyPI 安装:

pip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --pre agentlightning

更多细节请参阅我们的安装指南

要开始使用 Agent-lightning,请查看我们的文档示例

文章

社区项目

架构

Agent Lightning 将运行组件精简到最少,让你专注于创意本身,而非底层 plumbing。你的智能体照常运行;你仍可选用任意智能体框架;只需接入轻量级的 agl.emit_xxx() 辅助工具,或让 tracer 采集每一次 prompt、工具调用与 reward。这些事件会成为结构化 span,流入 LightningStore——一个集中式枢纽,负责同步任务、资源与 trace。

Store 的另一端是你选择或自行编写的算法。算法读取 span、从中学习,并发布更新后的资源,例如优化后的 prompt 模板或新的 policy 权重。Trainer 将所有环节串联起来:向 runner 流式传输数据集,在 store 与算法之间传递资源,并在改进生效时更新推理引擎。你可以在此止步,也可以让同一循环持续运转。

无需重写、无需绑定,从首次 rollout 到持续改进,路径清晰明了。

Agent-lightning Architecture

CI 状态

工作流 状态
CPU 测试 tests workflow status
完整测试 tests summary workflow status
UI 测试 UI Tests
示例集成 examples summary workflow status
最新依赖兼容性 latest summary workflow status
旧版示例兼容性 compat summary workflow status

引用

如果你在研究或项目中觉得 Agent Lightning 有帮助,请引用我们的论文:

@misc{luo2025agentlightningtrainai,
      title={Agent Lightning: Train ANY AI Agents with Reinforcement Learning},
      author={Xufang Luo and Yuge Zhang and Zhiyuan He and Zilong Wang and Siyun Zhao and Dongsheng Li and Luna K. Qiu and Yuqing Yang},
      year={2025},
      eprint={2508.03680},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2508.03680},
}

贡献

本项目欢迎贡献与建议。请先阅读贡献指南,了解推荐的贡献切入点、环境配置、分支约定与 Pull Request 要求。多数贡献需签署贡献者许可协议(Contributor License AgreementCLA),声明你有权且确实授予我们使用你贡献的权利。详情请访问 https://cla.opensource.microsoft.com.

当你提交拉取请求(pull request)时,CLA 机器人会自动判断你是否需要提供 CLAContributor License Agreement,贡献者许可协议),并会以合适的方式标注该 PR(例如状态检查、评论)。只需按照机器人提供的说明操作即可。在使用我们 CLA 的所有仓库中,你只需完成一次此流程。

本项目已采用 Microsoft Open Source Code of Conduct. 了解更多信息,请参阅 Code of Conduct FAQ 或通过 opencode@microsoft.com 联系我们,提出任何其他问题或意见。

商标

本项目可能包含项目、产品或服务的商标或标识。Microsoft 商标或标识的授权使用须遵守并遵循 Microsoft's Trademark & Brand Guidelines. 在本项目的修改版本中使用 Microsoft 商标或标识,不得造成混淆或暗示 Microsoft 的赞助。任何第三方商标或标识的使用均须遵守该第三方的相关政策。

负责任 AIResponsible AI

本项目已经过评估和认证,符合 Microsoft Responsible AI Standard(微软负责任 AI 标准)。团队将持续监控和维护该仓库,并在出现任何严重问题(包括潜在危害)时予以处理。

许可证

本项目采用 MIT License 许可。详情请参阅 LICENSE 文件。