Skip to content

aws-samples/sample-agentcore-deep-research

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

175 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

AgentCore Deep Research

AgentCore Deep Research is an open-source sample application that automates multi-source research on Amazon Bedrock AgentCore. Given a research question, an AI agent iteratively queries diverse data sources, cross-references findings, and generates a structured PDF report with citations and visualizations. The app includes a React frontend with real-time report streaming, over 10 configurable data connectors spanning enterprise data on AWS and external APIs, and a modular architecture built on the Fullstack Solution Template for AgentCore.

Workflow

✨ Key features:

  • Multi-source analysis: Search across enterprise data, Internet, and specialized APIs (10+ built-in sources)
  • Iterative workflow: AI agent scaffolds report, researches the data, and creates a detailed report
  • Data visualization: Agent generates charts and diagrams to enrich reports with quantitative insights
  • Real-time report display: Split-pane UI shows the report being built in real-time and allows follow-ups
  • Fact-checking and citations: Every factual claim includes inline source citations with the references section

AgentCore Deep Research demo

πŸš€ Deployment

Prerequisites: Node.js 20+, AWS CLI, AWS CDK CLI, Python 3.10+, uv, and Docker. See the deployment guide for details.

Deploying AgentCore Deep Research stack requires a few commands:

cd infra-cdk
cp .config_example.yaml config.yaml  # Create your config (edit as needed)
npm install
cdk bootstrap  # Once per account/region
npm run deploy

Available deploy commands (run from infra-cdk/):

npm run deploy            # Backend + frontend
npm run deploy:frontend   # Frontend only
cdk deploy                # Backend only

See the deployment guide for detailed instructions.

▢️ Usage

UI Screenshot

  1. Open the application URL (from CDK outputs)
  2. Log in with Cognito credentials
  3. Toggle data sources (AlphaVantage, Tavily, Nova, ArXiv, etc.) as needed
  4. Enter a research question
  5. Watch as the agent:
    • Scaffolds report structure with key themes
    • Researches across enabled data sources
    • Writes all sections with citations
    • Verifies completeness and fills gaps
    • Generates charts and diagrams when the report has quantitative data
  6. Ask follow-up questions and download the report (including any generated charts)

ℹ️ Architecture

Architecture Diagram

The architecture uses Amazon Cognito in four places:

  1. User-based login to the frontend web application on CloudFront
  2. Token-based authentication for the frontend to access AgentCore Runtime
  3. Token-based authentication for the agents in AgentCore Runtime to access AgentCore Gateway
  4. Token-based authentication when making API requests to API Gateway.

Gateway Tools

The application includes multiple Lambda-based tools behind AgentCore Gateway with OAuth authentication:

Tool Domain Description API Key Required
AlphaVantage Research Finance Commodity prices, US economic indicators, and market news with sentiment analysis Yes
ArXiv Search Science Search academic papers on arXiv by topic, author, or keywords with category filtering No
ClinicalTrials.gov Search Life Science Search clinical studies worldwide by condition, intervention, phase, and recruitment status No
FRED Economic Search Finance Search 800,000+ economic time series from the Federal Reserve (GDP, CPI, unemployment, and more) No
Knowledge Base Search Generic Query Amazon Bedrock Knowledge Bases (requires configuration) No
Nova Web Grounding Generic AWS-powered web search via Amazon Nova with citations No
OpenFDA Drug Search Life Science Search FDA drug label database for pharmaceutical information No
PubMed Search Life Science Search peer-reviewed biomedical literature for abstracts, journal articles, and meta-analyses No
S3 File Reader Generic Read text files and PDFs from S3 (PDFs auto-converted to markdown via pymupdf4llm) No
SEC EDGAR Search Finance Search SEC company filings (10-K, 10-Q, 8-K) with optional full-text content retrieval No
Tavily Web Search Generic Search the web for current information with relevance scoring and domain filtering Yes

The modular architecture makes it easy to integrate additional data sources for developers.

Note: Several tools connect to external (non-AWS) APIs: Tavily, ArXiv, OpenFDA, AlphaVantage, FRED, PubMed, SEC EDGAR, and ClinicalTrials.gov. Of these, Tavily and AlphaVantage require API keys obtained through external registration. All external APIs, whether free or paid, are subject to the terms and conditions of their respective providers. We are not responsible for the availability, accuracy, or usage policies of third-party APIs. Please review each provider's terms before use. See the deployment guide for stack setup instructions and which tools require API keys.

Tech Stack

  • Frontend: React with TypeScript, Vite, Tailwind CSS, and shadcn components
  • Agent: Strands Agents SDK with BedrockModel
  • Authentication: AWS Cognito User Pool with OAuth support
  • Infrastructure: CDK deployment with Amplify Hosting for frontend and AgentCore backend

πŸ’» Local Development

Local development requires a deployed stack because the agent depends on AWS services that cannot run locally:

  • AgentCore Memory - stores conversation history
  • AgentCore Gateway - provides tool access via MCP
  • SSM Parameters - stores configuration (Gateway URL, client IDs)
  • Secrets Manager - stores Gateway authentication credentials

You must first deploy the stack with npm run deploy (from infra-cdk/), then you can run the frontend and agent locally using Docker Compose while connecting to these deployed AWS resources:

# Set required environment variables (see below for how to find these)
export MEMORY_ID=your-memory-id
export STACK_NAME=your-stack-name
export AWS_DEFAULT_REGION=us-east-1

# Start the full stack locally
cd docker
docker compose up --build

Finding the environment variable values:

  • STACK_NAME: Use the stack_name_base value from your infra-cdk/config.yaml
  • MEMORY_ID: Extract from the MemoryArn CloudFormation output (the ID is the last segment after /)
    aws cloudformation describe-stacks --stack-name <your-stack-name> \
      --query 'Stacks[0].Outputs[?OutputKey==`MemoryArn`].OutputValue' --output text
    # Returns: arn:aws:bedrock-agentcore:region:account:memory/MEMORY_ID
  • AWS_DEFAULT_REGION: The region where you deployed the stack (e.g., us-east-1)

See the local development guide for detailed setup instructions.

πŸ“‚ Project Structure

agentcore-deep-research/
β”œβ”€β”€ frontend/                 # React frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # React components (shadcn/ui)
β”‚   β”‚   β”œβ”€β”€ hooks/          # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ lib/            # Utility libraries
β”‚   β”‚   β”œβ”€β”€ services/       # API service layers
β”‚   β”‚   └── types/          # TypeScript type definitions
β”‚   β”œβ”€β”€ public/             # Static assets and aws-exports.json
β”‚   └── package.json
β”œβ”€β”€ infra-cdk/               # CDK infrastructure code
β”‚   β”œβ”€β”€ lib/                # CDK stack definitions
β”‚   β”œβ”€β”€ bin/                # CDK app entry point
β”‚   β”œβ”€β”€ lambdas/            # Lambda function code
β”‚   β”œβ”€β”€ .config_example.yaml # Example deployment configuration (copy to config.yaml)
β”‚   └── config.yaml         # Your deployment configuration (gitignored)
β”œβ”€β”€ patterns/               # Agent pattern implementations
β”‚   └── strands-deep-research/ # Deep Research agent
β”‚       β”œβ”€β”€ deep_research_agent.py  # Main agent with Gateway tools
β”‚       β”œβ”€β”€ report_upload_hook.py   # S3 upload for real-time display
β”‚       β”œβ”€β”€ system_prompt.txt       # 5-step research workflow
β”‚       β”œβ”€β”€ requirements.txt        # Agent dependencies
β”‚       └── Dockerfile              # Container configuration
β”œβ”€β”€ tools/                  # Agent tool implementations
β”‚   β”œβ”€β”€ code_interpreter/   # Code interpreter for chart generation
β”‚   └── data_analysis/      # Data analysis advisor prompt
β”œβ”€β”€ gateway/                # Gateway utilities and tools
β”‚   └── tools/              # Gateway tool implementations
β”œβ”€β”€ docker/                 # Local development Docker setup
β”‚   └── docker-compose.yml  # Docker Compose for local stack
β”œβ”€β”€ scripts/                # Deployment and test scripts
β”‚   └── deploy-frontend.py  # Cross-platform frontend deployment
β”œβ”€β”€ docs/                   # Documentation source files
β”œβ”€β”€ tests/                  # Test suite
└── README.md

πŸ”’ Security

Note: this asset represents a proof-of-value for the services included and is not intended as a production-ready solution. You must determine how the AWS Shared Responsibility applies to your specific use case and implement the needed controls to achieve your desired security outcomes. AWS offers a broad set of security tools and configurations to enable our customers.

Ultimately it is your responsibility as the developer to ensure all aspects of the application are secure. We provide security best practices in repository documentation and provide a secure baseline but Amazon holds no responsibility for the security of applications built from this tool.

πŸ‘€ Team

image image image image
Nikita Kozodoi Aiham Taleb Jack Butler Elizaveta Zinovyeva

About

AgentCore Deep Research is a sample agentic AI solution for deep research built on Amazon Bedrock AgentCore. It conducts thorough research across multiple data sources, including public APIs and internal enterprise data, and generates comprehensive PDF reports with citations and visualizations.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors