Skip to main content

Overview

OpenHands Software Agent SDK is a Python SDK for building AI software agents that can work with code. It provides tools for terminal access, file editing, task tracking, and browser automation, enabling agents to perform software development tasks.

What Laminar captures

  • The entire structure of the OpenHands SDK conversation flow, including agent steps and tool calls.
  • LLM prompts and responses sent to the model via LiteLLM.
  • Tool calls (bash, file_editor, task_tracker, etc.) and their results.
  • Latencies, token counts, and token costs.
  • Conversation sessions grouped by their unique conversation ID.
  • Browser session replays when using browser-use tools.

Getting started

1

Install uv package manager

The OpenHands SDK requires the uv package manager (version 0.8.13+):
2

Install the SDK

3

Set up your environment variables

Export your Laminar API key and LLM API key:
4

Run your agent

The OpenHands SDK automatically initializes Laminar when LMNR_PROJECT_API_KEY is set. No additional code is required.
Run with uv:

Automatic instrumentation

The OpenHands SDK automatically instruments the following when Laminar is initialized:
  • Conversations: Each conversation is traced as a session, with the conversation UUID used as the session ID.
  • Agent steps: Each agent.step iteration is captured as a span within the conversation trace.
  • LLM calls: All LLM calls via LiteLLM are automatically traced with prompts, responses, token counts, and costs.
  • Tool calls: Terminal commands (bash), file edits (file_editor), and other tool executions are captured with their inputs and outputs.
  • Browser sessions: When using browser-use tools, session replays are automatically captured.

Trace hierarchy

Traces are organized hierarchically:
Each conversation gets its own session ID (the conversation UUID), allowing you to group all traces from a single conversation together.

Alternative OTEL configuration

For non-Laminar OpenTelemetry backends, you can configure the SDK using standard OTEL environment variables:

View the traces in Laminar

Go to the Laminar dashboard, and you will see the traces for the OpenHands SDK. Each conversation appears as a separate session, making it easy to track multi-turn interactions. The trace view shows:
  • The conversation span as the root
  • Nested spans for each agent step
  • LLM calls with prompts, responses, and token usage
  • Tool calls with their inputs and outputs