Gemini Deep Research Agent API सार्वजनिक
(x.com/GoogleAIStudio)Google ने Gemini Deep Research Agent को API के रूप में सार्वजनिक कर दिया है। Deep Research वह सुविधा है जिसमें यूज़र के पूछे गए सवाल के लिए AI खुद खोज योजना बनाता है, कई वेबपेजों को एक्सप्लोर, तुलना और समेकित करता है, और स्रोतों के साथ लंबी-फॉर्म रिपोर्ट अपने आप तैयार करता है। पहले यह केवल Google AI Studio के वेब UI में उपलब्ध था, लेकिन अब Interactions API नाम के नए asynchronous interface के जरिए डेवलपर इसे सीधे अपने ऐप में integrate कर सकते हैं। मौजूदा generate_content कॉल से अलग, यह काम background में कई मिनट तक चलता है, इसलिए request भेजने के बाद समय-समय पर completion status check करना (polling) या streaming के जरिए progress प्राप्त करना पड़ता है.
उपलब्ध मॉडल
deep-research-preview-04-2026: स्पीड और efficiency पर फोकस। client UI में real-time streaming के लिए उपयुक्त।deep-research-max-preview-04-2026: अधिकतम व्यापकता पर ज़ोर। automated context gathering और synthesis में मजबूत।
मुख्य फीचर सारांश
- सहयोगी योजना निर्माण (Collaborative Planning) : रिसर्च को तुरंत चलाने के बजाय, एजेंट पहले एक योजना प्रस्तावित करता है। यूज़र review और edit करने के बाद approve करे, तभी असली execution शुरू होता है।
- चार्ट और infographic का स्वत: निर्माण :
visualization="auto"विकल्प चालू करने पर एजेंट खुद chart और graph बनाकर base64 encoded image के रूप में लौटाता है। - MCP server integration : Model Context Protocol (बाहरी tools को LLM से जोड़ने वाला open standard) को support करता है, इसलिए financial data जैसी external services के tools एजेंट से जोड़े जा सकते हैं।
- विस्तारित tool set : Google Search, URL content reading, और code execution built-in हैं। file search (uploaded documents पर) और MCP server को वैकल्पिक रूप से जोड़ा जा सकता है।
- Multimodal input : केवल text ही नहीं, image, PDF, और audio files को भी research context के रूप में साथ भेजा जा सकता है।
- Real-time streaming और thinking summaries : research progress को real-time में stream किया जा सकता है, और
thinking_summaries="auto"चालू करने पर एजेंट की मध्यवर्ती reasoning process को summary रूप में भी देखा जा सकता है।
मुख्य कोड उदाहरण
यह सबसे बुनियादी उपयोग तरीका है। background=True के साथ asynchronous task शुरू किया जाता है, और 10 सेकंड के अंतराल पर completion status poll किया जाता है।
import time
from google import genai
client = genai.Client()
interaction = client.interactions.create(
input="Research the history of Google TPUs.",
agent="deep-research-preview-04-2026",
background=True,
)
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)
यह सहयोगी योजना निर्माण का flow है। पहले collaborative_planning=True से केवल योजना प्राप्त की जाती है, फिर feedback दिया जाता है, और अंत में False में बदलने पर ही वास्तविक research शुरू होती है। केवल "go ahead" जैसा text भेज देने और flag न बदलने पर रिपोर्ट generate नहीं होगी, इस बात का ध्यान रखना ज़रूरी है।
# चरण 1: योजना अनुरोध
plan = client.interactions.create(
agent="deep-research-preview-04-2026",
input="Research Google TPUs vs competitor hardware.",
agent_config={"type": "deep-research", "collaborative_planning": True},
background=True,
)
while (result := client.interactions.get(id=plan.id)).status != "completed":
time.sleep(5)
print(result.outputs[-1].text) # योजना आउटपुट
# चरण 2: योजना संशोधन (previous_interaction_id से बातचीत जारी रखना)
refined = client.interactions.create(
agent="deep-research-preview-04-2026",
input="Add a section comparing power efficiency.",
agent_config={"type": "deep-research", "collaborative_planning": True},
previous_interaction_id=plan.id,
background=True,
)
while (result := client.interactions.get(id=refined.id)).status != "completed":
time.sleep(5)
print(result.outputs[-1].text) # संशोधित योजना
# चरण 3: approval के बाद execution (ज़रूर `collaborative_planning=False` में बदलें)
report = client.interactions.create(
agent="deep-research-preview-04-2026",
input="Plan looks good!",
agent_config={"type": "deep-research", "collaborative_planning": False},
previous_interaction_id=refined.id,
background=True,
)
while (result := client.interactions.get(id=report.id)).status != "completed":
time.sleep(5)
print(result.outputs[-1].text) # अंतिम रिपोर्ट
यह chart generation और multimodal input का उदाहरण है। visualization option को चालू रखना उपयोगी है, लेकिन prompt में किस तरह का chart चाहिए यह स्पष्ट लिखने पर बेहतर परिणाम मिलते हैं।
# chart सहित research
interaction = client.interactions.create(
agent="deep-research-preview-04-2026",
input="Analyze global semiconductor market trends. Include charts showing market share changes.",
agent_config={"type": "deep-research", "visualization": "auto"},
background=True,
)
# PDF paper को context के रूप में देने वाला multimodal research
interaction = client.interactions.create(
agent="deep-research-preview-04-2026",
input=[
{"type": "text", "text": "What has been the impact of this research paper?"},
{"type": "document", "uri": "https://arxiv.org/pdf/1706.03762", "mime_type": "application/pdf"},
],
background=True,
)
यह MCP server को जोड़कर एजेंट को external financial data देने का उदाहरण है। allowed_tools के जरिए एजेंट किन tools को कॉल कर सकता है, इसे सीमित भी किया जा सकता है।
interaction = client.interactions.create(
agent="deep-research-preview-04-2026",
input="Research how recent geopolitical events influenced USD interest rates",
tools=[
{
"type": "mcp_server",
"name": "Finance Data Provider",
"url": "https://finance.example.com/mcp",
"headers": {"Authorization": "Bearer my-token"},
}
],
background=True,
)
अंतर पैदा करने वाले बिंदु
- यह सिर्फ साधारण RAG (retrieval-augmented generation, यानी external documents खोजकर LLM को देने की तकनीक) या एक बार का question-answering नहीं है, बल्कि planning-search-synthesis जैसे लंबे research workflow को एक ही API से automate करता है। खासकर सहयोगी योजना निर्माण इसकी उस design philosophy को दिखाता है जिसमें “एजेंट काम खुद करे, लेकिन दिशा इंसान तय करे।”
- public web search और private document search को सिर्फ tool configuration से मिलाया जा सकता है, इसलिए enterprise के internal materials पर आधारित research में भी इसकी उपयोगिता बनती है।
निहितार्थ
- AI research agent अब API स्तर तक आ जाने से, अलग agent framework के बिना भी applications में “deep research” फीचर को सीधे integrate किया जा सकता है। हालांकि, asynchronous polling आधारित API structure उन developers से design pattern में बदलाव की मांग करेगा जो synchronous LLM calls के अभ्यस्त हैं, और कई मिनट की response latency को UX स्तर पर कैसे संभाला जाए, यह वास्तविक adoption में मुख्य चुनौती हो सकती है।
अभी कोई टिप्पणी नहीं है.