Skip to content

[FEATURE] Create Agent Interface #573

@mkmeral

Description

@mkmeral

Problem Statement

I would like Strands to extract Agent into an interface. This will allow more complex use cases with multi-agent systems. It can also simplify separate implementations (e.g. MultiAgentBase).

Proposed Solution

Agent Interface Proposal: Extending Strands for Heterogeneous Multi-Agent Systems

Abstract

This proposal introduces an interface-based architecture to replace Strands' current monolithic Agent class, enabling heterogeneous multi-agent systems that combine AI agents, human participants, and external framework integrations within unified workflows. The current architecture limits Strands to homogeneous AI-only systems, preventing real-world applications that require human oversight for regulatory compliance, privacy-conscious processing, or integration with existing enterprise AI toolchains. By abstracting agent capabilities behind a common interface while preserving full backward compatibility, this change transforms Strands from an AI-only platform into a comprehensive orchestration layer for mixed human-AI collaborative systems, addressing critical enterprise needs for compliance, cost optimization, and framework interoperability.

Core Concept

Transform Agent from concrete class to interface - Enable different agent types (AI, human, amnesiac, remote) to participate in multi-agent workflows instead of only LLM-based agents

Couple things:

  • Human Agents - Inject human reviewers, approvers, or domain experts into automated workflows for regulatory compliance, quality assurance, and critical decisions
  • Amnesiac Agents - Stateless agents that don't retain conversation history, (related issue)
  • Remote Agents - Integrate agents from other frameworks (LangChain, AutoGen, CrewAI) or remote systems into Strands orchestration
  • ?? Bi-Directional Agents? (not sure)

Interface Definition

class AgentInterface(ABC):
    """Abstract interface for all agent types in Strands."""
    
    @property
    @abstractmethod
    def agent_state(self) -> AgentState: pass
    
    @property
    @abstractmethod
    def agent_id(self) -> str: pass
    
    @property 
    @abstractmethod
    def name(self) -> str: pass
    
    @property
    @abstractmethod
    def agent_type(self) -> str: pass  # "ai", "human", "amnesiac", "remote", etc.
    
    @abstractmethod
    async def invoke_async(self, prompt: Union[str, list[ContentBlock]], **kwargs) -> AgentResult: pass
    
    @abstractmethod
    def __call__(self, prompt: Union[str, list[ContentBlock]], **kwargs) -> AgentResult: pass

# Current Agent becomes AIAgent(AgentInterface) - no breaking changes
Agent = AIAgent  # Backward compatibility alias

Use Case

This would allow customers to intuitively create and manage multi-agent systems including remote agents, agents from other frameworks, or human agents.

Combined Use Case Example

Financial Loan Processing Workflow: Combines AI efficiency, human oversight, privacy compliance, and framework integration

# Mixed agent team for loan processing
loan_processing_team = Swarm([
    # AI agent does initial data analysis
    AIAgent(
        name="data_analyzer", 
        system_prompt="Analyze loan applications and credit history"
    ),
    
    # This is a simple agent that does not update messages between request/responses
    AmnesiacAgent(
        AIAgent(system_prompt="Process low-risk loan approvals"),
        name="routine_processor",
        memory_limit=1
    ),
    
    # Human agent reviews high-risk cases requiring judgment
    HumanAgent(
        name="senior_underwriter",
        description="Human underwriter for high-risk case review"
    ),
    
    # Remote agent runs specialized credit scoring on separate secure system
    RemoteAgent(
        name="credit_scorer",
        endpoint="https://secure-credit-api.company.com",
        auth_token=os.getenv("CREDIT_API_TOKEN")
    ),
    
    # AI agent generates final documentation
    AIAgent(
        name="doc_generator",
        system_prompt="Generate loan approval/denial documentation"
    )
])

# Process loan application with mixed human-AI workflow
result = loan_processing_team("Process loan application ID 12345")

# Workflow automatically:
# 1. AI analyzes application data
# 2. Amnesiac agent handles if low-risk (no data retention)
# 3. Human reviews if high-risk (regulatory compliance) 
# 4. Remote system validates credit score (existing infrastructure)
# 5. AI generates final documentation

Benefits: Regulatory compliance through human oversight, privacy protection via amnesiac processing, integration with existing credit systems, and AI efficiency where appropriate - all orchestrated through a single Strands workflow.

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions