Google’s Gemini Fullstack LangGraph Quickstart uses Gemini 2.5 and LangGraph to build a citation-driven research agent with a React and FastAPI architecture.
Imagine building your own deep-research assistant that doesn't just search the web, but actually thinks, reflects, and cites its sources. Google's open-source Gemini Fullstack LangGraph Quickstart shows you exactly how to do this.
By pairing the Gemini 2.5 large language model with LangGraph, this project creates a transparent, multi-step research agent. It operates through a clever four-part loop.
First, the Query Writer analyzes your request and generates targeted search terms. Next, the Web Searcher uses those terms to run live Google searches, gathering the most up-to-date information and summarizing the findings.
Then comes the clever part: Reflection. The agent inspects its own summary, looks for any missing details or knowledge gaps, and drafts follow-up queries to fill those holes. This loop continues until the research is complete. Finally, the agent synthesizes everything into a polished, citation-backed answer.
While this isn't Google's official consumer tool, it provides a perfect, practical blueprint for anyone wanting to build a sophisticated, self-correcting research pipeline.
Google’s open-source “Gemini Fullstack LangGraph Quickstart” pairs Gemini 2.5 with LangGraph to showcase a fully transparent, citation-driven research agent (Mikami 2025). A React frontend (Vite, Tailwind CSS, Shadcn UI) collects user queries and displays progress, while a FastAPI/LangGraph backend orchestrates a multi-step workflow:
Although this isn’t Google’s official Gemini implementation as seen in AI Mode or AI Overviews, it provides unparalleled technical insight into how to build a “DeepSearch”-style agent by modularizing query formulation, retrieval, reflection, and synthesis (project repo). It’s a practical blueprint for anyone wanting to understand the nuts and bolts of an advanced, LLM-driven research pipeline.
from datetime import datetime
# Get current date in a readable format
def get_current_date():
return datetime.now().strftime("%B %d, %Y")
query_writer_instructions = """Your goal is to generate sophisticated and diverse web search queries. These queries are intended for an advanced automated web research tool capable of analyzing complex results, following links, and synthesizing information.
Instructions:
- Always prefer a single search query, only add another query if the original question requests multiple aspects or elements and one query is not enough.
- Each query should focus on one specific aspect of the original question.
- Don't produce more than {number_queries} queries.
- Queries should be diverse, if the topic is broad, generate more than 1 query.
- Don't generate multiple similar queries, 1 is enough.
- Query should ensure that the most current information is gathered. The current date is {current_date}.
Format:
- Format your response as a JSON object with ALL three of these exact keys:
- "rationale": Brief explanation of why these queries are relevant
- "query": A list of search queries
Example:
Topic: What revenue grew more last year apple stock or the number of people buying an iphone
```json
{{
"rationale": "To answer this comparative growth question accurately, we need specific data points on Apple's stock performance and iPhone sales metrics. These queries target the precise financial information needed: company revenue trends, product-specific unit sales figures, and stock price movement over the same fiscal period for direct comparison.",
"query": ["Apple total revenue growth fiscal year 2024", "iPhone unit sales growth fiscal year 2024", "Apple stock price growth fiscal year 2024"],
}}
```
Context: {research_topic}"""
web_searcher_instructions = """Conduct targeted Google Searches to gather the most recent, credible information on "{research_topic}" and synthesize it into a verifiable text artifact.
Instructions:
- Query should ensure that the most current information is gathered. The current date is {current_date}.
- Conduct multiple, diverse searches to gather comprehensive information.
- Consolidate key findings while meticulously tracking the source(s) for each specific piece of information.
- The output should be a well-written summary or report based on your search findings.
- Only include the information found in the search results, don't make up any information.
Research Topic:
{research_topic}
"""
reflection_instructions = """You are an expert research assistant analyzing summaries about "{research_topic}".
Instructions:
- Identify knowledge gaps or areas that need deeper exploration and generate a follow-up query. (1 or multiple).
- If provided summaries are sufficient to answer the user's question, don't generate a follow-up query.
- If there is a knowledge gap, generate a follow-up query that would help expand your understanding.
- Focus on technical details, implementation specifics, or emerging trends that weren't fully covered.
Requirements:
- Ensure the follow-up query is self-contained and includes necessary context for web search.
Output Format:
- Format your response as a JSON object with these exact keys:
- "is_sufficient": true or false
- "knowledge_gap": Describe what information is missing or needs clarification
- "follow_up_queries": Write a specific question to address this gap
Example:
```json
{{
"is_sufficient": true, // or false
"knowledge_gap": "The summary lacks information about performance metrics and benchmarks", // "" if is_sufficient is true
"follow_up_queries": ["What are typical performance benchmarks and metrics used to evaluate [specific technology]?"] // [] if is_sufficient is true
}}
```
Reflect carefully on the Summaries to identify knowledge gaps and produce a follow-up query. Then, produce your output following this JSON format:
Summaries:
{summaries}
"""
answer_instructions = """Generate a high-quality answer to the user's question based on the provided summaries.
Instructions:
- The current date is {current_date}.
- You are the finaly step of a multi-step research process, don't mention that you are the final step.
- You have access to all the information gathered from the previous steps.
- You have access to the user's question.
- Generate a high-quality answer to the user's question based on the provided summaries and the user's question.
- you MUST include all the citations from the summaries in the answer correctly.
User Context:
- {research_topic}
Summaries:
{summaries}"""
Purpose:
Generate one or more highly focused search queries so an automated research tool can retrieve exactly the data needed.
Key Elements:
{number_queries}.{current_date} as a reference).How It Works in Practice:
research_topic and parameters (number_queries, current_date)."rationale": A brief justification for why these exact queries were chosen."query": An array of one to {number_queries} strings, each a standalone search string.Proactive Suggestions & Alternatives:
{number_queries}, use a sliding scale based on detected topic complexity. For very broad topics, allow up to 5–7 queries and include logic to merge or discard near‐duplicates.Purpose:
Turn those queries into concrete Google searches, retrieve results, and condense them into a structured, source‐verified summary.
Key Elements:
{current_date}).How It Works in Practice:
research_topic.Proactive Suggestions & Alternatives:
Purpose:
Analyze the assembled summaries, pinpoint gaps, and suggest follow‐up queries for any missing technical or emerging details.
Key Elements:
is_sufficient flag: Indicates whether the current summaries fully answer the user’s question.knowledge_gap: If false, explain exactly what’s missing—e.g., “no concrete benchmarks” or “latest regulatory changes aren’t covered.”follow_up_queries: One or more self‐contained questions designed to fill those gaps in a subsequent search pass.How It Works in Practice:
research_topic: Did we cover every angle—especially technical specifications, use cases, or recent breakthroughs?"is_sufficient": false."knowledge_gap", state in plain terms what’s lacking."is_sufficient": true, with an empty knowledge_gap and [] for follow_up_queries.Proactive Suggestions & Alternatives:
Purpose:
Produce the final, polished answer to the user’s original question—completely grounded in the summaries and properly cited.
Key Elements:
current_date as context.How It Works in Practice:
Proactive Suggestions & Alternatives:
python_user_visible) to illustrate trends or dates mentioned in the summaries. This can make complex data easier to digest.Query Writer → Web Searcher → Reflection → Answer.
Sign in with Google to comment.