|
| 1 | +# [USE-CASES] Deep Research based on Bedrock-Manus |
| 2 | + |
| 3 | +<p align="left"> |
| 4 | + <a href="https://github.com/aws-samples"> |
| 5 | + <img alt="Build" src="https://img.shields.io/badge/Contribution-Welcome-blue"> |
| 6 | + </a> |
| 7 | + <a href="https://github.com/aws-samples/aws-ai-ml-workshop-kr/blob/master/LICENSE"> |
| 8 | + <img alt="License" src="https://img.shields.io/badge/LICENSE-MIT-green"> |
| 9 | + </a> |
| 10 | + <a href="https://github.com/aws-samples/aws-ai-ml-workshop-kr/tree/master/genai/aws-gen-ai-kr/20_applications/08_bedrock_manus"> |
| 11 | + <img alt="Build" src="https://img.shields.io/badge/Origin-Bedrock_Manus-red"> |
| 12 | + </a> |
| 13 | +</p> |
| 14 | + |
| 15 | +[English](./README.md) |
| 16 | + |
| 17 | +> Amazon Bedrock-Optimized AI Automation Framework |
| 18 | +
|
| 19 | +Bedrock-Manus is an AI automation framework optimized for Amazon Bedrock and business use cases. |
| 20 | + |
| 21 | +> Come From Open Source, Back to Open Source |
| 22 | +
|
| 23 | +Bedrock-Manus is based on the open-source project [LangManus](https://github.com/Darwin-lfl/langmanus). |
| 24 | + |
| 25 | +> Amazon Bedrock-Optimized AI Automation Framework |
| 26 | +
|
| 27 | +## Demo Video |
| 28 | + |
| 29 | +> **Task**: I'm planning to buy a laptop. Which products released within the past 2 years would you recommend? Please create the results as a PDF report. |
| 30 | +
|
| 31 | +[] |
| 32 | + |
| 33 | +- [View on YouTube](https://www.youtube.com/watch?v=Pb1lJTSLI98) |
| 34 | +- Output in Demo is [English- Report.pdf (6 pages)](./assets/final_report_deep_resrarch.pdf)) |
| 35 | + |
| 36 | +## Table of Contents |
| 37 | +- [Quick Start](#quick-start) |
| 38 | +- [Architecture](#architecture) |
| 39 | +- [Features](#features) |
| 40 | +- [Setup](#setup) |
| 41 | + - [Prerequisites](#prerequisites) |
| 42 | + - [Installation](#installation) |
| 43 | +- [Usage](#usage) |
| 44 | +- [Contributors](#contributors) |
| 45 | +- [License](#license) |
| 46 | +- [Acknowledgments](#acknowledgments) |
| 47 | + |
| 48 | +## Quick Start |
| 49 | + |
| 50 | +```bash |
| 51 | +# Clone the repository |
| 52 | +git clone https://github.com/aws-samples/aws-ai-ml-workshop-kr.git |
| 53 | +cd cd aws-ai-ml-workshop-kr/genai/aws-gen-ai-kr/20_applications/08_bedrock_manus/use_cases/01_deep_research |
| 54 | + |
| 55 | +# Create and activate virtual environment |
| 56 | +cd setup/ |
| 57 | +./create_conda_virtual_env.sh bedrock-manus |
| 58 | + |
| 59 | +# Run the project |
| 60 | +conda activate bedrock-manus |
| 61 | +python main.py |
| 62 | + |
| 63 | +``` |
| 64 | + |
| 65 | +## Architecture |
| 66 | + |
| 67 | +Bedrock-Manus implements a hierarchical multi-agent system where a supervisor coordinates specialized agents to accomplish complex tasks: |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +The system consists of the following agents working together: |
| 72 | + |
| 73 | +1. **Planner** - Analyzes tasks and creates execution strategies |
| 74 | +2. **Supervisor** - Oversees and manages the execution of other agents |
| 75 | +3. **Researcher** - Solves a given problem by gatering information from the web |
| 76 | +4. **Coder** - Handles code generation and modifications |
| 77 | +5. **Reporter** - Generates reports and summaries of the workflow results |
| 78 | + |
| 79 | +## Features |
| 80 | + |
| 81 | +### Core Capabilities |
| 82 | +- 🤖 **LLM Integration** |
| 83 | + - Support for all models provided in Amazon Bedrock (Nova, Claude, DeepSeek, Llama, etc.) |
| 84 | + - Multi-tier LLM system for different task complexities |
| 85 | + |
| 86 | +### Development Features |
| 87 | +- 🐍 **Python Integration** |
| 88 | + - Built-in Python REPL |
| 89 | + - Code execution environment |
| 90 | + |
| 91 | +### Workflow Management |
| 92 | +- 📊 **Visualization and Control** |
| 93 | + - Planning based on TODO list |
| 94 | + - Workflow graph visualization |
| 95 | + - Multi-agent orchestration |
| 96 | + - Task delegation and monitoring |
| 97 | + |
| 98 | +## Setup |
| 99 | + |
| 100 | +### Prerequisites |
| 101 | + |
| 102 | +- This code has been tested in the environments listed below. |
| 103 | + - Amazon SageMaker AI Studio (CodeEditor and JypyterLab) |
| 104 | + |
| 105 | +### Installation |
| 106 | + |
| 107 | +Bedrock-Manus leverages `conda environment` |
| 108 | +Follow the steps below to set up a virtual environment and install the necessary dependencies: |
| 109 | + |
| 110 | +```bash |
| 111 | +# Step 1: Create and activate a virtual environment through conda |
| 112 | +cd setup/ |
| 113 | +./create_conda_virtual_env.sh bedrock-manus |
| 114 | +``` |
| 115 | + |
| 116 | +By completing these steps, you'll ensure your environment is properly configured and ready for development. |
| 117 | + |
| 118 | +## Usage |
| 119 | + |
| 120 | +### Basic Execution |
| 121 | + |
| 122 | +To run Bedrock-Manus with default settings: |
| 123 | + |
| 124 | +```bash |
| 125 | +python main.py |
| 126 | +``` |
| 127 | +or use `main.ipynb` |
| 128 | + |
| 129 | +To run Bedrock-Manus with UI (Streamlit): |
| 130 | +```bash |
| 131 | +cd app/ |
| 132 | +streamlit run app.py |
| 133 | +``` |
| 134 | + |
| 135 | +### Advanced Configuration |
| 136 | + |
| 137 | +Bedrock-Manus can be customized through various configuration files in the `src/config` directory: |
| 138 | +- `agents.py`: Modify team composition, agent system prompts, and `prompt caching` enablement |
| 139 | + |
| 140 | +### Agent Prompts System |
| 141 | + |
| 142 | +Bedrock-Manus uses a sophisticated prompting system in the `src/prompts` directory to define agent behaviors and responsibilities: |
| 143 | + |
| 144 | +#### Core Agent Roles |
| 145 | + |
| 146 | +- **Supervisor ([`src/prompts/supervisor.md`](src/prompts/supervisor.md))**: Coordinates the team and delegates tasks by analyzing requests and determining which specialist should handle them. Makes decisions about task completion and workflow transitions. |
| 147 | + |
| 148 | +- **Planner ([`src/prompts/planner.md`](src/prompts/file_manager.md))**: Plan and Execute tasks using a team of specialized agents to achieve the desired outcome. |
| 149 | + |
| 150 | +- **Researcher ([`src/prompts/researcher.md`](src/prompts/researher.md))**: Specializes in information gathering through web searches and data collection. Uses Tavily search and web crawling capabilities while avoiding mathematical computations or file operations. |
| 151 | + |
| 152 | +- **Coder ([`src/prompts/coder.md`](src/prompts/coder.md))**: Professional software engineer role focused on Python and bash scripting. Handles: |
| 153 | + - Python code execution and analysis |
| 154 | + - Shell command execution |
| 155 | + - Technical problem-solving and implementation |
| 156 | + |
| 157 | +- **Reporter ([`src/prompts/reporter.md`](src/prompts/coder.md))**: Professional reporter responsible for writing clear, comprehensive reports based ONLY on provided information and verifiable facts. |
| 158 | + - Summary imtermideate results |
| 159 | + - Python code execution (results generation) |
| 160 | + - Shell command execution (results generation) |
| 161 | + |
| 162 | +#### Prompt System Architecture |
| 163 | + |
| 164 | +The prompts system uses a template engine ([`src/prompts/template.py`](src/prompts/template.py)) that: |
| 165 | +- Loads role-specific markdown templates |
| 166 | +- Handles variable substitution (e.g., current time, team member information) |
| 167 | +- Formats system prompts for each agent |
| 168 | + |
| 169 | +Each agent's prompt is defined in a separate markdown file, making it easy to modify behavior and responsibilities without changing the underlying code. |
| 170 | + |
| 171 | +## Contributors |
| 172 | + |
| 173 | +- **Dongjin Jang, Ph.D. ** (AWS AI/ML Specislist Solutions Architect) | [Mail ](mailto:[email protected]) | [Linkedin ](https://www.linkedin.com/in/dongjin-jang-kr/) | [Git ](https://github.com/dongjin-ml) | [Hugging Face ](https://huggingface.co/Dongjin-kr) | |
| 174 | + |
| 175 | +## License |
| 176 | + |
| 177 | +- <span style="#FF69B4;"> This is licensed under the [MIT License](https://github.com/aws-samples/aws-ai-ml-workshop-kr/blob/master/LICENSE). </span> |
| 178 | + |
| 179 | +## Acknowledgments |
| 180 | + |
| 181 | +Special thanks to all the open source projects and contributors (especilly LangMauns) that make BedrockManus possible. We stand on the shoulders of giants. |
0 commit comments