アイデアから AI アプリへ:Strands を用いた知的研究アシスタントの構築
AWS は、Strands Agents というオープンソースフレームワークと Kiro IDE の連携により、複雑なアーキテクチャを必要とせず、わずか 30 行のコードで AI エージェントを開発・構築できる新アプローチを発表しました。
キーポイント
開発の大幅な簡素化
従来の複雑な API 連携や状態管理を不要とし、Strands Agents を利用することで 30 行のコードで機能する研究アシスタントを実現可能にしました。
AWS エコシステムとの統合
Amazon Bedrock の基盤モデルと Kiro IDE の拡張機能(Powers)を組み合わせ、開発者が直感的にエージェントをスキャフォールディングできる環境を提供します。
オープンソース SDK の提供
Strands Agents は Python コードで LLM とカスタムロジックを統合するオープンソースフレームワークとして公開され、研究や分析タスクの実装を容易にします。
最小限のコードでAIエージェントを構築
Strands Agentsを使用することで、30行のコードだけで自律的な推論やツール選択機能を持つ研究アシスタントを作成できます。
AWS BedrockとIAMポリシーの設定
Claude Sonnetモデルを安全に利用するために、必要な権限(InvokeModel, Converse)のみが付与されたスコープ付きIAMポリシーを設定する必要があります。
Kiro を活用した開発の加速
自然言語でのプロンプト入力で Kiro が Strands Agents と Streamlit を組み合わせた研究アシスタントアプリのコードを自動生成し、開発プロセスを効率化します。
高度な機能を持つ Web インターフェースの実装
Streamlit による Web UI でトピックを入力し、要約、最新記事、前提知識、主要貢献者、関連論文 URL を含む包括的なリサーチレポートを動的に生成します。
影響分析・編集コメントを表示
影響分析
この記事は、AI エージェント開発が専門家のみならず、より広範な開発層に開かれる転換点を示しています。AWS がオープンソース戦略と IDE ツールを組み合わせることで、実用化までの時間を劇的に短縮し、ビジネス現場での AI 応用拡大を加速させる可能性があります。
編集コメント
「30 行で完成」という具体的な成果は、開発者の負担軽減という点において非常に説得力があります。AWS がオープンソースコミュニティと連携して DX を強化する動きは、今後の AI エージェント市場の標準化に大きな影響を与えるでしょう。
AI アプリの構築に、機械学習(ML)の博士号や複雑なアーキテクチャとの数ヶ月にわたる格闘は必要ありません。しかし、複数の API 呼び出しをオーケストレーションし、会話の状態を管理し、自律的に推論できるエージェントを作成しようとするとき、まさにそれが起こってしまいます。私は、自然言語処理や分散システムにおける専門知識を要する大規模なプロジェクトへと膨れ上がった、単純な AI のアイデアを目にしてきました。しかし、ここが変化した点です:Strands Agents と AWS サービスを使用することで、わずか 30 行のコードで完全に機能する AI リサーチアシスタントを構築しました。この投稿では、最初の概念から動作するアプリケーションに至るまでの具体的な手順を解説します。
Amazon Web Services (AWS) は、アジェンティック AI アプリケーションの構築に複数のオプションを提供しています。Amazon Bedrock は、インテリジェントなエージェントを駆動するためのファウンデーションモデル(FMs)へのアクセスを提供し、Kiro のようなサービスは IDE 内で直接開発者向けの AI アシスタンスを可能にします。これらのツールを使用して、特定のユースケースやドメインに合わせてカスタマイズされた独自の AI エージェントを作成することができます。
Kiro は、開発者が意思決定に集中できるようにコードを記述する AI 搭載 IDE です。Kiro Powers は、MCP サーバー、ステアリングファイル、フックを再利用可能なユニットにパッケージ化することで、Kiro IDE に専門的でオンデマンドの機能を拡張します。例えば Strands power では、SDK ドキュメント検索、入門ガイド、および正確な API パターンがバンドルされており、これにより Kiro はエージェントを正確にスケフォールドできます。AWS、パートナー、コミュニティから厳選された 50 以上のパワー(デザイン、デプロイ、セキュリティ、観測性をカバー)があり、開発者はワンクリックでインストールしてすぐに構築を開始できます。
Strands Agents は、オープンソースフレームワークであり、研究、分析、コンテンツ生成などのタスクを実行できるインテリジェントエージェントを直感的に作成する方法を提供することで、これらの開発課題に直接取り組んでいます。Strands Agents は、Python コードを通じて大規模言語モデル(LLM)の機能とカスタムロジックおよび API を組み合わせます。Strands Agents に関する詳細については、オープンソース AI エージェントソフトウェア開発キット (SDK) である Strands Agents の紹介 をご覧ください。
なぜ Strands エージェントを選ぶのか:AWS 環境における簡素化された AI 開発
Strands エージェントは、モデル駆動型アプローチを通じて、AI アプリケーション構築時に直面する核心的な課題に対処します。複雑なハードコーディングの代わりに、LLM(大規模言語モデル)による自律的な推論と計画を活用し、プロンプトとツールリストのみでエージェントを作成可能にします。ロジックやツールの使用は LLM が自動的に処理します。
このフレームワークの柔軟なアーキテクチャは、単一のエージェントからマルチエージェントネットワーク、階層型システムに至るまで幅広くサポートしており、様々な規模のプロジェクトに適しています。外部関数や API は @tool デコレータ を通じて統合でき、モデル非依存設計により Amazon Bedrock、Anthropic、OpenAI など多様な LLM プロバイダーと連携可能です。
AWS 環境においては、Strands は Amazon Bedrock や AWS Lambda などのサービスと自然に統合され、すでに本番運用レベルで利用可能です。Amazon Q や AWS Glue といったサービスでも AWS チームによって採用されています。このオープンソースフレームワークは Apache-2.0 ライセンスの下、活発なコミュニティによる貢献が行われており、ローカル開発環境と本番環境の両方で同じコードが円滑に動作します。リアルタイムストリーミング応答機能により、即時フィードバックが必要なインタラクティブアプリケーションにも適しています。
技術的な詳細については、Strands Agents SDK:エージェントアーキテクチャと観測性に関する技術的深掘りをご覧ください。
前提条件
ソリューションに取り組む前に、以下の準備が整っていることを確認してください:
- AWS アカウント。
- AWS IAM Identity Center または Builder ID に設定されたユーザー。
- Kiro のインストール。
- Amazon Bedrock にアクセスするための AWS 認証情報の設定 — AWS IAM Identity Center を使用した認証の設定(人間によるアクセスのための推奨アプローチ)。以下のコマンドを実行して設定し、ログインしてください:
aws configure sso
aws sso login --profile research-assistant
- 次に、使用するロールまたは権限セットにスコープ付きのインライン AWS Identity and Access Management (IAM) ポリシーをアタッチします。このポリシーは、本チュートリアルに必要な最小限の権限のみ付与します。具体的には、Amazon Bedrock を介して Claude Sonnet モデルを呼び出すための権限です。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:Converse"
],
"Resource": "arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0"
}
]
}
- Kiro に「Strands を使用してエージェントを構築する (power)」を追加します。

ソリューション概要
インテリジェントな研究アシスタントの構築
このセクションでは、Strands Agents がエージェント型 AI 機能の開発をどのように効率化するかを示します。例として紹介する研究アシスタントは、最小限のコードでインテリジェントな機能をアプリケーションに迅速に統合する方法を解説しています。まず、Agent() の初期化によってエージェントを作成し、次にプロンプトエンジニアリングを通じてエージェントの動作を定義します。その後、ツールとプロセス応答を提供してクリーンな出力を得ることで、自律的な研究能力を追加します。
このソリューションにはコードがわずか 30 行しか必要なく、Strands が AI 開発の複雑さを直感的な実装へとどう変換できるかを証明しています。可視化には Streamlit を使用していますが、中核となる機能は、Strands が最小限の介入で自律的な推論、ツールの選択、タスク実行を処理する能力にあります。
Strands Agents の始め方
まずは、Strands Agents を用いてシンプルな Q&A 形式の研究アシスタントを構築します。IDE で Strands Agents SDK をインストールしてください:
Kiro -> Terminal
pip install strands-agents
研究アシスタントには Streamlit も必要なので、以下のコマンドで Streamlit をインストールしてください:
pip install streamlit
次に、最初のエージェントを Python ファイルとして作成します。ファイル名は research.py としましょう。
from strands import Agent
デフォルト設定でエージェントを作成する
agent = Agent()
エージェントに質問する
agent("Tell me about agentic AI")

これで完了です。あなたは今、最初の AI エージェントを構築しました。次に、実行したときにこのエージェントが何ができるかを見てみましょう。
ターミナルで以下のコマンドを実行してください:
python -u research.py
この基盤を確立した後、プロンプトエンジニアリングを活用して実装を強化し、より洗練された研究アシスタントを作成しましょう。Strands エージェントによって駆動される包括的な研究レポートを受け取り、トピックを動的に入力できる Web インターフェースを Streamlit を使用して構築します。
Kiro による AI 支援開発:研究アシスタントの実装生成
自然言語でのプロンプトと対話を通じて研究アシスタントのコードを生成する Kiro の機能を活用し、開発プロセスを加速させましょう。要件を自然言語で記述し、Strands エージェントと Streamlit を使用して機能的な研究アシスタントアプリケーションを作成するために Kiro が支援します。
以下の手順を実行してください:
- Kiro を開く。
- 新しい Python ファイル(例:research_assistant.py)を作成する。
- 以下のプロンプトを提供する:
Strands Agent ライブラリを使用した Streamlit の研究アシスタントアプリを作成してください。以下の正確な要件に従ってください:
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等)は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
- アプリタイトル:「Research Assistant」、サブタイトルは「トピックを入力して、研究分析と推奨事項を取得」
- 入力テキストフィールドのプレースホルダー:「例:再生可能エネルギー、人工知能」
- 「Generate Research Report(研究レポートを生成)」ボタンをクリックした際の動作:
- 「Researching and analyzing...(調査・分析中...)」というメッセージと共にスピナーを表示
- 端末出力の干渉を防ぐため、標準出力(stdout)をリダイレクト(sys および os をインポートし、devnull を使用)
- Agent() インスタンスを作成
- 以下の正確なプロンプトテンプレートを使用:「あなたは研究アシスタントです。トピック '{topic}' について:1. トピックの概要を約50語で説明 2. {topic} に関する最新の論文を2件、各20語以内で見つける 3. トピックに関連する注意点と前提条件(例:アジェンティック AI の場合、機械学習および生成 AI が前提)を各20語以内で記述 4. この研究分野における主要な貢献者および著名人2名とその経歴を各25語以内で記載 5. さらに読むための関連 URL を2件と、https://arxiv.org/ の研究論文へのリンクを提供」
- st.subheader(f"Research Report: {topic}") で見出しを表示し、st.write(response.message['content'][0]['text']) で回答内容を表示
- finally ブロック内で標準出力を復元
- トピックが入力されていない場合は警告を表示
標準出力のリダイレクトには try/finally パターンを使用すること。コードは最小限かつ機能的に保つこと。
Kiro が完全な実装を生成するため、その後保存して実行できます。
以下は Kiro からのコードです。
import sys
import os
import streamlit as st
from strands import Agentst.title("Research Assistant")
st.write("Enter a topic to get research analysis and recommendations")
topic = st.text_input("Research Topic", placeholder="e.g., renewable energy, artificial intelligence")
if st.button("Generate Research Report"):
if topic:
with st.spinner("Researching and analyzing..."):
old_stdout = sys.stdout
try:
sys.stdout = open(os.devnull, "w")
agent = Agent()
response = agent(
f"You are a research assistant. For the topic '{topic}': "
f"1. Overview of the topic in about 50 words "
f"2. Find recent 2 articles about {topic} in 20 words each "
f"3. Things to know relevant to the topic and description as prerequisites in 20 words each "
f"like if topic is agentic ai then prereq is machine learning and generative ai "
f"4. 2 key contributors and well known people in this field of research topic including their bio in 25 words each "
f"5. give relevant 2 urls to read more and any research papers from https://arxiv.org/"
)
finally:
sys.stdout = old_stdout
st.subheader(f"Research Report: {topic}")
st.write(response.message["content"][0]["text"])
else:
st.warning("Please enter a topic to research.")
注:ウェブ検索ツールがない場合、エージェントはトレーニング知識から URL を生成します。これらは最新の論文を反映していない可能性があります。*ライブ取得には、適切な MCP サーバーをツールとして追加してください*。
MCP サーバーの責任ある選択
- MCP サーバーを特定のバージョンまたはコミットハッシュに固定してください(例:pip install "arxiv-mcp==X.Y.Z")。
- インストール前にソースコードを確認してください。本番環境でのユースケースには、Amazon Bedrock ネイティブの検索機能(Knowledge Bases/RAG)をお勧めします。
- 顧客向けまたは組織間デプロイの場合、サードパーティ製の MCP サーバーは、組織の法務およびセキュリティ審査プロセスを経由してルーティングしてください。
- MCP サーバーは、エージェントのプロセス特権(利用可能な AWS クレデンシャルを含む)を共有します。これらは信頼境界の一部として扱ってください。
*本番ワークロードでは、AWS managed remote MCP servers via Amazon Bedrock AgentCore の利用を検討してください。これにより、プロセスの分離、集中型認証が実現され、ローカルでのクレデンシャル露出を排除できます*。
本番環境におけるセキュリティ上の考慮事項
- ユーザー入力を検証する。トピックの長さを制限し、文字列をエージェントに渡す前に印刷できない文字を除去する(この投稿内のコード参照)。
- Amazon Bedrock Guardrails を有効化する。プロンプト注入と不安全な出力のフィルタリングのために、モデル呼び出しにガードレールをアタッチする。詳細は、「Amazon Bedrock Guardrails を使用して有害コンテンツを検出およびフィルタリングする」を参照のこと。
- ログ機能をオンにする。Amazon Bedrock のモデル呼び出しログと AWS CloudTrail データイベント(bedrock:InvokeModel および bedrock:Converse)を有効化し、不正利用の追跡やインシデントの再構築が可能にするようにする。
- コストを制限する。Amazon Bedrock のオンデマンドクォータアラームとセッションごとのクエリ上限を設定し、トピックの洪水攻撃やコスト枯渇を防ぐ。
- 永続化データを分類する。会話履歴を保存する場合、データを書き込む前にデータを分類し、機密値を赤書き(redact)する。
- 共有責任モデルを確認する。AWS が管理する範囲とユーザーが責任を持つ範囲の境界については、「AWS 共有責任モデル」を参照のこと。
コードをより深く理解したい場合は、Kiro に「Can you explain code in context?」(文脈内のコードを説明してください)と尋ねることができます。

Kiro は以下のように応答します。

開発初期段階では、エージェントの出力は Streamlit インターフェース上で正しくストリーミング表示されていましたが、同時にターミナルにも表示されており、そこで突然切り捨てられてしまう問題がありました。これはアプリケーションの機能には影響しませんでしたが、開発環境に不要なノイズを生み出していました。Kiro とさらに対話を行う中で、コードを修正し標準出力(stdout)のリダイレクトを実装することで、エージェントの応答が意図したインターフェースでのみ表示されるように確認できました。
これは Kiro を用いたコーディングにおける重要な利点を示しています——自然言語によるフィードバックを通じて実装を反復的に改善できる点です。このようなエッジケースに遭遇した場合、望ましい動作を記述するだけで、Kiro がそれに応じてコードを修正してくれます。例えば、空または不正なエージェント応答に対するエラーハンドリングを追加するように Kiro に依頼してみるのも良いでしょう。
では、改良されたアプリケーションが実際にどのように動くか見てみましょう。
エージェントに命を吹き込む
ターミナルで、research_assistant.py ファイルが保存されているディレクトリに移動し、以下のコマンドを実行してください:
streamlit run research_assistant.pyこれにより、Streamlit アプリが起動します。
注意: streamlit run はデフォルトで 127.0.0.1 にバインドされるため、UI はこのマシンからのみアクセス可能です。認証、CSRF(クロスサイトリクエストフォージェリ)保護、および Amazon Bedrock のコスト上限を追加せずに、LAN(–server.address=0.0.0.0)やインターネットに公開しないでください。ローカル開発者ツールにおけるブラウザの DNS リバインディング(DNS-rebinding)は既知の懸念事項です。共有利用を行う場合は、Streamlit 組み込みの認証機能を使用するか、認証ゲートウェイを介してリバースプロキシすることを検討してください。
前のコマンドを実行すると、以下のメッセージが表示されます。メールアドレス欄は空白のままにすることも選択できます。
**
*Streamlit へようこそ!*
*有益なオンボーディングメール、ニュース、オファー、プロモーション、*
*そしてたまに配布されるグッズを受け取りたい場合は、下のメールアドレスを入力してください。それ以外の場合は、*
*この項目を空白のままにしてください。
*E メール:*
次に、Streamlit アプリを開くためのリンクが表示されます。


関心のあるトピックを入力し、「研究レポートの生成(Generate Research Report)」を選択できます。

これにより、以下のように研究レポートが生成されます。

異なるレポートや詳細情報を取得したい場合は、ファイルがコンテキストに含まれている状態で Kiro にコードの修正を依頼するか、自分でコードを変更することもできます。
結論
本記事では、Strands Agents がエージェント型 AI アプリの開発をどのように効率化するかについて探りました。
原文を表示
Building an AI app shouldn’t require a PhD in machine learning (ML) or months of wrestling with complex architectures. Yet that’s exactly what happens when you try to orchestrate multiple API calls, manage conversation state, and create agents that can reason on their own. I’ve seen straightforward AI ideas balloon into sprawling projects that demand specialized knowledge in natural language processing and distributed systems. But here’s what changed: using Strands Agents and AWS services, I built a fully functional AI research assistant in just 30 lines of code. In this post, I walk you through exactly how I did it—from initial concept to working application.
Amazon Web Services (AWS) offers multiple options for building agentic AI applications. Amazon Bedrock provides access to foundation models (FMs) that can power intelligent agents, while services like Kiro enable developer-focused AI assistance directly within the IDE. You can use these tools to create custom AI agents tailored to specific use cases and domains.
Kiro is an AI-powered IDE that writes code so developers can focus on decisions. Kiro Powers extend the Kiro IDE with specialized, on-demand capabilities by packaging MCP servers, steering files, and hooks into reusable units. The Strands power, for example, bundles SDK documentation search, getting started guides, and correct API patterns so Kiro can scaffold agents accurately. With over 50 curated powers from AWS, partners, and the community—covering design, deployment, security, and observability—developers install with one click and start building immediately.
Strands Agentsis an open source framework that directly addresses these development challenges by providing a straightforward way to create intelligent agents that can perform tasks like research, analysis, and content generation. Strands Agents combine the capabilities of large language models (LLMs) with custom logic and APIs through Python code. For more information about Strands Agents, see Introducing Strands Agents, an Open Source AI Agents Software Development Kit (SDK).
Why choose Strands Agents: Simplified AI development for AWS environments
Strands Agents addresses the core challenges you face when building AI applications through its model-driven approach. Instead of complex hardcoding, it uses LLMs for autonomous reasoning and planning, so you can create agents with only a prompt and tools list while the LLM handles the logic and tool usage.
The framework’s flexible architecture supports everything from single agents to multi-agent networks and hierarchical systems, making it suitable for projects of various scale. You can integrate external functions and APIs through the @tool decorator, while the model-agnostic design works with various LLM providers including Amazon Bedrock, Anthropic, and OpenAI.
For AWS environments, Strands integrates naturally with services like Amazon Bedrock and AWS Lambda, and it’s already production-ready. AWS teams use it in services like Amazon Q and AWS Glue. The open source framework is Apache-2.0 licensed with active community contributions, and the same code runs smoothly in both local development and production environments. Real-time streaming responses make it a good fit for interactive applications that need immediate feedback.
For more information about the technical deep dive, see Strands Agents SDK: A technical deep dive into agent architectures and observability.
Prerequisites
Before you dive into the solution, make sure that you have the following in place:
- An AWS account.
- User configured in AWS IAM Identity Center or Builder ID.
- Install Kiro.
- Configure AWS credentials to access Amazon Bedrock — Set up authentication using AWS IAM Identity Center (the recommended approach for human access). Run the following commands to configure and log in:
aws configure sso
aws sso login --profile research-assistant- Next, attach a scoped inline AWS Identity and Access Management (IAM) policy to the role or permission set that you use. This policy grants only the necessary permissions for this tutorial—invoking the Claude Sonnet model through Amazon Bedrock.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:Converse"
],
"Resource": "arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-3-5-sonnet-20241022-v2:0"
}
]
}- Add Build an agent with Strands (power) to Kiro.

Solution overview
Building an intelligent research assistant
This section shows how Strands Agents streamline the development of agentic AI capabilities. Our example research assistant showcases how you can quickly integrate intelligent features into your applications with minimal code. You start by creating an agent with an Agent() initialization, then define the agent’s behavior through prompt engineering. Next, you add autonomous research capabilities by providing tools and process responses for clean output.
The solution requires only 30 lines of code, demonstrating how Strands can reduce AI development complexity into straightforward implementation. While we use Streamlit for visualization, the core functionality lies in Strands’ ability to handle autonomous reasoning, tool selection, and task execution with minimal intervention from you.
Getting started with Strands Agents:
You will start by building a straightforward Q&A style research assistant using Strands Agents. In your IDE, install the Strands Agents SDK:
Kiro -> Terminal
pip install strands-agentsWe also need Streamlit for our research assistant, so use the following command to install Streamlit:
pip install streamlitThen you will create your first agent as a Python file. Let’s call it research.py*.*
from strands import Agent
# Create an agent with default settings
agent = Agent()
# Ask the agent a question
agent("Tell me about agentic AI")
That’s it. You’ve just built your first AI agent. Now, let’s see what it can do when you run it.
In your terminal, run the following command:
python -u research.pyWith this foundation established, let’s enhance our implementation by using prompt engineering to create a more sophisticated research assistant. We will build a web interface using Streamlit that can be used to dynamically input topics and receive comprehensive research reports powered by Strands Agents.
AI-assisted development with Kiro: Generating our research assistant implementation
Let’s accelerate our development process by using capabilities of Kiro to generate our research assistant code through natural language prompting and conversation. We will use natural language to describe our requirements, and Kiro can help us create a functional research assistant application with Strands Agents and Streamlit.
Complete the following steps:
- Open Kiro.
- Create a new Python file (for example, research_assistant.py).
- Provide the following prompt:
Create a Streamlit research assistant app using strands Agent library with these exact requirements:
1. App title: "Research Assistant" with subtitle "Enter a topic to get research analysis and recommendations"
2. Text input field with placeholder "e.g., renewable energy, artificial intelligence"
3. "Generate Research Report" button that when clicked:
- Shows spinner with "Researching and analyzing..." message
- Redirects stdout to prevent terminal output interference (import sys, os and use devnull)
- Creates Agent() instance
- Uses this exact prompt template: "You are a research assistant. For the topic '{topic}': 1. Overview of the topic in about 50 words 2. Find recent 2 articles about {topic} in 20 words each 3. Things to know relevant to the topic and description as prerequisites in 20 words each like if topic is agentic ai then prereq is machine learning and generative ai 4. 2 key contributors and well known people in this field of research topic including their bio in 25 words each 5. give relevant 2 urls to read more and any research papers from https://arxiv.org/"
- Displays response using st.subheader(f"Research Report: {topic}") and st.write(response.message['content'][0]['text'])
- Restores stdout in finally block
- Shows warning if no topic entered
Use try/finally pattern for stdout redirection. Keep code minimal and functional.Kiro will generate the complete implementation, which we can then save and run.
The following is the code from Kiro.
import sys
import os
import streamlit as st
from strands import Agent
st.title("Research Assistant")
st.write("Enter a topic to get research analysis and recommendations")
topic = st.text_input("Research Topic", placeholder="e.g., renewable energy, artificial intelligence")
if st.button("Generate Research Report"):
if topic:
with st.spinner("Researching and analyzing..."):
old_stdout = sys.stdout
try:
sys.stdout = open(os.devnull, "w")
agent = Agent()
response = agent(
f"You are a research assistant. For the topic '{topic}': "
f"1. Overview of the topic in about 50 words "
f"2. Find recent 2 articles about {topic} in 20 words each "
f"3. Things to know relevant to the topic and description as prerequisites in 20 words each "
f"like if topic is agentic ai then prereq is machine learning and generative ai "
f"4. 2 key contributors and well known people in this field of research topic including their bio in 25 words each "
f"5. give relevant 2 urls to read more and any research papers from https://arxiv.org/"
)
finally:
sys.stdout = old_stdout
st.subheader(f"Research Report: {topic}")
st.write(response.message["content"][0]["text"])
else:
st.warning("Please enter a topic to research.")Note: Without a web-browsing tool, the agent generates URLs from its training knowledge. These may not reflect the latest papers. *For live retrieval, add appropriate MCP server as a tool*.
Choosing MCP servers responsibly
- Pin the MCP server to a specific version or commit hash (for example, pip install "arxiv-mcp==X.Y.Z").
- Review the source before installing. I recommend Amazon Bedrock-native retrieval (Knowledge Bases/RAG) for production use cases.
- For customer-facing or cross-organization deployments, route third-party MCP servers through your organization’s legal and security review process.
- MCP servers share the agent’s process privileges, including any AWS credentials available to the process. Treat them as part of your trust boundary.
*For production workloads, consider AWS managed remote MCP servers via Amazon Bedrock AgentCore, which provide process isolation, centralized auth, and eliminate local credential exposure.*
Security considerations for production
- Validate user input. Cap topic length and strip non-printable characters before passing the string to the agent (see the code in this post).
- Enable Amazon Bedrock Guardrails. Attach a guardrail to the model call for prompt-injection and unsafe-output filtering. For more information, see Detect and filter harmful content by using Amazon Bedrock Guardrails.
- Turn on logging. Enable Amazon Bedrock model-invocation logging and AWS CloudTrail data events on bedrock:InvokeModel and bedrock:Converse so you can attribute misuse and reconstruct incidents.
- Bound cost. Set an Amazon Bedrock on-demand quota alarm and a per-session query cap to prevent topic-flood/cost-exhaustion.
- Classify persisted data. If you store conversation history, classify the data and redact sensitive values before writing.
- Review the shared responsibility model. See the AWS Shared Responsibility Model for the split between what AWS manages and what you own.
If you want to understand the code better, you can ask Kiro *Can you explain code in context?*

Kiro responds as follows:

During initial development, the agent’s output was streaming correctly in the Streamlit interface but also appearing in the terminal, where it would get cut off abruptly. While this didn’t affect the application’s functionality, it created unnecessary noise in the development environment. Through further conversation with Kiro, I refined the code to include stdout redirection, to verify the agent’s responses would only display in the intended interface.
This illustrates a key advantage of coding with Kiro—the ability to iteratively improve your implementation through natural language feedback. When you encounter such edge cases, you can describe the desired behavior, and Kiro will help modify the code accordingly – for example, try asking Kiro to add error handling for empty or malformed agent responses.
Let’s now see our refined application in action.
Bringing your agent to life
In the terminal, go to the directory where the file research_assistant.py is saved and run the following command:
streamlit run research_assistant.pyThis will bring up the Streamlit app.
Note: streamlit run binds to 127.0.0.1 by default, so the UI is reachable only from this machine. Don’t expose it to the LAN (–server.address=0.0.0.0) or the internet without adding authentication, CSRF protection, and an Amazon Bedrock cost cap. Browser DNS-rebinding against localhost is a known concern for local developer tools. Consider Streamlit’s built-in authentication or reverse-proxying through an authenticated gateway for any shared use.
After you run the previous command, you will be greeted with following note. You can choose to leave the email as blank.
Welcome to Streamlit!
If you’d like to receive helpful onboarding emails, news, offers, promotions,
and the occasional swag, please enter your email address below. Otherwise,
leave this field blank.
Email:
Next, you will get the link to open Streamlit app.


You can enter a topic of interest and choose Generate Research Report.

which will generate the research report as follows:

If you want to get a different report or other details, you can ask Kiro to modify the code when you have the file in context or you can proceed to alter the code yourself.
Conclusion
In this post, we explored how Strands Agents streamline the development of agentic AI app
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み