Skip to content

Feat/agentcore adapter#98

Merged
atc964 merged 6 commits into
IABTechLab:mainfrom
rkmaws:feat/agentcore-adapter
Jun 24, 2026
Merged

Feat/agentcore adapter#98
atc964 merged 6 commits into
IABTechLab:mainfrom
rkmaws:feat/agentcore-adapter

Conversation

@rkmaws

@rkmaws rkmaws commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Implementation of AgentCore runtime deployment for the buyer agent

rkmaws pushed a commit to rkmaws/buyer-agent that referenced this pull request Jun 3, 2026
- Remove unused http_entrypoint.py (deploy.sh uses http_main.py)
- Remove dead _format_crew_output and its tests
- Update test docstrings to reference http_main.py
- All 6 review items from issue IABTechLab#99 verified addressed in current code

Closes IABTechLab#99
Ranjith Krishnamoorthy and others added 5 commits June 24, 2026 11:32
- .gitignore: add AgentCore artifacts (.bedrock_agentcore/, Dockerfile,
  *.db, .unique-id-*)
- pyproject.toml: register agentcore pytest marker
Add Amazon Bedrock AgentCore deployment interface for the buyer agent.
Wraps the existing DealBookingFlow and ChatInterface without modifying
community-maintained agent/crew code — all new files live in
src/ad_buyer/interfaces/agentcore/ and patches/.

Runtime architecture:
- HTTP mode: BedrockAgentCoreApp entrypoint with two routing paths
  - crew: DealBookingFlow with PortfolioCrew (Bedrock LLM) for
    campaign planning and budget allocation across channels
  - chat: existing ChatInterface keyword router
- Background FastAPI server on localhost for DealBookingFlow internals

Key components:
- http_main.py: AgentCore entrypoint, routing, crew invocation
- crew_tools.py: DealBookingFlow wrapper with prompt-to-brief parsing
- patches/crewai_bedrock_fix.py: Bedrock Converse API compatibility
- deploy.sh: Build and deploy via agentcore CLI with CodeBuild
- Campaign briefs: sample briefs for demo scenarios (JSON)

Tests: 52 unit + 3 integration
Docs: agentcore-deployment.md, agentcore.md (architecture), updated index.md
- Memory patch: replace StorageBackend with AgentCoreStorageBackend
- Set _read_only=True to prevent RememberTool injection (Nova Lite
  can't serialize the schema correctly, calls with empty {})
- RecallMemoryTool still active for cross-session context recall
- Memory LLM: Nova Lite (fast/cheap for query analysis)
- Crew LLM: Nova Pro (unchanged)
- Deploy script: Dockerfile workaround for agentcore toolkit
- 25 unit tests for the memory patch
- Remove unused http_entrypoint.py (deploy.sh uses http_main.py)
- Remove dead _format_crew_output and its tests
- Update test docstrings to reference http_main.py
- All 6 review items from issue IABTechLab#99 verified addressed in current code

Closes IABTechLab#99
Resolves CI lint failures on PR IABTechLab#98 after rebase against current main.

- crew_tools.py: remove unused 'lower = prompt.lower()' assignment (F841)
- http_main.py: noqa E402 on bedrock_agentcore import (intentional ordering after env defaults)
- test_runtime.py: wrap long prompt string (E501)
- test_crew_tools.py / test_routing_mode.py: noqa E402 on imports after bedrock mock
- test_routing_mode.py: drop unused 'result' captures (F841)
- ruff format applied to AgentCore test files

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@atc964 atc964 force-pushed the feat/agentcore-adapter branch from 481fe43 to a6b0deb Compare June 24, 2026 15:38
PR IABTechLab#98 introduces Bedrock LLM usage in agents. Without the bedrock extra,
crewai raises ImportError 'AWS Bedrock native provider not available' at
agent construction time, causing all tests in test_agent_hierarchy.py to fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@atc964 atc964 merged commit a5ab5b7 into IABTechLab:main Jun 24, 2026
3 checks passed
@atc964

atc964 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks @rkmaws — merged! Summary of what was done to get it across the line, for your awareness:

Rebased onto current main to absorb recent merges (PRs #94 #95 #96 #97 #100). PR #97 was a ruff format sweep across 80 files — that absorbed cleanly via the rebase and dropped the lint error count from 493 to ~30 before any manual fixes.

Lint cleanup (commit a6b0deb):

  • ruff format applied to AgentCore test files
  • noqa: E402 added to bedrock_agentcore imports that come after env-default setup in http_main.py and tests that mock bedrock_agentcore before importing the entrypoint
  • Removed unused lower = prompt.lower() from crew_tools.py
  • Removed unused result = await ... captures in test_routing_mode.py
  • Wrapped one long prompt string in test_runtime.py

Deps added (commit 71efd1b):

  • crewai[tools,anthropic,bedrock]>=1.14.4,<2.0.0 — your run_campaign_plan sets DEFAULT_LLM_MODEL=bedrock/..., and crewai construction needs the bedrock extra at import time

Note on patches/crewai_*.py: declared compat range is >=1.10.0,<=1.14.1 but tests pass at our pinned 1.14.6. Worth a docstring update later, not blocking.

Merged commit: $(gh pr view 98 --repo IABTechLab/buyer-agent --json mergeCommit --jq '.mergeCommit.oid')

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