- unwind ai
- Posts
- Build an AI Due Diligence Agent Team with Google ADK & Gemini 3
Build an AI Due Diligence Agent Team with Google ADK & Gemini 3
Multi-agent app with Google ADK, Gemini 3 models, and Nano Banana (100% open source)
Evaluating startup investments requires hours of research across multiple domains - company analysis, market research, financial modeling, and risk assessment. This setup literally automates this entire workflow with AI agents that work together like a real investment team.
In this tutorial, you'll build an AI Due Diligence Agent Team using Google's Agent Development Kit (ADK) and Gemini 3 models, and Nano Banana. This multi-agent system researches any startup (from early-stage unknowns to well-funded companies), analyzes the market, builds financial projections, assesses risks, and generates professional investment reports - all autonomously with seamless handoffs and a sophisticated analysis with reports.
Google ADK provides powerful patterns for orchestrating multiple specialized agents, managing state across complex workflows, and integrating tools like web search, code execution, and file generation. Its SequentialAgent pattern lets you build sophisticated pipelines where each agent handles a specific task and passes results to the next stage, perfect for comprehensive due diligence workflows.
What We’re Building
This application implements a 7-stage investment analysis pipeline using Google ADK's SequentialAgent pattern with Gemini models. Each specialized agent handles a distinct part of the due diligence process, working together to deliver institutional-quality investment analysis.
Features:
7 Specialized Agents: Company research, market analysis, financial modeling, risk assessment, memo writing, report generation, and infographic creation
Works with Any Startup: Accepts company names, URLs, or both—from stealth startups to public companies
Live Research: Real-time web search for current company and market data
Financial Projections: Bear/Base/Bull scenario modeling with auto-generated charts
Deep Risk Analysis: Comprehensive assessment across market, execution, financial, regulatory, and exit risks
Professional Outputs: McKinsey-style HTML reports and AI-generated infographic summaries
Multi-Modal Pipeline: Combines text analysis, code execution, and image generation
What We’re Building
The pipeline follows a sequential workflow where each agent builds upon the previous stage's output:
User Input: Provide a company name, URL, or both (e.g., "Analyze https://agno.com for Series A")
Company Research: Agent searches the web for company basics, founders, funding, product, and traction
Market Analysis: Agent researches market size, competitors, and positioning using the company data
Financial Modeling: Agent estimates current ARR, builds Bear/Base/Bull projections, generates a chart, and calculates potential returns
Risk Assessment: Agent analyzes risks across 5 categories (market, execution, financial, regulatory, exit) and assigns severity scores
Investor Memo: Agent synthesizes all findings into a structured memo with clear recommendations (Strong Buy/Buy/Hold/Pass)
Report Generation: Agent converts memo to professional HTML with McKinsey-style formatting
Infographic Creation: Agent generates a visual one-pager summarizing key metrics and recommendation
State Management: Each agent's output is stored with a unique output_key and automatically passed to subsequent agents via template variables like {company_info} and {market_analysis}.
Artifact Storage: All generated files (charts, reports, infographics) are saved both to ADK's Artifacts system and a local outputs/ folder with timestamps.
Prerequisites
Before we begin, make sure you have the following:
Python installed on your machine (version 3.12 is recommended)
Your Gemini API key for using Gemini models
A code editor of your choice (we recommend VS Code or PyCharm for their excellent Python support)
Basic familiarity with Python programming
Code Walkthrough
Setting Up the Environment
First, let's get our development environment ready:
Clone the GitHub repository:
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.gitGo to the ai_due_diligence_agent folder:
cd advanced_ai_agents/multi_agent_apps/ai_due_diligence_agentInstall the required dependencies:
pip install -r requirements.txtGrab your Gemini API key from Google AI Studio.
You can either export it as an environment variable:
export GOOGLE_API_KEY=your_api_key_hereOr create a .env file in the ai_due_diligence_agent directory:
echo "GOOGLE_API_KEY=your_api_key_here" > ai_due_diligence_agent/.envCreating the App
The AI Due Diligence Agent app is organized into three main files that work together.
File 1: tools.py
Set up the necessary imports and create outputs directory for generated files:
import logging
import io
from pathlib import Path
from datetime import datetime
from google.adk.tools import ToolContext
from google.genai import types, Client
logger = logging.getLogger("DueDiligencePipeline")
# Create outputs directory for generated files
OUTPUTS_DIR = Path(__file__).parent / "outputs"
OUTPUTS_DIR.mkdir(exist_ok=True)Financial Chart Tool
Generates professional revenue projection charts using matplotlib:
async def generate_financial_chart(
company_name: str,
current_arr: float,
bear_rates: str,
base_rates: str,
bull_rates: str,
tool_context: ToolContext
) -> dict:
"""
- Parses growth rates for Bear/Base/Bull scenarios
- Calculates 5-year projections
- Creates professional chart with matplotlib
- Saves as ADK artifact (timestamped PNG)
- Returns summary with Year 5 projections
"""Infographic Tool
Creates visual summaries using Gemini's image generation:
async def generate_infographic(
data_summary: str,
tool_context: ToolContext
) -> dict:
"""
- Uses gemini-3-pro-image-preview model
- Creates investment banking aesthetic visuals
- Shows company name, metrics, risk score, recommendation
- Saves as ADK artifact (PNG/JPG)
"""File 2:
Set up the necessary imports:
from google.adk.agents import LlmAgent, SequentialAgent
from google.adk.tools import google_search
from google.adk.code_executors import BuiltInCodeExecutor
from .tools import generate_html_report, generate_infographic, generate_financial_chartCompany Research Agent
Gathers comprehensive company information through web search:
company_research_agent = LlmAgent(
name="CompanyResearchAgent",
model="gemini-3-flash-preview",
description="Researches company information using web search",
instruction="""You are a senior investment analyst conducting company research.
The user may provide a company name, website URL, or both.
GATHER: Company basics, founders & team, product/technology, funding history,
traction, and recent news.
FOR EARLY-STAGE STARTUPS: Check website, LinkedIn, Crunchbase, and note when
information is limited.""",
tools=[google_search],
output_key="company_info",
)Market Analysis Agent
Analyzes market size, competition, and positioning:
market_analysis_agent = LlmAgent(
name="MarketAnalysisAgent",
model="gemini-3-flash-preview",
description="Analyzes market size, competitors, and positioning",
instruction="""You are a market research analyst.
COMPANY RESEARCH: {company_info}
Research: Market size (TAM/SAM), competitors, positioning, and trends.
FOR EARLY-STAGE: Focus on broader market category, identify well-funded
competitors, look for validation signals.""",
tools=[google_search],
output_key="market_analysis",
)Financial Modeling Agent
Builds 5-year revenue projections and generates charts:
financial_modeling_agent = LlmAgent(
name="FinancialModelingAgent",
model="gemini-3-pro-preview",
description="Builds financial models and generates projection charts",
instruction="""You are a financial analyst building investment models.
INPUTS: {company_info}, {market_analysis}
TASKS:
1. Estimate current ARR based on available data
2. Define Bear/Base/Bull growth scenarios (5-year YoY multipliers)
3. Generate chart using generate_financial_chart tool
4. Calculate exit valuations and returns (MOIC, IRR)
Do NOT write Python code. Just use the tool.""",
tools=[generate_financial_chart],
output_key="financial_model",
)Risk Assessment Agent
Conducts deep risk analysis using extended reasoning:
risk_assessment_agent = LlmAgent(
name="RiskAssessmentAgent",
model="gemini-3-pro-preview",
description="Conducts deep risk analysis using extended reasoning",
instruction="""You are a senior risk analyst at a top-tier VC firm.
INPUTS: {company_info}, {market_analysis}, {financial_model}
Analyze risks across: Market, Execution, Financial, Regulatory, Exit
For each provide: Severity (Low/Medium/High/Critical), description with
evidence, mitigation strategy.
End with: Overall Risk Score (1-10), Top 3 risks, recommended protective terms.""",
output_key="risk_assessment",
)Investor Memo Agent
Synthesizes all findings into a structured investment memo:
investor_memo_agent = LlmAgent(
name="InvestorMemoAgent",
model="gemini-3-pro-preview",
description="Synthesizes all findings into structured investor memo",
instruction="""You are a senior investment partner writing the investment memo.
INPUTS: {company_info}, {market_analysis}, {financial_model}, {risk_assessment}
Create memo with: Executive Summary (with recommendation: Strong Buy/Buy/Hold/Pass),
Company Overview, Funding & Valuation, Market Opportunity, Financial Analysis,
Risk Analysis, Investment Thesis, Recommendation with next steps.""",
output_key="investor_memo",
)Report Generator Agent
Creates professional HTML investment reports:
report_generator_agent = LlmAgent(
name="ReportGeneratorAgent",
model="gemini-3-flash-preview",
description="Generates professional HTML investment report",
instruction="""You create professional investment reports.
INPUT: {investor_memo}
Use generate_html_report tool to create McKinsey/Goldman-style HTML report.
Confirm the report was saved as an artifact.""",
tools=[generate_html_report],
output_key="html_report_result",
)Infographic Generator Agent
Creates visual summary infographics:
infographic_generator_agent = LlmAgent(
name="InfographicGeneratorAgent",
model="gemini-3-flash-preview",
description="Creates visual investment summary infographic",
instruction="""You create visual investment summaries.
INPUT: {investor_memo}
Prepare data summary with key metrics, then use generate_infographic tool.
Confirm the infographic was generated successfully.""",
tools=[generate_infographic],
output_key="infographic_result",
)Pipeline Orchestration with SequentialAgent
The SequentialAgent coordinates all 7 agents, automatically passing data between stages:
due_diligence_pipeline = SequentialAgent(
name="DueDiligencePipeline",
description="Complete due diligence pipeline: Research → Market → Financials → Risks → Memo → Report → Infographic",
sub_agents=[
company_research_agent,
market_analysis_agent,
financial_modeling_agent,
risk_assessment_agent,
investor_memo_agent,
report_generator_agent,
infographic_generator_agent,
],
)Root Agent (Coordinator)
The root agent handles user queries and routes to the pipeline:
root_agent = LlmAgent(
name="DueDiligenceAnalyst",
model="gemini-3-flash-preview",
description="AI-powered due diligence analyst for startup investments",
instruction="""You are a senior investment analyst helping evaluate startup
investment opportunities.
WHEN USER PROVIDES A COMPANY/URL TO ANALYZE:
→ transfer_to_agent to "DueDiligencePipeline"
After analysis, summarize key findings and mention the generated artifacts.""",
sub_agents=[due_diligence_pipeline],
)File 3: __init__.py
This file is critical for ADK to recognize your agent. ADK automatically discovers agents by looking for folders with an __init__.py file that exports a root_agent. This file serves as the entry point that makes your multi-agent system accessible through the ADK web interface.
"""AI Due Diligence Agent - Multi-Agent Pipeline for Startup Investment Analysis"""
from .agent import root_agent
__all__ = ["root_agent"]Running the App
With our code in place, it's time to launch the app.
Important: You must run ADK from the multi_agent_apps folder, as ADK discovers agents by looking for subfolders with __init__.py files that export a root_agent.
Navigate to the multi_agent_apps folder:
cd advanced_ai_agents/multi_agent_appsStart the ADK web interface:
adk webADK will automatically discover all the agent apps in this folder and load the root agent.
Access the interface:
Open your browser and navigate to http://localhost:8000
You should see "DueDiligenceAnalyst" available in the agent selector.
Try analyzing startups:
You can provide company names, URLs, or both. Here are some examples to try:
"Analyze https://agno.com for Series A investment of $30-50M"
"Research Genspark AI for its next funding round"
"Analyze Lovable for Series C funding opportunities"
"Due diligence on https://cursor.sh for potential investment"
View generated artifacts:
All outputs are saved to:
Artifacts tab in the ADK web interface (click to download)
Local
outputs/folder in theai_due_diligence_agentdirectory
Working Application Demo
Conclusion
You've built a production-ready AI due diligence system that analyzes startups like a professional investment team. This multi-agent pipeline demonstrates Google ADK's power for orchestrating complex workflows with specialized agents working in sequence.
This setup can be expanded further:
Add More Data Sources: Integrate Crunchbase, PitchBook, or company databases for richer data
Comparative Analysis: Extend the pipeline to analyze multiple companies side-by-side
Customizable Parameters: Allow users to adjust risk thresholds, growth assumptions, or valuation multiples
Team Collaboration: Add features for multiple analysts to review and annotate reports together
Keep experimenting with different configurations and features to build more sophisticated AI applications.
We share hands-on tutorials like this 2-3 times a week, to help you stay ahead in the world of AI. If you're serious about leveling up your AI skills and staying ahead of the curve, subscribe now and be the first to access our latest tutorials.
Reply