Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Researcher Agent to write blog posts/ articles using Amazon Bedrock and websearch.

License

NotificationsYou must be signed in to change notification settings

aws-samples/sample-bedrock-deep-researcher

Bedrock Deep Research is a Streamlit-based application using Amazon Bedrock, LangGraph, and LangChain AWS libraries that automates article/report generation through AI-powered research, content writing, and image generation. It combines web research, structured content generation, and human feedback to produce comprehensive, well-researched articles with accompanying header images (generated byAmazon Bedrock Nova Canvas). This repo is inspired by LangChain'sDeep Researcher.

Features

  • Automated Research: Performs targeted web searches to gather relevant information
  • Structured Content Generation: Creates cohesive article outlines and detailed section content
  • Interactive Feedback Loop: Incorporates human feedback to refine article outlines
  • AI-Generated Imagery: Produces relevant header images for visual appeal

Repository Structure

bedrock_deep_research/├── bedrock_deep_research.py          # Main Streamlit application entry point├── bedrock_deep_research/│   ├── config.py             # Configuration settings and parameters│   ├── graph.py              # Core workflow orchestration using LangGraph│   ├── model.py              # Data models for articles and sections│   ├── nodes/                # Individual workflow components│   │   ├── article_head_image_generator.py    # Header image generation│   │   ├── article_outline_generator.py       # Article outline creation│   │   ├── section_writer.py                  # Section content generation│   │   └── [other node files]                 # Additional workflow components│   ├── utils.py              # Utility functions│   └── web_search.py         # Web research integration using Tavily API├── poetry.lock               # Poetry dependency lock file└── pyproject.toml           # Project configuration and dependencies

Work Flow

The application follows a sequential workflow from topic input to final article generation, with feedback loops for refinement.

Agent Flow with Example

Key Components of the graph:

  1. Initial Researcher: It performs initial web searches to gather context
  2. Article Outline Generator: creates structured outline using research data
    • Human Feedback Provider: This incorporates human feedback for the outline
  3. Section Writer: A subgraph that generates content after web research.
  4. Compilation: combines all elements into a cohesive article
  5. Final Section Generation: Generate the overview and the last paragraph based on the other sections.
  6. Header Image Generator: creates relevant header image

Setup

The setup is meant to be used locally withAWS authentication, as well as within Amazon Sagemaker: either inJupyterLab orCode Editor instance.

Note: Current setup is assumingus-east-1 region (as defined inenv.tmp file).

Prerequisites

1. Installation

# Clone the repositorygit clone https://github.com/aws-samples/sample-bedrock-deep-researcher.gitcd sample-bedrock-deep-researcher# Activate the virtual environmentpoetry shell# Install dependencies using Poetrypoetry install

2. Create and set your Tavily API key

Go tohttps://app.tavily.com/home and create a free API KEY. Copy the API Key and paste it into theenv.tmp file.

3. Setup the environment variables

Copy the environment variables into the local environment.

cp env.tmp .env

4. Run the application

  • Start the Streamlit application:
streamlit run bedrock_deep_research.py

Using the Application

StepDescriptionVisual Reference
1. Enter Article Details• Enter your article topic in the main input field
• Add specific writing guidelines in the text area provided
• Adjust search parameters using the configuration panel
• Click the "Generate Outline" button to start the process
Article Creation Interface
2. Review and Refine the Outline• Review the AI-generated article outline
• Provide specific feedback in the feedback field to improve the structure
• Use the editing tools to make direct modifications if needed
• Click "Accept Outline" when you're satisfied with the structure
Outline Review Interface
3. Generate the Complete Article• Review the fully researched and written article with its custom header image
• Use the formatting tools to make any final adjustments
• Click "Copy to Clipboard" to export your article
• Or select "New Article" to start the process again
Final Article View

Configuration details

Writing Guideline samples:You could include instructions like:

- Strict 150-200 word limit- Start with your most important insight in **bold**- Include code examples where relevant- Focus on practical implementation

Web Research Configuration:

number_of_queries=2# Number of search queries per sectionmax_search_depth=2# Maximum research iterations per section

Debug Mode:

# Enable debug loggingexport LOG_LEVEL=DEBUGstreamlit run bedrock_deep_research.py

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes. Read CONTRIBUTING.md for more details.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

Researcher Agent to write blog posts/ articles using Amazon Bedrock and websearch.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp