Skip to content

Conversation

@awsarron
Copy link
Member

@awsarron awsarron commented Nov 1, 2025

Description

feat(agent-interface): introduce AgentBase abstract class as the interface for agent classes to implement

Related Issues

#573

Documentation PR

TODO

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • [N/A] I have added any necessary tests that prove my fix is effective or my feature works
  • [TODO] I have updated the documentation accordingly
  • [TODO] I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 89.09091% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/strands/agent/base.py 78.57% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Member

@dbschmigelski dbschmigelski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

Just calling out here if anyone looks back

  • structured_output() is deprecated so it wasn't added
  • Direct tool calling also was not added

from .state import AgentState


class AgentBase(ABC):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use Protocol instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgrayy has also called out that Protocols should be preferred in general over base-classes; it would also enable us to specify the properties as normal fields instead of getters

@mkmeral
Copy link
Contributor

mkmeral commented Nov 3, 2025

nit: How would this relate to MultiAgentBase? I personally want to get rid of it, but given that AgentBase is more extensive than MultiAgentBase, it might not be possible, right?

from .state import AgentState


class AgentBase(ABC):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgrayy has also called out that Protocols should be preferred in general over base-classes; it would also enable us to specify the properties as normal fields instead of getters

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the PR description indicating the purpose of the base class - e.g. is it just for agents or is it meant to represent things in-place of an agent (like humans) as the tracking issue #573 calls out.

Specifically, if we were starting fresh, what would implement this? MultiAgent primitives? A2AAgent, etc?

self,
prompt: AgentInput = None,
*,
invocation_state: dict[str, Any] | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the use-cases that we're targeting, will invocation_state and structured_output_model be supported? For instance, for multi-agent, I think structured_output is not supported but invocation_state is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants