Skip to main content

Strands Agents hooks for the Grafana Agent Observability Python SDK

Project description

Sigil Python Framework Module: Strands Agents

agento11y-strands provides a Strands HookProvider bridge that maps agent, model, and tool lifecycle events into Sigil generation and tool recording.

Installation

pip install agento11y agento11y-strands
pip install strands-agents

Quickstart

from agento11y import Client
from agento11y_strands import with_agento11y_strands_hooks
from strands import Agent

client = Client()
agent_config = with_agento11y_strands_hooks(
    {"name": "support-agent"},
    client=client,
    provider_resolver="auto",
)

agent = Agent(**agent_config)
agent(
    "Explain what LLM observability is in one sentence.",
    invocation_state={"conversation_id": "demo-strands"},
)

client.shutdown()

Existing Agents

from agento11y import Client
from agento11y_strands import with_agento11y_strands_hooks

client = Client()
with_agento11y_strands_hooks(agent, client=client, provider_resolver="auto")

Conversation Mapping

Conversation ID precedence:

  1. conversation_id / session_id / group_id from Strands invocation_state
  2. thread_id from Strands invocation_state
  3. deterministic fallback agento11y:framework:strands:<run_id>

Pass a stable value per user conversation:

agent("Remember my timezone is UTC+1.", invocation_state={"conversation_id": "customer-42"})
agent("What timezone did I give you?", invocation_state={"conversation_id": "customer-42"})

Metadata and Lineage

Required framework tags:

  • agento11y.framework.name=strands
  • agento11y.framework.source=hooks
  • agento11y.framework.language=python

Metadata includes:

  • required: agento11y.framework.run_type
  • optional: agento11y.framework.run_id, agento11y.framework.thread_id, agento11y.framework.parent_run_id, agento11y.framework.component_name, agento11y.framework.event_id

Provider Resolver

Resolver order: explicit provider option -> Strands model config metadata -> model prefix inference -> custom.

For Bedrock model IDs that do not infer cleanly, pass provider="anthropic" or another provider value when creating the hook provider.

Troubleshooting

  • If conversations are fragmented, pass stable conversation_id or session_id in invocation_state.
  • If provider is inferred as custom, set provider="openai" / provider="anthropic" / provider="gemini" on hook creation.
  • Always call client.shutdown() during teardown.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agento11y_strands-0.10.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agento11y_strands-0.10.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file agento11y_strands-0.10.0.tar.gz.

File metadata

  • Download URL: agento11y_strands-0.10.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for agento11y_strands-0.10.0.tar.gz
Algorithm Hash digest
SHA256 9958ea33f009dd47b05a35a6482c176b1a2aa146b1886c4524b097fedbacc386
MD5 41f7bb2573dabeeed94032665f221a7d
BLAKE2b-256 a382b33ed9b217cdb920e34b3c0d5d94c18082e9e98f84d7075acd0532ed980e

See more details on using hashes here.

Provenance

The following attestation bundles were made for agento11y_strands-0.10.0.tar.gz:

Publisher: python-sdks-publish.yml on grafana/agento11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agento11y_strands-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agento11y_strands-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bf6828075c7c81fcb1e37518e05b8fd26ae23af470cd0d6519c5df01b972fec
MD5 5ea69c5b6a6eec22e54cbf02f100f4f1
BLAKE2b-256 23a6173775ddfdc3207bd15b3be55171898c38455035509747a2e224cd9e0f80

See more details on using hashes here.

Provenance

The following attestation bundles were made for agento11y_strands-0.10.0-py3-none-any.whl:

Publisher: python-sdks-publish.yml on grafana/agento11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page