Skip to content

Research usecase#1414

Merged
Sugi275 merged 23 commits intoaws-samples:mainfrom
Hikotty:research-usecase
Feb 13, 2026
Merged

Research usecase#1414
Sugi275 merged 23 commits intoaws-samples:mainfrom
Hikotty:research-usecase

Conversation

@Hikotty
Copy link
Contributor

@Hikotty Hikotty commented Jan 12, 2026

Description of Changes

This PR introduces a new Research Agent feature that enables users to conduct comprehensive research tasks using web search capabilities.

New Features

  • Research Agent Use Case: A new use case that performs various research tasks across industries using web search (Brave/Tavily) and generates detailed research reports
  • Bedrock AgentCore Integration: Leverages AWS Bedrock AgentCore Runtime for agent execution
  • Multiple Research Modes: Supports quick research, general research, and technical research modes

Technical Changes

  • CDK Infrastructure: Added ResearchAgentCoreStack and ResearchAgentCore construct for deploying the research agent runtime
  • Python Lambda Runtime: Added research agent core runtime with web search tools (Brave Search, Tavily)
  • Frontend Components: Added ResearchAgentPage.tsx, useResearchAgent.ts hook, and DiagramRenderer.tsx component
  • Configuration: Added new CDK context parameters:
    • researchAgentEnabled (default: false)
    • createResearchAgentCoreRuntime (default: false)
    • researchAgentBraveApiKey (single string, not array)
    • researchAgentTavilyApiKey (single string, not array)

Impact on Existing Users

  • No breaking changes: The feature is disabled by default
  • Opt-in activation: Users must explicitly enable the feature by setting researchAgentEnabled: true and providing API keys in cdk.json
  • New dependencies: Requires @aws-cdk/aws-bedrock-agentcore-alpha package (already included)

How to Enable

  1. Set researchAgentEnabled: true in cdk.json
  2. Set createResearchAgentCoreRuntime: true in cdk.json
  3. Provide either researchAgentBraveApiKey or researchAgentTavilyApiKey (or both)
  4. Deploy with npm run cdk:deploy

Checklist

  • Modified relevant documentation
  • Verified operation in local environment
  • Executed npm run cdk:test and if there are snapshot differences, execute npm run cdk:test:update-snapshot to update snapshots

Related Issues

Related to #1000

@Sugi275 Sugi275 added the auto-deploy 自動的に検証用 AWS アカウントにデプロイするための Label label Jan 13, 2026
@Sugi275
Copy link
Collaborator

Sugi275 commented Jan 17, 2026

Document について

Research を利用するために、GenU のデプロイをする方がどんな作業をすればいいのか説明する Document も追加をお願いできますでしょうか?
Marketplace で Brave の利用を開始いただく導線は用意をしたくて、そのための Document を準備いただけたら幸いです!

Document については、以下を意識していただけると幸いです。

以下の DEPLOY_OPTION は簡潔に記載する。
https://github.com/aws-samples/generative-ai-use-cases/blob/main/docs/ja/DEPLOY_OPTION.md

詳細な Document を用意する場合は、以下のような新しいドキュメントを用意する
https://github.com/aws-samples/generative-ai-use-cases/blob/main/docs/ja/<新しいドキュメント>.md

Hikotty and others added 2 commits January 21, 2026 19:51
- リサーチエージェントデプロイガイドを追加(日本語/英語/韓国語)
- DEPLOY_OPTION.mdにリサーチエージェントセクションを追加
- Brave Search API取得手順の画像8枚を追加
Hikotty added 4 commits January 27, 2026 10:53
- Add isResearchAgent flag to StrandsStreamProcessor
- Detect research agent by checking mode field (technical-research, mini-research, general-research)
- Process <final_report> tags only for research agent (content inside tags -> chat, outside -> trace)
- Keep backward compatibility for other AgentCore features (generic, agent builder, MCP)
- No changes to Lambda/backend, only frontend processing
- Add name field to image ExtraData
- Add null checks for block.image.source and block.document.source
- Fix regex pattern (remove extra parenthesis)
- Add default values for optional fields
- Restore all deleted translation keys in meetingMinutes section
  - generation_panel, hide_prompt, style_diagram, style_whiteboard, etc.
  - diagram options (flowchart, mindmap, sequence, timeline)
  - UI controls (both_panel, input_source, microphone, option, settings)
- Add research section translations for all 6 languages
- Fix Tavily API key injection for research agent backend
- Update documentation with deployment instructions
- Clean up MCP configuration and agent prompts
@Hikotty
Copy link
Contributor Author

Hikotty commented Jan 31, 2026

下記対応しました
・ドキュメントの追加
・MCP周辺の細かなバグの修正
・議事録ユースケースの誤った編集分のRestore

@Sugi275 Sugi275 self-requested a review February 12, 2026 06:07
Sugi275
Sugi275 previously approved these changes Feb 12, 2026
Copy link
Collaborator

@Sugi275 Sugi275 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

各種指摘修正されているのを確認しました! Approved です!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

127 行目の "@aws-cdk" の後に追加するよりは、94 行目の "closedNetworkCreateResolverEndpoint" の後に記載いただくのが良いかなとおもいました。

https://github.com/aws-samples/generative-ai-use-cases/pull/1414/files#diff-6c87a1c3644d483b1634e8d5689d80c4bd3a93ca9f656019dbb934ced8ac9129R93

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

少し前の main ブランチからマージをされているような気がしています。議事録機能側の変更が少し前にデグレっています。最新のファイルに、議事録側を更新できますか?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

少し前の main ブランチからマージをされているような気がしています。議事録機能側の変更が少し前にデグレっています。最新のファイルに、議事録側を更新できますか?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

少し前の main ブランチからマージをされているような気がしています。議事録機能側の変更が少し前にデグレっています。最新のファイルに、議事録側を更新できますか?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

少し前の main ブランチからマージをされているような気がしています。議事録機能側の変更が少し前にデグレっています。最新のファイルに、議事録側を更新できますか?

Comment on lines 127 to 128
"researchAgentEnabled": false,
"createResearchAgentCoreRuntime": false,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

researchAgentEnabled と createResearchAgentCoreRuntime を別に Flug を用意する必要はないのかなと思いました。
researchAgentEnabled は、フロントエンド側の表示を制御するためのもので、createResearchAgentCoreRuntime こちらは CDK 側で、AgentCore Runtime をデプロイするのかどうかのフラグだと理解しています。

Research のユースケースに関しては、1 個のフラグで管理することで問題ないかなと思っています。

createGenericAgentCoreRuntime について

createGenericAgentCoreRuntime に関しては、汎用的な AgentCore Runtime のデプロイをコントロールするもので、ユーザーが選択しても良いと思いますが、Research においては、2 つのフラグに分ける意図は思い浮かびませんでした~。

*$py.class
.venv/
.uv/
uv.lock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv.lock は、gitignore に入れてしまうと、GenU の Deploy に失敗してしまっていました。
uv.lock は、repository に入れる形になるかなと思っていますが、いかがでしょう?

エラーログ

Dockerfile:21
--------------------
  19 |     
  20 |     # Copy dependency files
  21 | >>> COPY pyproject.toml .python-version uv.lock ./
  22 |     # Install Python dependencies
  23 |     RUN uv sync
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 3f5f5128-b8d9-41c0-92a2-a49a72017586::05e5lo44mff40m7ddu6djusiv: "/uv.lock": not found
ResearchAgentCoreStack: fail: docker build --tag cdkasset-41f0e080dd905095131f2c326b011c98a063c4398180a2df0db231319a0829f0 . exited with error code 1: #0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.14kB done
#1 DONE 0.0s

#2 [internal] load metadata for public.ecr.aws/docker/library/python:3.13
#2 DONE 0.9s

#3 [internal] load .dockerignore
#3 transferring context: 201B done
#3 DONE 0.0s

#4 [internal] load build context
#4 transferring context: 1.59kB done
#4 DONE 0.0s

#5 [ 3/11] RUN apt-get update -y && apt-get install curl nodejs npm -y
#5 CACHED

#6 [ 4/11] RUN curl -LsSf https://astral.sh/uv/install.sh | sh
#6 CACHED

#7 [ 2/11] WORKDIR /var/task
#7 CACHED

#8 [ 5/11] RUN npm install -g mcp-remote
#8 CACHED

#9 [ 6/11] COPY pyproject.toml .python-version uv.lock ./
#9 ERROR: failed to calculate checksum of ref 3f5f5128-b8d9-41c0-92a2-a49a72017586::05e5lo44mff40m7ddu6djusiv: "/uv.lock": not found

#10 [ 1/11] FROM public.ecr.aws/docker/library/python:3.13@sha256:02865b3929f3910fc2d6ebbf745bf00504d316478dacaea7d9e230e134411bcb
#10 resolve public.ecr.aws/docker/library/python:3.13@sha256:02865b3929f3910fc2d6ebbf745bf00504d316478dacaea7d9e230e134411bcb 0.0s done
#10 sha256:02865b3929f3910fc2d6ebbf745bf00504d316478dacaea7d9e230e134411bcb 10.96kB / 10.96kB done
#10 CANCELED
------
 > [ 6/11] COPY pyproject.toml .python-version uv.lock ./:
------
Dockerfile:21
--------------------
  19 |     
  20 |     # Copy dependency files
  21 | >>> COPY pyproject.toml .python-version uv.lock ./
  22 |     # Install Python dependencies
  23 |     RUN uv sync
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 3f5f5128-b8d9-41c0-92a2-a49a72017586::05e5lo44mff40m7ddu6djusiv: "/uv.lock": not found

Comment on lines 4 to 46
"brave-search-1": {
"command": "npx",
"args": ["-y", "@brave/brave-search-mcp-server"],
"env": {
"BRAVE_API_KEY": ""
},
"metadata": {
"category": "Search",
"description": "Primary web search capabilities powered by Brave Search (API Key 1)"
}
},
"brave-search-2": {
"command": "npx",
"args": ["-y", "@brave/brave-search-mcp-server"],
"env": {
"BRAVE_API_KEY": ""
},
"metadata": {
"category": "Search",
"description": "Secondary web search capabilities powered by Brave Search (API Key 2)"
}
},
"brave-search-3": {
"command": "npx",
"args": ["-y", "@brave/brave-search-mcp-server"],
"env": {
"BRAVE_API_KEY": ""
},
"metadata": {
"category": "Search",
"description": "Tertiary web search capabilities powered by Brave Search (API Key 3)"
}
},
"brave-search-4": {
"command": "npx",
"args": ["-y", "@brave/brave-search-mcp-server"],
"env": {
"BRAVE_API_KEY": ""
},
"metadata": {
"category": "Search",
"description": "Quaternary web search capabilities powered by Brave Search (API Key 4)"
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらって、MCP Server 4 つ起動する背景ってありそうですか? API Key は 1 個しか指定できないので、MCP Server も 1 個でいいんじゃないかなと思いました。

Comment on lines 70 to 77
brave_api_key = os.getenv("BRAVE_API_KEY", "")
if brave_api_key:
# Inject into brave-search server
if "brave-search" in servers:
if "env" not in servers["brave-search"]:
servers["brave-search"]["env"] = {}
servers["brave-search"]["env"]["BRAVE_API_KEY"] = brave_api_key
logger.info("Injected Brave API Key into brave-search MCP server")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここの Brave の API key を挿入する実装なのですが、mcp-configs/mcp.json の brave-search-1, brave-search-2, brave-search-3, brave-search-4 の指定とずれていて、API キーが挿入されていないように見えています。

mcp-configs/mcp.json は、brave は 1 個だけでいいかなという気がしています。

Comment on lines 109 to 118
case 'video':
return {
video: {
format: getVideoFormatFromMimeType(data.source.mediaType),
source: {
bytes: base64Data,
},
},
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちら、video を削除された背景はありますでしょうか?

Copy link
Collaborator

@Sugi275 Sugi275 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM です!各種修正されていることを確認しました。

@Sugi275 Sugi275 merged commit ce7904e into aws-samples:main Feb 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-deploy 自動的に検証用 AWS アカウントにデプロイするための Label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants