Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Microsoft Research's agent training framework. Optimizes AI agents with Reinforcement Learning, Automatic Prompt Optimization, and Supervised Fine-tuning. Ze...
Microsoft Research's agent training framework. Optimizes AI agents with Reinforcement Learning, Automatic Prompt Optimization, and Supervised Fine-tuning. Ze...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
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.
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.
Microsoft Research's agent training framework. Turn your AI agents into optimizable beasts with (almost) zero code changes.
๐ Universal Compatibility: Works with LangChain, OpenAI Agent SDK, AutoGen, CrewAI, Microsoft Agent Framework, or plain Python OpenAI ๐ฏ Selective Optimization: Optimize one or more agents in a multi-agent system ๐ง Multiple Algorithms: Reinforcement Learning (RL), Automatic Prompt Optimization (APO), Supervised Fine-tuning (SFT) โก Zero Code Change: Add agl.emit_xxx() helpers or use tracer โ your agent keeps running as usual
pip install agentlightning For latest nightly build: pip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --pre agentlightning
Option A: Add emit helpers (recommended) import agentlightning as agl # In your agent's tool calls response = agl.emit_tool_call( model=model, messages=messages, tools=tools, context={"task": "search"} ) Option B: Use tracer (zero code change) from agentlightning import tracer # Wrap your agent with tracer with tracer.trace("my-agent", input_data): result = your_agent.run(user_query)
# config.yaml agent: name: "my-agent" type: "openai" # openai, langchain, autogen, crewai training: algorithm: "grpo" # grpo, apo, sft, rloo episodes: 100 batch_size: 16 environment: eval_tasks: - "math" - "coding" - "reasoning"
agent-lightning train --config config.yaml
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
Train your agent with configured algorithm.
Evaluate agent on benchmark tasks.
Export trained model/prompts for deployment.
Launch serving endpoint for trained agent.
See full example: Train SQL Agent with RL from agentlightning import Agent, RLConfig, GRPOTrainer # 1. Define your agent sql_agent = Agent( name="sql-agent", system_prompt="You are a SQL expert...", tools=[execute_sql, query_schema] ) # 2. Configure RL training config = RLConfig( algorithm="grpo", episodes=500, learning_rate=1e-4 ) # 3. Train trainer = GRPOTrainer(config=config) trainer.train(sql_agent, eval_tasks=["sql-generation"])
# Required for training export OPENAI_API_KEY="sk-..." # Optional: for remote storage export AGL_STORAGE="s3://my-bucket/agent-lightning/"
from agentlightning import LightningStore, GRPOTrainer # LightningStore keeps tasks, resources, and traces in sync store = LightningStore() # Read traces, learn, and update prompts trainer = GRPOTrainer(store=store) trainer.train(agent=my_agent)
# Launch dashboard agent-lightning dashboard --port 8080 # View logs tail -f ~/.agent-lightning/logs/training.log
Start Small: Begin with 10-50 episodes to verify setup Define Clear Rewards: Design reward functions that match your goal Use Evaluation Tasks: Always eval on held-out tasks Checkpoint Frequently: Save model every N episodes Monitor Convergence: Watch loss curves in dashboard
Documentation Examples API Reference ArXiv Paper Discord Community
If you use Agent Lightning in research: @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} }
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.