Skip to content

feat: A2A Real Estate Multi-Agent AgentCore example + README update#47

Merged
travis-burmaster merged 1 commit intomainfrom
feature/a2a-realestate-agentcore-example
Mar 7, 2026
Merged

feat: A2A Real Estate Multi-Agent AgentCore example + README update#47
travis-burmaster merged 1 commit intomainfrom
feature/a2a-realestate-agentcore-example

Conversation

@ellucas-creator
Copy link
Collaborator

Summary

Adds a new example adapting the AWS Labs A2A Real Estate AgentCore sample to use BMasterAI telemetry instead of the custom common/utils/logging_config logger.

What's new

examples/a2a-realestate-agentcore/

Three self-contained Strands agents connected via the A2A (Agent-to-Agent) protocol:

Agent Port Tools
propertysearchagent 5002 search_properties, get_property_details
propertybookingagent 5001 create_booking, check_booking_status, cancel_booking, list_customer_bookings
realestate_coordinator Orchestrates both via A2A client

Key differences from the AWS original

  • bmasterai.logging replaces common/utils/logging_configTOOL_USE / TASK_COMPLETE / TASK_ERROR events on every tool call across all three agents
  • Each agent is self-contained (no shared common/ path hacking)
  • Coordinator has local REPL mode + BedrockAgentCoreApp entrypoint for AgentCore runtime
  • Bearer token forwarding via BedrockAgentCoreContext (graceful fallback for local dev)
  • run_local.py starts all three agents and opens an interactive REPL in one command

README

Added new entry at the top of the 2026 examples section, just above the Cost Optimization Agent. Removed NEW badge from the Cost Optimization Agent (it's a few weeks old now).

Quick start

cd examples/a2a-realestate-agentcore
pip install -r realestate_coordinator/requirements.txt
python run_local.py

Adapts the AWS Labs A2A-realestate-agentcore-multiagents sample to use
bmasterai structured logging instead of the custom common/utils logger.

Three self-contained Strands agents:
- propertysearchagent  — A2A server (port 5002): search_properties, get_property_details
- propertybookingagent — A2A server (port 5001): create_booking, check_booking_status, cancel_booking, list_customer_bookings
- realestate_coordinator — orchestrator with A2A client: delegates to both sub-agents

Key differences from the AWS original:
- bmasterai.logging replaces common/utils/logging_config entirely
- TOOL_USE / TASK_COMPLETE / TASK_ERROR events on every tool call
- Each agent is self-contained (no shared common/ path hacking)
- Coordinator has local REPL mode + BedrockAgentCoreApp for AgentCore runtime
- Bearer token forwarding via BedrockAgentCoreContext (graceful fallback in local mode)

run_local.py spins up all three agents and opens an interactive REPL.

Updates README.md with the new example entry.
@claude
Copy link

claude bot commented Mar 7, 2026

Claude finished @ellucas-creator's task —— View job


PR Review Complete ✅

I've thoroughly reviewed this A2A Real Estate Multi-Agent AgentCore example and it's a well-implemented adaptation of the AWS Labs sample with good BMasterAI integration. Here's my detailed feedback:

Review Checklist:

  • Read CLAUDE.md for repo-specific guidelines
  • Analyze README.md changes
  • Review run_local.py startup script
  • Review propertysearchagent implementation
  • Review propertybookingagent implementation
  • Review realestate_coordinator implementation
  • Check requirements.txt files
  • Analyze BMasterAI telemetry integration
  • Check for security concerns
  • Assess error handling and robustness
  • Review test coverage and testing strategy
  • Provide comprehensive review feedback

Strengths

Code Quality & Architecture:

  • Clean separation of concerns with three self-contained agents
  • Consistent code structure and patterns across all agents
  • Well-documented with clear docstrings and inline comments
  • Good use of environment variables for configuration
  • Proper async/await patterns in coordinator A2A communication

BMasterAI Integration:

  • Excellent telemetry integration - every tool call properly logged with TOOL_USE, TASK_COMPLETE, TASK_ERROR events
  • Structured metadata includes timing, request IDs, and relevant context
  • Consistent logging patterns across all three agents
  • Good use of request IDs for tracing across agent boundaries

Security & Best Practices:

  • Proper input validation (date formats, property existence checks)
  • Bearer token forwarding with graceful fallback for local development
  • No hardcoded secrets or credentials
  • Uses # nosec B104 annotation for legitimate wildcard binding
  • Good error handling with try/catch blocks

Documentation:

  • Clear README with architecture diagram and deployment instructions
  • Good examples and quick start guide
  • Proper comparison with AWS original highlighting key differences

🔧 Areas for Improvement

Error Handling & Robustness:

  1. Network timeouts: realestate_coordinator/agent.py:101 - Consider making the 300s timeout configurable per environment
  2. A2A response parsing: realestate_coordinator/agent.py:134-172 - Complex response parsing logic could benefit from helper functions to improve readability
  3. Port availability: run_local.py:43-52 - _wait_for_port could return more descriptive error messages about what went wrong

Performance Considerations:

  1. Mock data: Both agents use in-memory dictionaries (MOCK_PROPERTIES, MOCK_BOOKINGS) - consider adding persistence layer documentation for production use
  2. A2A client creation: New httpx client created for each request - could implement connection pooling for better performance

Code Organization:

  1. Duplicate code: Similar logging helper functions (_log_tool, _log_done, _log_err) across agents - consider extracting to shared utility
  2. Magic numbers: Some hardcoded values like deposit calculation (2x monthly rent) could be configurable

🧪 Test Coverage

Missing Tests:

  • No unit tests for individual tools/functions
  • No integration tests for A2A communication
  • No end-to-end testing of the complete workflow
  • Consider adding tests for:
    • Property search filtering logic
    • Booking validation and creation
    • A2A message handling and error scenarios
    • BMasterAI logging integration

Testing Strategy Recommendations:

  • Unit tests for individual tool functions with mock data
  • Integration tests with real A2A servers using testcontainers
  • Property-based testing for search filtering logic
  • Mock BMasterAI logging to verify telemetry events

🔒 Security Assessment

Good Security Practices:

  • Input validation on dates, email formats, property IDs
  • No SQL injection risks (using in-memory data)
  • Proper error messages that don't leak sensitive information
  • Bearer token handling with appropriate fallbacks

Potential Concerns:

  • Mock data contains no rate limiting - production would need this
  • No input sanitization on free-text fields (customer name, cancellation reason)
  • CORS not configured for A2A servers (may be needed for browser-based clients)

📊 Overall Assessment

This is a high-quality implementation that successfully adapts the AWS sample with excellent BMasterAI integration. The code is well-structured, follows good practices, and provides a solid foundation for both local development and AgentCore deployment.

Recommendation: ✅ APPROVE

The implementation demonstrates:

  • Strong understanding of A2A protocol and multi-agent architectures
  • Excellent telemetry integration patterns
  • Clean, maintainable code structure
  • Good documentation and developer experience

Minor improvements suggested above are non-blocking and would enhance the production readiness of the example.


@travis-burmaster travis-burmaster merged commit eda1ea5 into main Mar 7, 2026
3 checks passed
@travis-burmaster travis-burmaster deleted the feature/a2a-realestate-agentcore-example branch March 15, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants