strands_agents

Strands Agent integration for Pipecat.

This module provides integration with Strands Agents for handling conversational AI interactions. It supports both single agent and multi-agent graphs.

class pipecat.processors.frameworks.strands_agents.StrandsAgentsProcessor(agent: Agent | None = None, graph: Graph | None = None, graph_exit_node: str | None = None)[source]

Bases: FrameProcessor

Processor that integrates Strands Agents with Pipecat’s frame pipeline.

This processor takes LLM message frames, extracts the latest user message, and processes it through either a single Strands Agent or a multi-agent Graph. The response is streamed back as text frames with appropriate response markers.

Supports both single agent streaming and graph-based multi-agent workflows.

__init__(agent: Agent | None = None, graph: Graph | None = None, graph_exit_node: str | None = None)[source]

Initialize the Strands Agents processor.

Parameters:
  • agent – The Strands Agent to use for single-agent processing.

  • graph – The Strands multi-agent Graph to use for graph-based processing.

  • graph_exit_node – The exit node name when using graph-based processing.

Raises:

AssertionError – If neither agent nor graph is provided, or if graph is provided without a graph_exit_node.

async process_frame(frame: Frame, direction: FrameDirection)[source]

Process incoming frames and handle LLM message frames.

Parameters:
  • frame – The incoming frame to process.

  • direction – The direction of frame flow in the pipeline.

can_generate_metrics() bool[source]

Check if this service can generate performance metrics.

Returns:

True as this service supports metrics generation.