Gemini Deep Research エージェントは、複数ステップの調査タスクを自律的に計画、実行、統合します。Gemini 3 Pro を搭載し、ウェブ検索とユーザー自身のデータを使用して複雑な情報環境をナビゲートし、引用文献が記載された詳細なレポートを作成します。
リサーチのタスクには、反復的な検索と読み取りが含まれ、完了までに数分かかることがあります。エージェントを非同期で実行して結果をポーリングするには、バックグラウンド実行(background=true を設定)を使用する必要があります。詳細については、長時間実行タスクの処理をご覧ください。
次の例は、バックグラウンドでリサーチ タスクを開始し、結果をポーリングする方法を示しています。
Python
import time
from google import genai
client = genai.Client()
interaction = client.interactions.create(
input="Research the history of Google TPUs.",
agent='deep-research-pro-preview-12-2025',
background=True
)
print(f"Research started: {interaction.id}")
while True:
interaction = client.interactions.get(interaction.id)
if interaction.status == "completed":
print(interaction.outputs[-1].text)
break
elif interaction.status == "failed":
print(f"Research failed: {interaction.error}")
break
time.sleep(10)
JavaScript
import { GoogleGenAI } from '@google/genai';
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
input: 'Research the history of Google TPUs.',
agent: 'deep-research-pro-preview-12-2025',
background: true
});
console.log(`Research started: ${interaction.id}`);
while (true) {
const result = await client.interactions.get(interaction.id);
if (result.status === 'completed') {
console.log(result.outputs[result.outputs.length - 1].text);
break;
} else if (result.status === 'failed') {
console.log(`Research failed: ${result.error}`);
break;
}
await new Promise(resolve => setTimeout(resolve, 10000));
}
REST
# 1. Start the research task
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"input": "Research the history of Google TPUs.",
"agent": "deep-research-pro-preview-12-2025",
"background": true
}'
# 2. Poll for results (Replace INTERACTION_ID)
# curl -X GET "https://generativelanguage.googleapis.com/v1beta/interactions/INTERACTION_ID" \
# -H "x-goog-api-key: $GEMINI_API_KEY"
独自のデータでリサーチする
Deep Research はさまざまなツールにアクセスできます。デフォルトでは、エージェントは google_search ツールと url_context ツールを使用して、一般公開されているインターネット上の情報にアクセスできます。デフォルトでは、これらのツールを指定する必要はありません。ただし、ファイル検索ツールを使用してエージェントに独自のデータへのアクセス権を付与する場合は、次の例に示すように追加する必要があります。
Python
import time
from google import genai
client = genai.Client()
interaction = client.interactions.create(
input="Compare our 2025 fiscal year report against current public web news.",
agent="deep-research-pro-preview-12-2025",
background=True,
tools=[
{
"type": "file_search",
"file_search_store_names": ['fileSearchStores/my-store-name']
}
]
)
JavaScript
const interaction = await client.interactions.create({
input: 'Compare our 2025 fiscal year report against current public web news.',
agent: 'deep-research-pro-preview-12-2025',
background: true,
tools: [
{ type: 'file_search', file_search_store_names: ['fileSearchStores/my-store-name'] },
]
});
REST
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"input": "Compare our 2025 fiscal year report against current public web news.",
"agent": "deep-research-pro-preview-12-2025",
"background": true,
"tools": [
{"type": "file_search", "file_search_store_names": ["fileSearchStores/my-store-name"]},
]
}'
操作性と書式設定
プロンプトで特定の形式の指示を指定することで、エージェントの出力を制御できます。これにより、レポートを特定のセクションやサブセクションに構成したり、データテーブルを含めたり、さまざまなユーザーに合わせてトーンを調整したりできます(例:「技術」、「エグゼクティブ」、「カジュアル」)。
入力テキストで目的の出力形式を明示的に定義します。
Python
prompt = """
Research the competitive landscape of EV batteries.
Format the output as a technical report with the following structure:
1. Executive Summary
2. Key Players (Must include a data table comparing capacity and chemistry)
3. Supply Chain Risks
"""
interaction = client.interactions.create(
input=prompt,
agent="deep-research-pro-preview-12-2025",
background=True
)
JavaScript
const prompt = `
Research the competitive landscape of EV batteries.
Format the output as a technical report with the following structure:
1. Executive Summary
2. Key Players (Must include a data table comparing capacity and chemistry)
3. Supply Chain Risks
`;
const interaction = await client.interactions.create({
input: prompt,
agent: 'deep-research-pro-preview-12-2025',
background: true,
});
REST
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"input": "Research the competitive landscape of EV batteries.\n\nFormat the output as a technical report with the following structure: \n1. Executive Summary\n2. Key Players (Must include a data table comparing capacity and chemistry)\n3. Supply Chain Risks",
"agent": "deep-research-pro-preview-12-2025",
"background": true
マルチモーダル入力
Deep Research は、画像、PDF、音声、動画などのマルチモーダル入力をサポートしています。これにより、エージェントはリッチ コンテンツを分析し、提供された入力によってコンテキスト化されたウェブベースの調査を実施できます。たとえば、写真を提供して、被写体の特定、行動の調査、関連情報の検索をエージェントに依頼できます。
次の例は、画像 URL を使用した画像分析リクエストを示しています。
Python
import time
from google import genai
client = genai.Client()
prompt = '''Analyze the interspecies dynamics and behavioral risks present
in the provided image of the African watering hole. Specifically, investigate
the symbiotic relationship between the avian species and the pachyderms
shown, and conduct a risk assessment for the reticulated giraffes based on
their drinking posture relative to the specific predator visible in the
foreground.'''
interaction = client.interactions.create(
input=[
{"type": "text", "text": prompt},
{
"type": "image",
"uri": "https://storage.googleapis.com/generativeai-downloads/images/generated_elephants_giraffes_zebras_sunset.jpg"
}
],
agent="deep-research-pro-preview-12-2025",
background=True
)
print(f"Research started: {interaction.id}")
while True:
interaction = client.interactions.get(interaction.id)
if interaction.status == "completed":
print(interaction.outputs[-1].text)
break
elif interaction.status == "failed":
print(f"Research failed: {interaction.error}")
break
time.sleep(10)
JavaScript
import { GoogleGenAI } from '@google/genai';
const client = new GoogleGenAI({});
const prompt = `Analyze the interspecies dynamics and behavioral risks present
in the provided image of the African watering hole. Specifically, investigate
the symbiotic relationship between the avian species and the pachyderms
shown, and conduct a risk assessment for the reticulated giraffes based on
their drinking posture relative to the specific predator visible in the
foreground.`;
const interaction = await client.interactions.create({
input: [
{ type: 'text', text: prompt },
{
type: 'image',
uri: 'https://storage.googleapis.com/generativeai-downloads/images/generated_elephants_giraffes_zebras_sunset.jpg'
}
],
agent: 'deep-research-pro-preview-12-2025',
background: true
});
console.log(`Research started: ${interaction.id}`);
while (true) {
const result = await client.interactions.get(interaction.id);
if (result.status === 'completed') {
console.log(result.outputs[result.outputs.length - 1].text);
break;
} else if (result.status === 'failed') {
console.log(`Research failed: ${result.error}`);
break;
}
await new Promise(resolve => setTimeout(resolve, 10000));
}
REST
# 1. Start the research task with image input
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"input": [
{"type": "text", "text": "Analyze the interspecies dynamics and behavioral risks present in the provided image of the African watering hole. Specifically, investigate the symbiotic relationship between the avian species and the pachyderms shown, and conduct a risk assessment for the reticulated giraffes based on their drinking posture relative to the specific predator visible in the foreground."},
{"type": "image", "uri": "https://storage.googleapis.com/generativeai-downloads/images/generated_elephants_giraffes_zebras_sunset.jpg"}
],
"agent": "deep-research-pro-preview-12-2025",
"background": true
}'
# 2. Poll for results (Replace INTERACTION_ID)
# curl -X GET "https://generativelanguage.googleapis.com/v1beta/interactions/INTERACTION_ID" \
# -H "x-goog-api-key: $GEMINI_API_KEY"
長時間実行タスクの処理
Deep Research は、計画、検索、読解、執筆を含む複数のステップからなるプロセスです。通常、このサイクルは同期 API 呼び出しの標準のタイムアウト上限を超えます。
background=True を使用するには、エージェントが必要です。API は、部分的な Interaction オブジェクトをすぐに返します。id プロパティを使用すると、ポーリング用のインタラクションを取得できます。インタラクションの状態は in_progress から completed または failed に移行します。
ストリーミング
Deep Research は、調査の進捗状況に関するリアルタイムの更新情報を受け取るためのストリーミングをサポートしています。stream=True と background=True を設定する必要があります。
次の例は、リサーチタスクを開始してストリームを処理する方法を示しています。重要なのは、interaction.start イベントから interaction_id をトラッキングする方法を示していることです。ネットワークが中断した場合にストリームを再開するには、この ID が必要になります。このコードでは、切断した特定の時点から再開できる event_id 変数も導入しています。
Python
stream = client.interactions.create(
input="Research the history of Google TPUs.",
agent="deep-research-pro-preview-12-2025",
background=True,
stream=True,
agent_config={
"type": "deep-research",
"thinking_summaries": "auto"
}
)
interaction_id = None
last_event_id = None
for chunk in stream:
if chunk.event_type == "interaction.start":
interaction_id = chunk.interaction.id
print(f"Interaction started: {interaction_id}")
if chunk.event_id:
last_event_id = chunk.event_id
if chunk.event_type == "content.delta":
if chunk.delta.type == "text":
print(chunk.delta.text, end="", flush=True)
elif chunk.delta.type == "thought_summary":
print(f"Thought: {chunk.delta.content.text}", flush=True)
elif chunk.event_type == "interaction.complete":
print("\nResearch Complete")
JavaScript
const stream = await client.interactions.create({
input: 'Research the history of Google TPUs.',
agent: 'deep-research-pro-preview-12-2025',
background: true,
stream: true,
agent_config: {
type: 'deep-research',
thinking_summaries: 'auto'
}
});
let interactionId;
let lastEventId;
for await (const chunk of stream) {
// 1. Capture Interaction ID
if (chunk.event_type === 'interaction.start') {
interactionId = chunk.interaction.id;
console.log(`Interaction started: ${interactionId}`);
}
// 2. Track IDs for potential reconnection
if (chunk.event_id) lastEventId = chunk.event_id;
// 3. Handle Content
if (chunk.event_type === 'content.delta') {
if (chunk.delta.type === 'text') {
process.stdout.write(chunk.delta.text);
} else if (chunk.delta.type === 'thought_summary') {
console.log(`Thought: ${chunk.delta.content.text}`);
}
} else if (chunk.event_type === 'interaction.complete') {
console.log('\nResearch Complete');
}
}
REST
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?alt=sse" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"input": "Research the history of Google TPUs.",
"agent": "deep-research-pro-preview-12-2025",
"background": true,
"stream": true,
"agent_config": {
"type": "deep-research",
"thinking_summaries": "auto"
}
}'
# Note: Look for the 'interaction.start' event to get the interaction ID.
ストリームに再接続しています
長時間実行される調査タスク中にネットワークが中断されることがあります。この問題を適切に処理するには、アプリケーションで接続エラーをキャッチし、client.interactions.get() を使用してストリームを再開する必要があります。
再開するには、次の 2 つの値を指定する必要があります。
- Interaction ID: 初期ストリームの
interaction.startイベントから取得されます。 - Last Event ID: 最後に正常に処理されたイベントの ID。これにより、サーバーは、その特定のポイントの後にイベントの送信を再開します。指定しない場合は、ストリームの先頭が返されます。
次の例は、復元力のあるパターンを示しています。最初の create リクエストのストリーミングを試み、接続が切断された場合は get ループにフォールバックします。
Python
import time
from google import genai
client = genai.Client()
# Configuration
agent_name = 'deep-research-pro-preview-12-2025'
prompt = 'Compare golang SDK test frameworks'
# State tracking
last_event_id = None
interaction_id = None
is_complete = False
def process_stream(event_stream):
"""Helper to process events from any stream source."""
global last_event_id, interaction_id, is_complete
for event in event_stream:
# Capture Interaction ID
if event.event_type == "interaction.start":
interaction_id = event.interaction.id
print(f"Interaction started: {interaction_id}")
# Capture Event ID
if event.event_id:
last_event_id = event.event_id
# Print content
if event.event_type == "content.delta":
if event.delta.type == "text":
print(event.delta.text, end="", flush=True)
elif event.delta.type == "thought_summary":
print(f"Thought: {event.delta.content.text}", flush=True)
# Check completion
if event.event_type in ['interaction.complete', 'error']:
is_complete = True
# 1. Attempt initial streaming request
try:
print("Starting Research...")
initial_stream = client.interactions.create(
input=prompt,
agent=agent_name,
background=True,
stream=True,
agent_config={
"type": "deep-research",
"thinking_summaries": "auto"
}
)
process_stream(initial_stream)
except Exception as e:
print(f"\nInitial connection dropped: {e}")
# 2. Reconnection Loop
# If the code reaches here and is_complete is False, we resume using .get()
while not is_complete and interaction_id:
print(f"\nConnection lost. Resuming from event {last_event_id}...")
time.sleep(2)
try:
resume_stream = client.interactions.get(
id=interaction_id,
stream=True,
last_event_id=last_event_id
)
process_stream(resume_stream)
except Exception as e:
print(f"Reconnection failed, retrying... ({e})")
JavaScript
let lastEventId;
let interactionId;
let isComplete = false;
// Helper to handle the event logic
const handleStream = async (stream) => {
for await (const chunk of stream) {
if (chunk.event_type === 'interaction.start') {
interactionId = chunk.interaction.id;
}
if (chunk.event_id) lastEventId = chunk.event_id;
if (chunk.event_type === 'content.delta') {
if (chunk.delta.type === 'text') {
process.stdout.write(chunk.delta.text);
} else if (chunk.delta.type === 'thought_summary') {
console.log(`Thought: ${chunk.delta.content.text}`);
}
} else if (chunk.event_type === 'interaction.complete') {
isComplete = true;
}
}
};
// 1. Start the task with streaming
try {
const stream = await client.interactions.create({
input: 'Compare golang SDK test frameworks',
agent: 'deep-research-pro-preview-12-2025',
background: true,
stream: true,
agent_config: {
type: 'deep-research',
thinking_summaries: 'auto'
}
});
await handleStream(stream);
} catch (e) {
console.log('\nInitial stream interrupted.');
}
// 2. Reconnect Loop
while (!isComplete && interactionId) {
console.log(`\nReconnecting to interaction ${interactionId} from event ${lastEventId}...`);
try {
const stream = await client.interactions.get(interactionId, {
stream: true,
last_event_id: lastEventId
});
await handleStream(stream);
} catch (e) {
console.log('Reconnection failed, retrying in 2s...');
await new Promise(resolve => setTimeout(resolve, 2000));
}
}
REST
# 1. Start the research task (Initial Stream)
# Watch for event: interaction.start to get the INTERACTION_ID
# Watch for "event_id" fields to get the LAST_EVENT_ID
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions?alt=sse" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"input": "Compare golang SDK test frameworks",
"agent": "deep-research-pro-preview-12-2025",
"background": true,
"stream": true,
"agent_config": {
"type": "deep-research",
"thinking_summaries": "auto"
}
}'
# ... Connection interrupted ...
# 2. Reconnect (Resume Stream)
# Pass the INTERACTION_ID and the LAST_EVENT_ID you saved.
curl -X GET "https://generativelanguage.googleapis.com/v1beta/interactions/INTERACTION_ID?stream=true&last_event_id=LAST_EVENT_ID&alt=sse" \
-H "x-goog-api-key: $GEMINI_API_KEY"
フォローアップの質問とやり取り
エージェントが最終レポートを返した後に会話を続けるには、previous_interaction_id を使用します。これにより、タスク全体を再開することなく、調査の特定のセクションについて説明、要約、詳細を求めることができます。
Python
import time
from google import genai
client = genai.Client()
interaction = client.interactions.create(
input="Can you elaborate on the second point in the report?",
model="gemini-3-pro-preview",
previous_interaction_id="COMPLETED_INTERACTION_ID"
)
print(interaction.outputs[-1].text)
JavaScript
const interaction = await client.interactions.create({
input: 'Can you elaborate on the second point in the report?',
agent: 'deep-research-pro-preview-12-2025',
previous_interaction_id: 'COMPLETED_INTERACTION_ID'
});
console.log(interaction.outputs[-1].text);
REST
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"input": "Can you elaborate on the second point in the report?",
"agent": "deep-research-pro-preview-12-2025",
"previous_interaction_id": "COMPLETED_INTERACTION_ID"
}'
Gemini Deep Research エージェントを使用する場合
Deep Research は単なるモデルではなく、エージェントです。低レイテンシのチャットではなく、「アナリスト イン ア ボックス」のアプローチを必要とするワークロードに最適です。
| 機能 | 標準の Gemini モデル | Gemini Deep Research エージェント |
|---|---|---|
| レイテンシ | 秒 | 分(非同期/バックグラウンド) |
| プロセス | 生成 -> 出力 | 計画 -> 検索 -> 読み取り -> 反復 -> 出力 |
| 出力 | 会話テキスト、コード、短い要約 | 詳細なレポート、長文の分析、比較表 |
| 最適な用途 | chatbot、抽出、クリエイティブ ライティング | 市場分析、デュー デリジェンス、文献レビュー、競合状況の分析 |
リリース情報と料金
Gemini Deep Research Agent には、Google AI Studio の Interactions API と Gemini API を使用してアクセスできます。
料金は、基盤となる Gemini 3 Pro モデルとエージェントが使用する特定のツールに基づく従量課金制モデルに従います。リクエストが 1 つの出力につながる標準的なチャット リクエストとは異なり、Deep Research タスクはエージェント ワークフローです。1 つのリクエストで、計画、検索、読み取り、推論の自律ループがトリガーされます。
推定費用
費用は、必要な調査の深さによって異なります。エージェントは、プロンプトに回答するために必要な読み取りと検索の量を自律的に判断します。
- 標準的な調査タスク: 中程度の分析を必要とする一般的なクエリの場合、エージェントは約 80 個の検索クエリ、約 25 万個の入力トークン(約 50 ~ 70% がキャッシュに保存)、約 6 万個の出力トークンを使用する可能性があります。
- 合計(推定): タスクあたり$2.00 ~$3.00
- 複雑なリサーチ タスク: 競合他社の状況の詳細な分析や広範なデュー デリジェンスの場合、エージェントは最大で約 160 件の検索クエリ、約 90 万個の入力トークン(約 50 ~ 70% がキャッシュに保存)、約 8 万個の出力トークンを使用する可能性があります。
- 合計(推定): タスクあたり$3.00 ~$5.00
安全上の考慮事項
エージェントにウェブとプライベート ファイルへのアクセス権を付与する場合は、安全性のリスクを慎重に検討する必要があります。
- ファイルを使用したプロンプト インジェクション: エージェントは、提供されたファイルの内容を読み取ります。アップロードされたドキュメント(PDF、テキスト ファイル)が信頼できるソースからのものであることを確認します。悪意のあるファイルには、エージェントの出力を操作するように設計された隠しテキストが含まれている可能性があります。
- ウェブ コンテンツのリスク: エージェントが公開ウェブを検索します。Google は堅牢なセーフティ フィルタを実装していますが、エージェントが悪意のあるウェブページに遭遇して処理するリスクがあります。回答で提供された
citationsを確認して、ソースを検証することをおすすめします。 - データ流出: エージェントに機密性の高い内部データの要約を依頼する際に、ウェブの閲覧も許可している場合は注意が必要です。
ベスト プラクティス
- 不明な場合のプロンプト: データが欠落している場合の処理方法をエージェントに指示します。たとえば、プロンプトに「2025 年の具体的な数値が利用できない場合は、推定ではなく、予測または利用不可であることを明示的に述べてください」と追加します。
- コンテキストを提供する: 入力プロンプトで背景情報や制約を直接指定して、エージェントの調査をグラウンディングします。
- マルチモーダル入力: Deep Research エージェントはマルチモーダル入力をサポートしています。コストが増加し、コンテキスト ウィンドウのオーバーフローのリスクが高まるため、慎重に使用してください。
制限事項
- ベータ版ステータス: Interactions API は公開ベータ版です。機能とスキーマは変更される可能性があります。
- カスタムツール: 現在、カスタムの関数呼び出しツールやリモート MCP(Model Context Protocol)サーバーを Deep Research エージェントに提供することはできません。
- 構造化された出力と計画の承認: Deep Research Agent は現在、人間が承認した計画や構造化された出力をサポートしていません。
- 最大調査時間: Deep Research エージェントの最大調査時間は 60 分です。ほとんどのタスクは 20 分以内に完了します。
- ストアの要件:
background=Trueを使用したエージェントの実行にはstore=Trueが必要です。 - Google 検索: Google 検索はデフォルトで有効になっており、グラウンディングされた検索結果には特定の制限が適用されます。
- 音声入力: 音声入力はサポートされていません。
次のステップ
- Interactions API の詳細を確認する。
- このエージェントを強化する Gemini 3 Pro モデルについてご確認ください。
- ファイル検索ツールを使用して独自のデータを使用する方法について説明します。