Skip to content

OpenHands/software-agent-sdk

Repository files navigation

Logo

OpenHands Software Agent SDK

The OpenHands SDK allows you to build applications with agents that write software. This SDK also powers OpenHands, an all-batteries-included coding agent that you can access through a GUI, CLI, or API.

Features

  • Single Python API: Unified interface for building coding agents with minimal boilerplate
  • Pre-defined Tools: Built-in tools for bash commands, file editing, task tracking, and web browsing
  • REST-based Agent Server: Deploy agents as scalable web services with WebSocket support for real-time interactions

Why OpenHands Agent SDK?

  • Emphasis on coding: Purpose-built for software development tasks with specialized tools and workflows
  • State-of-the-Art Performance: Powered by advanced LLMs and optimized for real-world coding scenarios
  • Free and Open Source: MIT licensed with an active community and transparent development

Quick Start

Here's what building with the SDK looks like:

from openhands.sdk import LLM, Conversation
from openhands.tools.preset.default import get_default_agent

# Configure LLM and create agent
llm = LLM(model="openhands/claude-sonnet-4-5-20250929", api_key='...')
agent = get_default_agent(llm=llm)

# Start a conversation
conversation = Conversation(agent=agent, workspace="/path/to/project")
conversation.send_message("Write 3 facts about this project into FACTS.txt.")
conversation.run()

For installation instructions and detailed setup, see the Getting Started Guide.

Documentation

For detailed documentation, tutorials, and API reference, visit:

https://docs.openhands.dev/sdk

The documentation includes:

Examples

The examples/ directory contains comprehensive usage examples:

  • Standalone SDK (examples/01_standalone_sdk/) - Basic agent usage, custom tools, and microagents
  • Remote Agent Server (examples/02_remote_agent_server/) - Client-server architecture and WebSocket connections
  • GitHub Workflows (examples/03_github_workflows/) - CI/CD integration and automated workflows

Contributing

For development setup, testing, and contribution guidelines, see DEVELOPMENT.md.

Community

Cite

@misc{wang2025openhandssoftwareagentsdk,
      title={The OpenHands Software Agent SDK: A Composable and Extensible Foundation for Production Agents}, 
      author={Xingyao Wang and Simon Rosenberg and Juan Michelini and Calvin Smith and Hoang Tran and Engel Nyst and Rohit Malhotra and Xuhui Zhou and Valerie Chen and Robert Brennan and Graham Neubig},
      year={2025},
      eprint={2511.03690},
      archivePrefix={arXiv},
      primaryClass={cs.SE},
      url={https://arxiv.org/abs/2511.03690}, 
}

About

A clean, modular SDK for building AI agents with OpenHands V1.

Topics

Resources

License

Stars

Watchers

Forks

Packages