{
  "schemaVersion": "1.0",
  "item": {
    "slug": "agent-lightning",
    "name": "Agent Lightning",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/olmmlo-cmd/agent-lightning",
    "canonicalUrl": "https://clawhub.ai/olmmlo-cmd/agent-lightning",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/agent-lightning",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=agent-lightning",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "_meta.json",
      "examples/config.yaml",
      "examples/train_agent.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/agent-lightning"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/agent-lightning",
    "agentPageUrl": "https://openagent3.xyz/skills/agent-lightning/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-lightning/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-lightning/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Agent Lightning ⚡",
        "body": "Microsoft Research's agent training framework. Turn your AI agents into optimizable beasts with (almost) zero code changes."
      },
      {
        "title": "Core Features",
        "body": "🔌 Universal Compatibility: Works with LangChain, OpenAI Agent SDK, AutoGen, CrewAI, Microsoft Agent Framework, or plain Python OpenAI\n🎯 Selective Optimization: Optimize one or more agents in a multi-agent system\n🧠 Multiple Algorithms: Reinforcement Learning (RL), Automatic Prompt Optimization (APO), Supervised Fine-tuning (SFT)\n⚡ Zero Code Change: Add agl.emit_xxx() helpers or use tracer — your agent keeps running as usual"
      },
      {
        "title": "Installation",
        "body": "pip install agentlightning\n\nFor latest nightly build:\n\npip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --pre agentlightning"
      },
      {
        "title": "1. Instrument Your Agent",
        "body": "Option A: Add emit helpers (recommended)\n\nimport agentlightning as agl\n\n# In your agent's tool calls\nresponse = agl.emit_tool_call(\n    model=model,\n    messages=messages,\n    tools=tools,\n    context={\"task\": \"search\"}\n)\n\nOption B: Use tracer (zero code change)\n\nfrom agentlightning import tracer\n\n# Wrap your agent with tracer\nwith tracer.trace(\"my-agent\", input_data):\n    result = your_agent.run(user_query)"
      },
      {
        "title": "2. Create Training Config",
        "body": "# config.yaml\nagent:\n  name: \"my-agent\"\n  type: \"openai\"  # openai, langchain, autogen, crewai\n\ntraining:\n  algorithm: \"grpo\"  # grpo, apo, sft, rloo\n  episodes: 100\n  batch_size: 16\n  \nenvironment:\n  eval_tasks:\n    - \"math\"\n    - \"coding\"\n    - \"reasoning\""
      },
      {
        "title": "3. Run Training",
        "body": "agent-lightning train --config config.yaml"
      },
      {
        "title": "Algorithms",
        "body": "AlgorithmUse CaseDescriptionGRPOGeneral RLGroup Relative Policy Optimization — stable, works well for most agentsAPOPrompt TuningAutomatic Prompt Optimization — improves system promptsSFTSupervised Fine-tuningSupervised Fine-tuning with preference dataRLOOLong-horizonRLOO for tasks with sparse rewards"
      },
      {
        "title": "agent-lightning train",
        "body": "Train your agent with configured algorithm."
      },
      {
        "title": "agent-lightning eval",
        "body": "Evaluate agent on benchmark tasks."
      },
      {
        "title": "agent-lightning export",
        "body": "Export trained model/prompts for deployment."
      },
      {
        "title": "agent-lightning serve",
        "body": "Launch serving endpoint for trained agent."
      },
      {
        "title": "Example: SQL Agent Training",
        "body": "See full example: Train SQL Agent with RL\n\nfrom agentlightning import Agent, RLConfig, GRPOTrainer\n\n# 1. Define your agent\nsql_agent = Agent(\n    name=\"sql-agent\",\n    system_prompt=\"You are a SQL expert...\",\n    tools=[execute_sql, query_schema]\n)\n\n# 2. Configure RL training\nconfig = RLConfig(\n    algorithm=\"grpo\",\n    episodes=500,\n    learning_rate=1e-4\n)\n\n# 3. Train\ntrainer = GRPOTrainer(config=config)\ntrainer.train(sql_agent, eval_tasks=[\"sql-generation\"])"
      },
      {
        "title": "Environment Variables",
        "body": "# Required for training\nexport OPENAI_API_KEY=\"sk-...\"\n\n# Optional: for remote storage\nexport AGL_STORAGE=\"s3://my-bucket/agent-lightning/\""
      },
      {
        "title": "Python API",
        "body": "from agentlightning import LightningStore, GRPOTrainer\n\n# LightningStore keeps tasks, resources, and traces in sync\nstore = LightningStore()\n\n# Read traces, learn, and update prompts\ntrainer = GRPOTrainer(store=store)\ntrainer.train(agent=my_agent)"
      },
      {
        "title": "Monitoring Training",
        "body": "# Launch dashboard\nagent-lightning dashboard --port 8080\n\n# View logs\ntail -f ~/.agent-lightning/logs/training.log"
      },
      {
        "title": "Best Practices",
        "body": "Start Small: Begin with 10-50 episodes to verify setup\nDefine Clear Rewards: Design reward functions that match your goal\nUse Evaluation Tasks: Always eval on held-out tasks\nCheckpoint Frequently: Save model every N episodes\nMonitor Convergence: Watch loss curves in dashboard"
      },
      {
        "title": "Resources",
        "body": "Documentation\nExamples\nAPI Reference\nArXiv Paper\nDiscord Community"
      },
      {
        "title": "Citation",
        "body": "If you use Agent Lightning in research:\n\n@misc{luo2025agentlightningtrainai,\n  title={Agent Lightning: Train ANY AI Agents with Reinforcement Learning},\n  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},\n  year={2025},\n  eprint={2508.03680},\n  archivePrefix={arXiv},\n  primaryClass={cs.AI}\n}"
      }
    ],
    "body": "Agent Lightning ⚡\n\nMicrosoft Research's agent training framework. Turn your AI agents into optimizable beasts with (almost) zero code changes.\n\nCore Features\n🔌 Universal Compatibility: Works with LangChain, OpenAI Agent SDK, AutoGen, CrewAI, Microsoft Agent Framework, or plain Python OpenAI\n🎯 Selective Optimization: Optimize one or more agents in a multi-agent system\n🧠 Multiple Algorithms: Reinforcement Learning (RL), Automatic Prompt Optimization (APO), Supervised Fine-tuning (SFT)\n⚡ Zero Code Change: Add agl.emit_xxx() helpers or use tracer — your agent keeps running as usual\nInstallation\npip install agentlightning\n\n\nFor latest nightly build:\n\npip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --pre agentlightning\n\nQuick Start\n1. Instrument Your Agent\n\nOption A: Add emit helpers (recommended)\n\nimport agentlightning as agl\n\n# In your agent's tool calls\nresponse = agl.emit_tool_call(\n    model=model,\n    messages=messages,\n    tools=tools,\n    context={\"task\": \"search\"}\n)\n\n\nOption B: Use tracer (zero code change)\n\nfrom agentlightning import tracer\n\n# Wrap your agent with tracer\nwith tracer.trace(\"my-agent\", input_data):\n    result = your_agent.run(user_query)\n\n2. Create Training Config\n# config.yaml\nagent:\n  name: \"my-agent\"\n  type: \"openai\"  # openai, langchain, autogen, crewai\n\ntraining:\n  algorithm: \"grpo\"  # grpo, apo, sft, rloo\n  episodes: 100\n  batch_size: 16\n  \nenvironment:\n  eval_tasks:\n    - \"math\"\n    - \"coding\"\n    - \"reasoning\"\n\n3. Run Training\nagent-lightning train --config config.yaml\n\nAlgorithms\nAlgorithm\tUse Case\tDescription\nGRPO\tGeneral RL\tGroup Relative Policy Optimization — stable, works well for most agents\nAPO\tPrompt Tuning\tAutomatic Prompt Optimization — improves system prompts\nSFT\tSupervised Fine-tuning\tSupervised Fine-tuning with preference data\nRLOO\tLong-horizon\tRLOO for tasks with sparse rewards\nUsage Commands\nagent-lightning train\n\nTrain your agent with configured algorithm.\n\nagent-lightning eval\n\nEvaluate agent on benchmark tasks.\n\nagent-lightning export\n\nExport trained model/prompts for deployment.\n\nagent-lightning serve\n\nLaunch serving endpoint for trained agent.\n\nExample: SQL Agent Training\n\nSee full example: Train SQL Agent with RL\n\nfrom agentlightning import Agent, RLConfig, GRPOTrainer\n\n# 1. Define your agent\nsql_agent = Agent(\n    name=\"sql-agent\",\n    system_prompt=\"You are a SQL expert...\",\n    tools=[execute_sql, query_schema]\n)\n\n# 2. Configure RL training\nconfig = RLConfig(\n    algorithm=\"grpo\",\n    episodes=500,\n    learning_rate=1e-4\n)\n\n# 3. Train\ntrainer = GRPOTrainer(config=config)\ntrainer.train(sql_agent, eval_tasks=[\"sql-generation\"])\n\nIntegration with Clawdbot\nEnvironment Variables\n# Required for training\nexport OPENAI_API_KEY=\"sk-...\"\n\n# Optional: for remote storage\nexport AGL_STORAGE=\"s3://my-bucket/agent-lightning/\"\n\nPython API\nfrom agentlightning import LightningStore, GRPOTrainer\n\n# LightningStore keeps tasks, resources, and traces in sync\nstore = LightningStore()\n\n# Read traces, learn, and update prompts\ntrainer = GRPOTrainer(store=store)\ntrainer.train(agent=my_agent)\n\nMonitoring Training\n# Launch dashboard\nagent-lightning dashboard --port 8080\n\n# View logs\ntail -f ~/.agent-lightning/logs/training.log\n\nBest Practices\nStart Small: Begin with 10-50 episodes to verify setup\nDefine Clear Rewards: Design reward functions that match your goal\nUse Evaluation Tasks: Always eval on held-out tasks\nCheckpoint Frequently: Save model every N episodes\nMonitor Convergence: Watch loss curves in dashboard\nResources\nDocumentation\nExamples\nAPI Reference\nArXiv Paper\nDiscord Community\nCitation\n\nIf you use Agent Lightning in research:\n\n@misc{luo2025agentlightningtrainai,\n  title={Agent Lightning: Train ANY AI Agents with Reinforcement Learning},\n  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},\n  year={2025},\n  eprint={2508.03680},\n  archivePrefix={arXiv},\n  primaryClass={cs.AI}\n}"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/olmmlo-cmd/agent-lightning",
    "publisherUrl": "https://clawhub.ai/olmmlo-cmd/agent-lightning",
    "owner": "olmmlo-cmd",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/agent-lightning",
    "downloadUrl": "https://openagent3.xyz/downloads/agent-lightning",
    "agentUrl": "https://openagent3.xyz/skills/agent-lightning/agent",
    "manifestUrl": "https://openagent3.xyz/skills/agent-lightning/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/agent-lightning/agent.md"
  }
}