How aws-samples/bedrock-tooluse-reporter works
And Label Major Components
• Entry Point: Mark the “main.py” as the application’s starting point.
• Core Functional Modules:
• PerspectiveExplorer – found in research/perspective_explorer.py; it represents the interaction between two different AI models to get diverse viewpoints.
• DataSurveyor – though not directly visible as a file, infer from the README that the system uses modules in “utils” (e.g., tools) and possibly functions in “research/reporter.py” for gathering information.
• ReportWriter – implemented in research/reporter.py, responsible for synthesizing the information into structured report formats.
• Support/Utility Modules:
• “utils” directory – includes modules for configuration (config.py), communication (conversation.py), logging (logger.py), and other helper functions.
• External Services:
• AWS Bedrock API (with specific models: claude-3.7-sonnet-v1 and claude-3.5-sonnet-v2)
• Brave Search API for web search capabilities.
• Data Output: The generated report directories (./report) holding markdown, HTML, PDF, and images.
• Configuration & Environment: Represent the configuration settings in utils/config.py and environmental prerequisites (AWS, API keys, Python version).
Interactions and Relationships
• Start from the “main.py” which parses command line arguments (prompt, mode, log level, etc.).
• ContextChecker: capturing user input and gathering base context.
• PerspectiveExplorer: orchestrating multi-model dialogue to inject diverse perspectives.
• DataSurveyor: coordinating data collection from external APIs (AWS Bedrock, Brave Search).
• Demonstrate that utility modules (config, logger, tools, etc.) provide shared support by linking them to core components.
Architectural Patterns or Design Principles
• Clear modularity: Separating core application logic (research for report generation) from utility functions.
• Command-line Driven: The program’s structure is driven by main.py and CLI arguments.
• Explicit configuration management: The use of utils/config.py indicates configuration-driven behavior.
• Extensibility: The project appears designed to easily incorporate additional AI modalities or external services as needed.
• Clean Dependency Management: With requirements.in and pip-compile used, highlight that external dependencies are clearly managed.