Skip to main content
Strands Agents is an open-source SDK from AWS for building AI agents. It provides a simple, code-first approach to creating agents with tools, multi-agent orchestration, and streaming support. HoneyHive integrates seamlessly with Strands—no instrumentor needed. Strands uses OpenTelemetry natively, so initializing HoneyHive first automatically captures all agent activity.

Quick Start

Zero configuration required. Just initialize HoneyHive before importing Strands and all agent runs, tool calls, and model calls are automatically traced.
To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see Tracer Initialization.
pip install "honeyhive>=1.0.0rc0" strands-agents
import os
from honeyhive import HoneyHiveTracer
from strands import Agent

tracer = HoneyHiveTracer.init(
    api_key=os.getenv("HH_API_KEY"),
    project=os.getenv("HH_PROJECT"),
)

# Your Strands code works unchanged - traces appear automatically
agent = Agent(model=your_model)
result = agent("Hello!")

Compatibility

RequirementVersion
Python3.10+
strands-agents0.1.0+

What Gets Traced

HoneyHive automatically captures:
  • Agent invocations - Every agent() call with inputs and outputs
  • LLM calls - Model requests, responses, and token usage
  • Tool executions - Each tool call with arguments and results
  • Event loop cycles - Internal agent reasoning steps
No manual instrumentation required.

Example: Agent with Tools

import os
from honeyhive import HoneyHiveTracer
from strands import Agent, tool
from strands.models.anthropic import AnthropicModel

# Initialize HoneyHive first
tracer = HoneyHiveTracer.init(
    api_key=os.getenv("HH_API_KEY"),
    project=os.getenv("HH_PROJECT"),
)

@tool
def calculator(expression: str) -> str:
    """Evaluate a math expression."""
    return str(eval(expression))

agent = Agent(
    model=AnthropicModel(model_id="claude-sonnet-4-20250514", max_tokens=1024),
    tools=[calculator],
    system_prompt="You are a helpful assistant.",
)

result = agent("What is 25 * 4?")
print(result)

Example: Multi-Agent (Agents-as-Tools)

Strands supports wrapping agents as tools for orchestration patterns:
import os
from honeyhive import HoneyHiveTracer
from strands import Agent, tool
from strands.models.anthropic import AnthropicModel

tracer = HoneyHiveTracer.init(
    api_key=os.getenv("HH_API_KEY"),
    project=os.getenv("HH_PROJECT"),
)

def get_model():
    return AnthropicModel(model_id="claude-sonnet-4-20250514", max_tokens=1024)

# Specialist agents wrapped as tools
@tool
def research_agent(query: str) -> str:
    """Research factual information."""
    agent = Agent(model=get_model(), system_prompt="You are a research specialist.")
    return str(agent(query))

@tool
def math_agent(problem: str) -> str:
    """Solve math problems step-by-step."""
    agent = Agent(model=get_model(), system_prompt="You are a math specialist.")
    return str(agent(problem))

# Orchestrator routes to specialists
orchestrator = Agent(
    model=get_model(),
    tools=[research_agent, math_agent],
    system_prompt="""Route queries to the appropriate specialist:
- Factual questions → research_agent
- Math problems → math_agent""",
)

result = orchestrator("What is the square root of 144?")
print(result)
In HoneyHive, you’ll see the full trace hierarchy: orchestrator → specialist agent → LLM calls.

Adding Metadata

Session-Level (User Context)

Use enrich_session for metadata that applies to the entire session:
tracer = HoneyHiveTracer.init(project="your-project")

tracer.enrich_session(
    user_properties={
        "user_id": "user_123",
        "plan": "enterprise",
    }
)

Span-Level (Agent Attributes)

Use Strands’ native trace_attributes for metadata on agent spans:
agent = Agent(
    model=model,
    tools=[...],
    trace_attributes={
        "environment": "production",
        "feature": "customer_support",
        "app_version": "2.1.0",
    },
)
These attributes appear on all spans created by that agent (invocations, LLM calls, tool executions).

Troubleshooting

Traces not appearing

  1. Initialize HoneyHive first - Must be called before importing Strands:
# ✅ Correct order
from honeyhive import HoneyHiveTracer
tracer = HoneyHiveTracer.init(project="your-project")

from strands import Agent  # Import after HoneyHive init

# ❌ Wrong - HoneyHive initialized after Strands
from strands import Agent
from honeyhive import HoneyHiveTracer
tracer = HoneyHiveTracer.init(project="your-project")
  1. Check environment variables - Ensure HH_API_KEY and HH_PROJECT are set
  2. Verify model credentials - Ensure your model provider credentials are configured (Anthropic API key, AWS credentials, etc.)


Resources