Amazon Bedrock でエージェント向け検索基盤を構築
AWS は、エンタープライズエージェント向けにスケーラブルな検索を可能にする「Managed Knowledge Base」を Amazon Bedrock で一般提供し、複雑なインフラ構築を不要にした。
キーポイント
複雑なインフラの抽象化と簡素化
データソースへの接続、パース、ベクトルストアやグラフデータベースの選定・運用など、従来の RAG パイプライン構築で必要だった複雑な工程を AWS が管理し、開発者は設定のみで利用可能にする。
ネイティブコネクタと ACL 対応
Amazon S3、Microsoft SharePoint、Atlassian Confluence など主要なエンタープライズデータソースへのネイティブ接続をサポートし、ドキュメントレベルのアクセス制御(ACL)を標準機能として実装している。
迅速な導入とカスタマイズの両立
AWS マネジメントコンソールを通じてモデル選定不要で数分で検索機能を構築できる一方、必要に応じて埋め込みモデル、リランカー、チャンキング戦略などを細かくカスタマイズする柔軟性を提供する。
ゼロ構成の完全管理型ナレッジベース
MANAGED タイプと埋め込みモデルを MANAGED に設定することで、インフラ設定なしで即座にナレッジベースを作成できます。
S3 を経由したデータソースの追加
作成されたナレッジベースに対して S3 バケットを指定し、特定のプレフィックス(例:documents/)内のドキュメントのみを対象にインデックス化できます。
Retrieve と Agentic Retrieval の使い分け
単発の照会や低レイテンシが必要な場合は Retrieve を、比較分析や複数ドキュメントからの合成が必要な複雑なクエリには Agentic Retrieval を使用します。
Agentic Retrieval の自動処理フロー
クエリをサブクエリに分解し、並列検索と結果の十分性評価を最大 5 回繰り返すことで、複雑な推論タスクを自動的に完結させます。
重要な引用
Knowledge bases that ground agents and generative AI applications over your enterprise data are hard to build at scale.
Sensible defaults take you from zero to your first retrieval in minutes, compared to the days or weeks typically needed to assemble a comparable pipeline from scratch.
knowledgeBaseConfiguration: {'type': 'MANAGED', ...}
inclusionPrefixes: ['documents/']
Agentic Retrieval uses a foundation model (FM) to decompose complex queries into sub-queries. It retrieves iteratively across one or more knowledge bases and evaluates whether the results are sufficient before returning them.
When a query comes in, the service: Plans by analyzing the query and decomposing it into sub-queries... Retrieves by executing sub-queries in parallel... Evaluates whether the results are sufficient.
影響分析・編集コメントを表示
影響分析
この発表は、生成 AI エージェントの実装における最大のボトルネックであった「データ基盤の構築と運用」を解決する重要な一歩です。開発者がインフラの詳細に時間を割かずにビジネスロジックやアプリケーション設計に集中できる環境を整えることで、企業内での RAG(検索拡張生成)およびエージェント型 AI の普及スピードが加速すると予想されます。
編集コメント
従来の RAG パイプライン構築で必要だった多様なコンポーネントの選定と統合作業を、マネージドサービスとして一元化した点は、実務現場における導入障壁を下げる画期的な動きです。特に ACL(アクセス制御)を標準機能に含めている点は、セキュリティ要件が厳しい大企業での採用を後押しする重要な要素と言えます。
エンタープライズデータ上でエージェントや生成 AI アプリケーションを根付かせる知識基盤(Knowledge Base)を、大規模に構築するのは容易ではありません。多くのチームは、コネクタ、パーサー、ベクトルストア、知識グラフ、検索ロジックをつなぎ合わせ、それを生産環境向けに運用化しようとします。しかし、それぞれの要素には固有の課題が伴います。
どのデータソースを接続し、マルチモーダルなドキュメントタイプをどうパースするかを決める必要があります。また、グラフ型データベースとベクトルデータベースのどちらを選ぶか、さらにそれらをプロビジョニングしてスケールさせる判断も迫られます。多様なコンテンツにわたって推論を行う複雑なクエリへの対応に加え、生産環境で求められるドキュメントレベルのアクセス制御、観測性(Observability)、セキュリティを層として積み重ねる必要もあります。
Amazon Bedrock は現在、一般提供を開始した Managed Knowledge Base を通じて、スケーリング、高精度な検索、ドキュメントレベルのアクセス制御を代行する、完全に管理されたエージェント向け検索ソリューションを提供しています。エンタープライズデータソースを接続するか、ウェブをクロールしてデータを取り込むだけで利用可能です。
AWS Management Console を介した初期設定では、モデルの選択は不要です。適切なデフォルト設定により、ゼロから同等のパイプラインを組み上げるのに通常数日〜数週間かかるところを、数分で最初の検索機能を実現できます。必要に応じてカスタマイズする際は、埋め込みモデル(Embedding Model)、再ランク付け器(Reranker)、チャンキング戦略などを自由に制御可能です。
本稿では、この実現を可能にする3 つの柱——セットアップの簡素化、検索の高度化、そして本番環境での実用性——について解説します。また、知識ベースの構築とそこから情報を取得するためのコード例も紹介します。
セットアップの簡素化
現在、開発者はデータ取り込みパイプラインやベクトル・グラフストレージ、検索インフラをそれぞれ調達・構築するのが一般的です。つまり、別々のインフラを管理し、異なる課金モデルやレート制限に対応し、それらを一つの整合性のあるパイプラインに組み上げるという複雑な作業を背負うことになります。
Managed Knowledge Base(マネージド知識ベース)はこの複雑さを抽象化して隠蔽します。知識ベースを設定するだけで、ネイティブコネクタを通じてエンタープライズデータを取得することから、ベクトルストアの管理まで、その後のすべての処理をサービスが自動的に担当してくれます。
ACL サポート付きのネイティブエンタープライズコネクタ
Managed Knowledge Base には、Amazon S3、Microsoft SharePoint、Atlassian Confluence、Google Drive、Microsoft OneDrive、そして Web クローラーの 6 つのコネクタが標準で用意されています。また、対応するソースに存在しないドキュメントを直接取り込むための API も提供しており、柔軟なデータ連携が可能です。
Sync(同期)処理は、変更されたファイルや新規ファイルのみを対象とするため、処理時間の短縮、コスト削減、そして情報の鮮度維持を実現しています。

Managed Knowledge Base では、既存の検索前フィルタリングに加え、リアルタイムでのアクセス制御リスト(ACL)チェックをセキュリティ層として追加しています。検索前にフィルタリングされたドキュメントは、API 呼び出しの期間中のみ一時的に存在し、大規模言語モデル(LLM)やユーザーには表示されません。
この仕組みにより、古くなったりマッピングが正しくなかったりする ACL データに依存するのではなく、クエリ実行時に権限情報源と直接照合することで、最新のアクセス制御を確実に維持します。
シンゲンタグループは、Bedrock Managed Knowledge Bases を活用し、従業員がオンデマンドでナレッジベースを構築できるようにしています。SharePoint や Confluence からのデータ同期により、社内検索やエージェント型 RAG アプリケーションの基盤となっています。
– ジェイソン・クローン氏(データおよび AI テクノロジー担当責任者)
MRH トロウエは、Bedrock Managed Knowledge Bases を活用した内部 AI コパイロットを運用しています。これにより、従業員は社内のナレッジベース全体から、即座に根拠のある回答を得ることができます。対象となるのは Confluence や SharePoint に保存された数千件の文書で、英語とドイツ語の両方に対応しています。ネイティブコネクタと組み込みのアクセス制御機能を活用することで、カスタムの検索パイプラインを構築することなく、社内規定や顧客ドキュメント、業務関連コンテンツを検索可能に。これにより、従業員が顧客対応に必要な知識へ迅速にアクセスできる環境を整えています。
– マルテ・ポッリー博士(データ分析および AI チームリーダー)
多様なデータ形式の解析
データは、Web アプリケーション内の機械可読コンテンツから、PDF や PPTX、DOCX といった埋め込み画像を含むデジタルファイル、スキャンされた文書、さらに音声や動画などのメディアまで、多種多様なフォーマットに散在しています。それぞれの形式ごとに個別のパイプラインを構築するのではなく、Managed Knowledge Base はコンテンツの種類に応じて最適な解析戦略を自動的に選択する、完全マネージド型の解析機能を提供します。
テーブル、グラフ、図表、複雑なレイアウト、そしてメディアコンテンツの処理も、ユーザーが設定を行う必要はありません。このサービスは、最大 500 MB の画像を含む文書(PDF、PPT/PPTX、DOCX)、最大 2 GB の音声ファイル、そして最大 10 GB の動画ファイルをサポートしています。

解析が完了すると、サービスは検索可能なセグメントへとデータを分割します。デフォルトでは、Managed Knowledge Base がデータに最も適したチャンキング(分割)戦略を自動的に決定します。もしデータの特性を理解しており、より細かな制御を行いたい場合は、固定サイズのトークン数で分割する「固定サイズ・チャンキング」や、すでに前処理済みまたは分割済みの文書に対しては「チャンキングなし」といったカスタム戦略を選択することも可能です。
サービス管理型データストレージ
知識検索パイプラインにおいて、セマンティック検索用データベースの選定は最も複雑な判断の一つです。各選択肢には、パフォーマンス特性や課金モデル、スケーリング能力、機能セットなどが異なります。一度選択した後も、容量の割り当て、インデックス設定、バックアップ管理、そして時間経過に伴う性能チューニングなど、多くの作業が残ります。
Managed Knowledge Base(マネージド・ナレッジベース)は、こうした手間をすべて不要にする統合ストレージ層を提供します。このサービスはストレージを自動でプロビジョニングするため、ベクトルの次元や類似度計算の指標を手動で指定する必要はありません。また、ギガバイトからテラバイト規模まで、介入なしに自動的にスケールします。キーワード検索とセマンティック検索を組み合わせたハイブリッド検索も常時有効になっており、別途インデックスを設定して管理する必要もありません。データは、AWS Key Management Service (AWS KMS) のキー(AWS 管理型または顧客管理型のいずれか)を用いて、保存時および転送時に暗号化されます。
ユーザーが直接基盤となるストレージと対話することはありません。監視、チューニング、バックアップ、パッチ適用、容量管理といった作業はすべて AWS サービス側で自動的に処理されます。
*OpenAI は、Bedrock Managed Knowledge Base の RAG 機能を活用し、数百万人のユーザーに対して、適切な顧客コンテキストを反映した信頼性の高い推論とモデル応答を実現しています。*
– Lavanya Singh, OpenAI テクニカルスタッフ
3 ステップでセットアップ
プログラムを通じて管理型ナレッジベースを構築する方法を見ていきましょう。必要な API コールはたったの 3 つです。まずはナレッジベースを作成し、次にデータソースを追加して、最後に取り込み(インジェスト)を開始するだけです。
以下の例では、Amazon S3 をデータソースとして使用し、完全に管理された埋め込みモデルを採用しています。この構成では、モデルの Amazon Resource Name (ARN) やベクトルストア、チャンキング設定を手動で指定する必要はありません。
import boto3
bedrock_agent = boto3.client('bedrock-agent', region_name='us-west-2')
# ステップ 1: 完全管理型のナレッジベースを作成(ゼロ構成)
kb_response = bedrock_agent.create_knowledge_base(
name='my-managed-kb',
description='Product documentation knowledge base',
roleArn='arn:aws:iam::123456789012:role/BedrockKBRole',
knowledgeBaseConfiguration={
'type': 'MANAGED',
'managedKnowledgeBaseConfiguration': {
'embeddingModelType': 'MANAGED'
}
}
)
kb_id = kb_response['knowledgeBase']['knowledgeBaseId']
# ステップ 2: S3 データソースを追加
ds_response = bedrock_agent.create_data_source(
knowledgeBaseId=kb_id,
name='my-s3-docs',
dataSourceConfiguration={
'type': 'S3',
's3Configuration': {
'bucketArn': 'arn:aws:s3:::amzn-s3-demo-bucket',
'inclusionPrefixes': ['documents/']
}
}
)
data_source_id = ds_response['dataSource']['dataSourceId']
# ステップ 3: 取り込みジョブを開始
bedrock_agent.start_ingestion_job(
knowledgeBaseId=kb_id,
dataSourceId=data_source_id
)より賢い検索
1 回の検索ステップだけですべての質問に答えることはできません。単純な直接照会なら単独でも機能しますが、比較分析や多段階推論、調査系のクエリにはさらに深い処理が必要です。Managed Knowledge Base では、複雑さのレベルに応じて設計された 2 つの検索 API を提供しています。
- Retrieve は、関連度スコアとメタデータ付きでランク付けされたソースチャンクを返します。直接照会や FAQ 形式の質問、低レイテンシが重要なシナリオに適しています。取得結果の数を手動で制御でき、検索範囲を絞り込むためのメタデータフィルタも適用可能です。
- Agentic Retrieval は、基盤モデル(FM)を活用して複雑なクエリをサブクエリに分解します。1 つまたは複数の知識ベースに対して反復的に検索を実行し、取得結果が十分かどうかを評価した上で返却します。また、Managed Orchestration LLM または Amazon Bedrock 上の任意のモデルを用いて、情報を統合した回答も生成できます。比較分析や多段階質問、調査系クエリ、あるいは複数のソースや文書からの情報を統合する必要があるシナリオで威力を発揮します。
Agentic Retrieval の仕組み
製品の比較、複数文書にわたる意思決定の追跡、異なるソースからの研究結果の統合には、複数の検索ステップが必要です。さらに、中間結果を評価し、「これで十分な情報がある」と判断するタイミングを見極めることも不可欠です。
Agentic Retrieval は、1 つまたは複数の知識ベースにまたがってこれらの処理を自動で実行します。クエリが入力されると、サービスは以下のように動作します:
クエリを分析して分解し、設定された各ナレッジベースに対して特定の検索を実行するサブクエリを作成します。
複数のナレッジベースに対して並列でサブクエリを実行し、結果を取得します。
取得した結果が十分かどうかを評価します。不十分な場合は、追加の検索ラウンドを計画・実行します(デフォルトでは最大 5 回まで)。
すべての反復処理から重複を除いたチャンクを返送し、追跡イベントをストリーミングして完全な可視性を確保します。
ユースケースに応じて、精度とレイテンシのバランスを調整できます。maxAgentIteration パラメータでモデルが実行する検索ラウンド数を制御し、計画と評価に使用するファウンデーションモデルを選択できます。
以下のコードは、エージェント型検索(Agentic Retrieval)の呼び出し例とそのストリーミング応答の処理を示しています。リクエストでは、ユーザーのクエリ、検索対象のナレッジベース、計画・評価用のファウンデーションモデル、および最大検索反復回数を指定します。サービス実行中は、各計画ステップとサブクエリの実行状況を示す追跡イベントがストリーミングされ、最終的な検索結果が表示されます:
bedrock_runtime = boto3.client('bedrock-agent-runtime', region_name='us-west-2')
Amazon Bedrock の Managed Knowledge Base を活用し、エージェント向けの企業検索機能を構築する方法について解説します(10 月 14 日更新)。
以下は、製品 A と B の価格比較を要求するユーザーのメッセージに基づき、Bedrock Runtime がエージェント検索ストリームを実行するコード例です。この処理では、指定された Knowledge Base から最大 10 件の結果を取得し、Anthropic の Claude Sonnet モデル(arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-sonnet-4-20250514)を基盤モデルとして使用します。エージェントの反復回数は最大 5 回(デフォルト値、範囲は 1〜10)に設定されています。
response = bedrock_runtime.agentic_retrieve_stream(
messages=[{
'role': 'user',
'content': [{'text': 'Compare the pricing tiers of Product A and Product B'}]
}],
retrievers=[{
'knowledgeBaseRetriever': {
'knowledgeBaseId': kb_id,
'maxResults': 10
}
}],
agenticRetrieveConfiguration={
'foundationModel': {
'modelArn': 'arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-sonnet-4-20250514'
},
'maxAgentIteration': 5 # 1-10, default 5
}
)
# Trace events stream in real time, then final results arrive
for event in response['stream']:
if 'trace' in event:
trace = event['trace']
if 'planning' in trace:
print(f"Planning: {len(trace['planning'].get('actions', []))} sub-queries")
elif 'retrieval' in trace:
print(f"Retrieving: {trace['retrieval'].get('input', {}).get('text', '')}")
elif 'retrievalResults' in event:
results = event['retrievalResults']['results']
print(f"\n{len(results)} deduplicated results returned")
for i, r in enumerate(results[:5], 1):
print(f" {i}. {r['content']['text'][:150]}...")
このコードでは、ストリームからリアルタイムでトレースイベントを監視し、最終結果が到着する様子を出力します。具体的には、エージェントの「計画」段階で生成されたサブクエリの数や、「検索」段階で入力されたテキスト内容を確認できます。また、検索結果が返却される際には、重複を除いた結果件数が表示され、先頭 5 件のコンテンツ(各 150 文字以内)がリスト形式で出力されます。
このように、Managed Knowledge Base を用いることで、エージェントが複雑なタスクを分解し、必要な情報を効率的に取得・統合するプロセスを可視化しながら制御することが可能になります。
## 本番環境対応
Retrieval Augmented Generation (RAG) のプロトタイプを動かすことと、適切なアクセス制御や可視性(オバザビリティ)、セキュリティを備えた状態で大規模運用を開始することは、別問題です。多くのチームが後者の段階でつまずきます。
Managed Knowledge Base には、AgentCore Gateway [への統合](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway.html) やドキュメントレベルのアクセス制御、可視性機能が標準で備わっています。これらのレイヤーを自前で構築する必要なく、すぐにデプロイ可能です。
## AgentCore Gateway とのネイティブ統合
Managed Knowledge Base は AgentCore Gateway とネイティブに連携しており、知識ベースをエージェントへ公開するためのスムーズな手段を提供します。Gateway 上で知識ベースをターゲットとして追加すると、Model Context Protocol (MCP) に準拠したエージェントがそれを自動的に検出し、呼び出せるツールとなります。
AWS の [Identity and Access Management](https://aws.amazon.com/iam/)(IAM)やルーティング、可視性は Gateway 上で一元管理されます。また、ユースケースによってはアプリケーション側から直接検索 API を呼び出すことで、Managed Knowledge Base をスタンドアローンで利用することも可能です。
AgentCore Gateway は、Managed Knowledge Base の統合に以下の機能を追加します:
インフラの抽象化:基盤となる知識ベース ID はゲートウェイの背後に隠されるため、エージェントは名前だけでツールを発見・呼び出すことができます。これにより、エージェントコードと基盤インフラが切り離されます。
フレームワークとの互換性:エージェントは標準化された MCP エンドポイントを通じて相互作用するため、Strands や LangChain、CrewAI といった MCP 対応フレームワークと知識ベースを即座に連携させることが可能です。
統一されたアクセスポイント:組織全体で単一のゲートウェイ URL を知識ベースのアクセスポイントとして利用できます。これにより、エージェントの設定やガバナンスが大幅に簡素化されます。
集中管理によるセキュリティ:個別の知識ベースごとの権限管理ではなく、ゲートウェイレベルでの IAM ポリシーを採用します。これにより、セキュリティの適用、アクセス監査、スケーリング管理を一元で実行できます。
運用の透明性:監視機能、ルーティング、認証はすべてシステムが自動的に処理するため、エージェントコードを一行も変更せずに、知識ベースの追加・置換やスケールアップが可能になります。

ゲートウェイを作成し、知識ベースをターゲットとして追加した後、MCP 対応のエージェントフレームワークは、基盤となる知識ベース ID を知らなくても発見・呼び出しが可能になります。
```python
from strands.tools.mcp import MCPClient
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_clientmcp_client = MCPClient(lambda: aws_iam_streamablehttp_client(
endpoint=gateway_url,
aws_region='us-west-2',
aws_service='bedrock-agentcore',
))
with mcp_client:
# KB tools are auto-discovered via MCP
tools = mcp_client.list_tools_sync()
print(f"Available tools: {[t.tool_name for t in tools]}")
# Retrieve (the agent never sees the KB ID)
result = mcp_client.call_tool_sync(
'tool_call_1',
tools[0].tool_name,
{'retrievalQuery': {'text': 'What is our total revenue?'}},
)
このパターンは、Strands、LangChain、CrewAI、あるいは他の MCP 対応フレームワークでも動作します。ゲートウェイが IAM(アイアム)、ルーティング、観測性をシームレスに処理する仕組みです。
*ソニーグループでは、Amazon Bedrock AgentCore を活用したエージェント型チャットプラットフォームを構築しています。これにより、チームは複雑な企業コンテンツや最新のウェブ情報から信頼できる回答を得られるようになります。Bedrock Managed Knowledge Base と Web Search が AgentCore のツールとして利用可能になったことで、エージェントは内部の PDF やプレゼン資料、スプレッドシート、グラフ、表などを横断して推論できるようになりました。単なるベクトル検索を超え、データを AWS 内に保持したまま最新のウェブ情報を根拠に回答を生成します。社内知識とウェブ情報の両方に対応できる、一つの体験を提供するのです*。
– Masahiro Oba, ソニーグループ株式会社 シニアゼネラルマネージャー
オブザーバビリティ
SDK を通じてでもゲートウェイ経由であっても、すべてのナレッジベースへのクエリは自動的に AWS/Bedrock/KnowledgeBases 名前空間下の Amazon CloudWatch にメトリクスを公開します。具体的には、呼び出し回数やクライアント・サーバー側のエラー、スロットリング(過負荷による制限)などのデータが取得可能です。
特に Agentic Retrieval(エージェント型検索)においては、計画ステップ、サブクエリ、評価ラウンドなど、各処理の詳細なトレースイベントがリアルタイムでストリーミングされます。これにより、インストルメンテーションコードを記述することなく、検索プロセス全体を可視化できます。
完全なエンドツーエンドの解説については、GitHub 上の ノートブック をご覧ください。
Managed Knowledge Base の位置づけ
AWS には、エージェントや生成 AI アプリケーション、RAG パイプラインの基盤となる知識検索を構築するための複数の選択肢が用意されています。どのオプションを選ぶべきかは、「自分で制御したい範囲」と「管理(マネージド)に任せたい範囲」のバランスによって決まります。
以下の図は、Managed Knowledge Base がそのスペクトラム上でどのような位置を占めているかを示しています。これは、最高レベルの抽象化を提供する Amazon Quick から、ゼロから RAG パイプラインを構築する場合までを横断したものです。

もしあなたが
原文を表示
Knowledge bases that ground agents and generative AI applications over your enterprise data are hard to build at scale. Teams typically stitch together connectors, parsers, vector stores, knowledge graphs, and retrieval logic, then operationalize all of it for production. Each piece brings its own challenges. You must decide which data sources to connect and how to parse multimodal document types. You must choose between graph and vector databases, then provision and scale them. You must also handle complex queries that reason across diverse content, and layer on the document-level access control, observability, and security that production demands.
Amazon Bedrock now offers Managed Knowledge Base in general availability, a fully managed agentic retrieval solution that handles scaling, high-accuracy retrieval, and document access control on your behalf. You can connect your enterprise data sources or crawl the web and start ingesting. Getting started through the AWS Management Console requires no model selection. Sensible defaults take you from zero to your first retrieval in minutes, compared to the days or weeks typically needed to assemble a comparable pipeline from scratch. When you’re ready to customize, you have control over embedding models, rerankers, chunking strategies, and more.
In this post, we walk through the three pillars that make this possible: simplified setup, smarter retrieval, and production readiness. We also show you code examples for setting up a knowledge base and retrieving from it.
Simplified setup
Developers today typically procure and build data ingestion pipelines, vector or graph storage, and retrieval infrastructure separately. This means managing separate infrastructure, separate billing models, separate rate limits, and the complexity of piecing it all together into a coherent pipeline.
Managed Knowledge Base abstracts this complexity away. You configure a knowledge base, and the service handles everything downstream, from ingesting enterprise data through native connectors to managing vector stores on your behalf.
Native enterprise connectors with ACL support
Managed Knowledge Base includes six native connectors (Amazon Simple Storage Service (Amazon S3), Microsoft SharePoint, Atlassian Confluence, Google Drive, Microsoft OneDrive, and Web Crawler). It also includes a direct ingestion API for documents that don’t live in a supported source. On subsequent syncs, the service processes only modified or new documents, reducing time, cost, and staleness.

Managed Knowledge Base uses real-time access control list (ACL) checks as an additional layer of security on top of existing pre-retrieval ACL filtering. The pre-filtered documents are transient for the life of the API call and are not visible to large language models (LLMs) or users. This maintains current access controls by checking permissions directly with the authoritative source at query time, rather than relying on potentially stale or incorrectly mapped ACL data.
Syngenta Group uses Bedrock Managed Knowledge Bases to enable employees to create knowledge bases on demand, syncing data from SharePoint and Confluence for internal knowledge search and agentic RAG applications. – Jason Krohn, Head of Data and AI Technology
MRH Trowe is using Bedrock Managed Knowledge Bases to power an internal AI Copilot that gives employees instant, grounded answers from across our corporate knowledge base — spanning thousands of documents in Confluence and SharePoint, in both English and German. With native connectors and built-in access controls, our teams can search across policies, client documentation, and operational content without building custom retrieval pipelines — accelerating how our employees access the knowledge they need to serve clients. – Dr. Malte Polley, Teamleader Data Analytics & AI
Parsing across multimodal data
Your data fragments across many formats: machine-readable content in web applications, digital files containing embedded images like PDFs, PPTX, and DOCX, scanned documents, and media content such as audio and video. Rather than building separate pipelines for each format, Managed Knowledge Base provides fully managed parsing that automatically selects the right strategy per content type. It handles tables, charts, diagrams, mixed layouts, and media without configuration from you. The service supports visual content documents (PDFs, PPT/PPTX, DOCX) up to 500 MB, audio files up to 2 GB, and video files up to 10 GB.

After the service parses content, it splits the content into segments for retrieval. By default, Managed Knowledge Base decides on the most suitable chunking strategy on your behalf. If you understand your data and want more control, you can choose a custom strategy like fixed-size chunking, where you set the approximate token size, or no chunking, for documents that are already pre-processed or pre-split.
Service-managed data storage
Choosing a semantic retrieval database is one of the most complex decisions in a knowledge retrieval pipeline. Each option has different performance profiles, pricing models, scaling characteristics, and feature sets. After you choose, you must still provision capacity, configure indices, manage backups, and tune performance over time.
Managed Knowledge Base removes that work entirely with a unified storage layer. The service auto-provisions storage so you don’t decide on vector dimensions or similarity metrics, and it auto scales from gigabytes to terabytes without intervention. Hybrid search combining keyword and semantic retrieval is continuously on, with no separate index configuration to manage. Data is encrypted at rest and in transit using AWS Key Management Service (AWS KMS) keys, either AWS managed or customer managed.
You don’t interact with the underlying storage. Your AWS services handle monitoring, tuning, backups, patching, and capacity management for you.
OpenAI is using Bedrock Managed Knowledge Bases’ RAG capabilities to ground inference and model responses, reliably and at scale for millions of users, with the right customer context. – Lavanya Singh, Member of Technical Staff, OpenAI
Setup in three steps
Let’s look at how to set up a managed knowledge base programmatically. Three API calls are all it takes: create the knowledge base, add a data source, and start ingestion. The following example uses Amazon S3 as the data source with a fully managed embedding model, with no model Amazon Resource Name (ARN), vector store, or chunking configuration required.
import boto3
bedrock_agent = boto3.client('bedrock-agent', region_name='us-west-2')
# Step 1: Create a fully managed knowledge base (zero-config)
kb_response = bedrock_agent.create_knowledge_base(
name='my-managed-kb',
description='Product documentation knowledge base',
roleArn='arn:aws:iam::123456789012:role/BedrockKBRole',
knowledgeBaseConfiguration={
'type': 'MANAGED',
'managedKnowledgeBaseConfiguration': {
'embeddingModelType': 'MANAGED'
}
}
)
kb_id = kb_response['knowledgeBase']['knowledgeBaseId']
# Step 2: Add an S3 data source
ds_response = bedrock_agent.create_data_source(
knowledgeBaseId=kb_id,
name='my-s3-docs',
dataSourceConfiguration={
'type': 'S3',
's3Configuration': {
'bucketArn': 'arn:aws:s3:::amzn-s3-demo-bucket',
'inclusionPrefixes': ['documents/']
}
}
)
data_source_id = ds_response['dataSource']['dataSourceId']
# Step 3: Start ingestion
bedrock_agent.start_ingestion_job(
knowledgeBaseId=kb_id,
dataSourceId=data_source_id
)Smarter retrieval
A single retrieval step can’t answer every question. Direct lookups work fine on their own, but comparative analysis, multi-hop reasoning, and research queries need more. Managed Knowledge Base offers two retrieval APIs, each designed for different complexity levels:
- Retrieve returns ranked source chunks with relevance scores and metadata. Use it for direct lookups, FAQ-style questions, and scenarios where low latency is critical. You control the number of results and can apply metadata filters to narrow the search.
- Agentic Retrieval uses a foundation model (FM) to decompose complex queries into sub-queries. It retrieves iteratively across one or more knowledge bases and evaluates whether the results are sufficient before returning them. Agentic Retrieval can also generate a synthesized response using the managed orchestration LLM or a model available on Amazon Bedrock. Use it for comparative analysis, multi-hop questions, research queries, and scenarios that require synthesizing information from multiple sources or documents.
How Agentic Retrieval works
Comparing two products, tracing a decision across multiple documents, or synthesizing research from different sources requires multiple retrieval steps. You also need to evaluate intermediate results and recognize when you have enough information.
Agentic Retrieval handles this automatically, across one or more knowledge bases. When a query comes in, the service:
- Plans by analyzing the query and decomposing it into sub-queries, each targeting a specific retriever across your configured knowledge bases.
- Retrieves by executing sub-queries in parallel against one or multiple knowledge bases.
- Evaluates whether the results are sufficient. If not, it plans and executes additional retrieval rounds (up to five by default).
- Returns deduplicated chunks from all iterations, with trace events streaming throughout for full observability.
You can balance accuracy and latency for your use case. The maxAgentIteration parameter controls how many rounds the model performs, and you select the foundation model used for planning and evaluation.
The following code shows an example of invoking Agentic Retrieval and processing its streaming response. The request specifies the user’s query, the knowledge base to search, the foundation model to use for planning and evaluation, and the maximum number of retrieval iterations. As the service runs, it streams trace events that show each planning step and sub-query being executed, followed by the final retrieval results:
bedrock_runtime = boto3.client('bedrock-agent-runtime', region_name='us-west-2')
response = bedrock_runtime.agentic_retrieve_stream(
messages=[{
'role': 'user',
'content': [{'text': 'Compare the pricing tiers of Product A and Product B'}]
}],
retrievers=[{
'knowledgeBaseRetriever': {
'knowledgeBaseId': kb_id,
'maxResults': 10
}
}],
agenticRetrieveConfiguration={
'foundationModel': {
'modelArn': 'arn:aws:bedrock:us-west-2::foundation-model/anthropic.claude-sonnet-4-20250514'
},
'maxAgentIteration': 5 # 1-10, default 5
}
)
# Trace events stream in real time, then final results arrive
for event in response['stream']:
if 'trace' in event:
trace = event['trace']
if 'planning' in trace:
print(f"Planning: {len(trace['planning'].get('actions', []))} sub-queries")
elif 'retrieval' in trace:
print(f"Retrieving: {trace['retrieval'].get('input', {}).get('text', '')}")
elif 'retrievalResults' in event:
results = event['retrievalResults']['results']
print(f"\n{len(results)} deduplicated results returned")
for i, r in enumerate(results[:5], 1):
print(f" {i}. {r['content']['text'][:150]}...")Production ready
Getting a Retrieval Augmented Generation (RAG) prototype working is one thing. Operating it at scale with proper access control, observability, and security is where many teams stall. Managed Knowledge Base includes AgentCore Gateway integration, document-level access control, and observability out of the box, so you can deploy without building these layers yourself.
Native AgentCore Gateway integration
Managed Knowledge Bases integrates natively with AgentCore Gateway, giving you a streamlined way to expose your knowledge base to agents. When you add your knowledge base as a target on the gateway, it becomes a tool that agents compatible with the Model Context Protocol (MCP) can discover and invoke automatically. AWS Identity and Access Management (IAM), routing, and observability are centralized at the gateway. You can also use Managed Knowledge Bases standalone by calling the retrieval APIs directly from your application if that better suits your use case.
AgentCore Gateway adds the following to your Managed Knowledge Bases integration:
- Abstracted infrastructure: Knowledge base IDs are hidden behind the gateway, so agents simply discover and call tools by name, decoupling your agent code from underlying infrastructure.
- Framework compatibility: Agents interact through a standardized MCP endpoint, making your knowledge bases instantly compatible with MCP-aware frameworks, including Strands, LangChain, and CrewAI.
- Unified access point: A single gateway URL becomes the access point for your knowledge bases across your organization, simplifying agent configuration and governance.
- Centralized security: IAM policy at the gateway level replaces per-knowledge-base permissions management, giving you one place to enforce security, audit access, and manage scale.
- Transparent operations: Built-in observability, routing, and authentication are handled for you, so you can add, swap, or scale knowledge bases without changing a single line of agent code.

After you create a gateway and add your knowledge base as a target, MCP-compatible agent frameworks can discover and invoke it without knowing the underlying knowledge base ID:
from strands.tools.mcp import MCPClient
from mcp_proxy_for_aws.client import aws_iam_streamablehttp_client
mcp_client = MCPClient(lambda: aws_iam_streamablehttp_client(
endpoint=gateway_url,
aws_region='us-west-2',
aws_service='bedrock-agentcore',
))
with mcp_client:
# KB tools are auto-discovered via MCP
tools = mcp_client.list_tools_sync()
print(f"Available tools: {[t.tool_name for t in tools]}")
# Retrieve (the agent never sees the KB ID)
result = mcp_client.call_tool_sync(
'tool_call_1',
tools[0].tool_name,
{'retrievalQuery': {'text': 'What is our total revenue?'}},
)This pattern works with Strands, LangChain, CrewAI, or other MCP-compatible frameworks. The gateway handles IAM, routing, and observability transparently.
At Sony, we’re building an agentic chat platform on Amazon Bedrock AgentCore to help teams get trusted answers from complex enterprise content and live web information. With Bedrock Managed Knowledge Base and Web Search now available as tools in AgentCore, our agents can reason across internal PDFs, presentations, spreadsheets, charts, and tables, going beyond simple vector retrieval, and ground responses in current web information while keeping our data within AWS. The result is a single experience for answering questions across internal knowledge and the web – Masahiro Oba, Senior General Manager, Sony Group Corporation
Observability
Every knowledge base query, whether through the SDK or the gateway, automatically publishes metrics to Amazon CloudWatch under the AWS/Bedrock/KnowledgeBases namespace, including invocations, client and server errors, and throttles. For Agentic Retrieval, trace events stream in real time, showing each planning step, sub-query, and evaluation round. This gives you full visibility into the retrieval process without writing instrumentation code.
For a complete end-to-end walkthrough, check out the notebook on GitHub.
Where Managed Knowledge Base fits
AWS offers multiple options for building the knowledge retrieval that grounds agents, generative AI applications, and RAG pipelines. The right choice depends on how much control you need versus how much you want managed for you. The following diagram shows where Managed Knowledge Base sits along that spectrum, from the highest level of abstraction (Amazon Quick) to building your own RAG pipeline from scratch.

If you need
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み