Inspiration

In the high-stakes world of finance, Know Your Customer (KYC) is a critical compliance step, but the process is notoriously slow, manual, and expensive—often taking days of analyst work per case. My inspiration came from the rise of autonomous AI agents, realising this entire workflow was ready for a revolution.

The goal became clear: to build a multi-agent system that automates the end-to-end due diligence process, from data gathering to final risk assessment.

Coming from a cloud architecture background, I used Google's Agent Development Kit (ADK) and leveraged Gemini as my collaborative coding partner. In just over one week, this partnership enabled me to build a sophisticated solution that performs deep analysis and generates comprehensive KYC reports in minutes, not days.

What it does

This project is an advanced, multi-agent AI system designed to automate the entire Know Your Customer (KYC) and Anti-Money Laundering (AML) due diligence process, transforming a manual task that takes days into a comprehensive intelligence report generated in minutes.

The workflow operates through a series of specialist agents, each performing a critical function:

Interactive Onboarding: The process begins with a user-friendly conversational interface. An agent greets the user and, upon receiving a company name, performs a search against the UK Companies House registry. It then interactively prompts the user to confirm the correct entity from a list of potential matches, ensuring the entire investigation starts with an accurate target.

Comprehensive Data Aggregation: Once a company is confirmed, the pipeline activates data-gathering agents that:

  • Fetch all official corporate data, including its status, address, legal form, and previous names.
  • Identify all active directors and ultimate beneficial owners (PSCs), de-duplicating them by their unique API IDs to correctly handle individuals with the same name.
  • Enrich this data with crucial context by retrieving each director's disqualification status and their total number of other appointments.
  • Autonomously download the latest, (and previous 3 years) annual reports (PDF or image) and save it to Google Cloud Storage.

Intelligent Analysis & Screening: The system then moves beyond data gathering into true analysis:

  • Leveraging multimodal capabilities, the system visually parses PDF/image annual reports- understanding tables, text, and layout- to extract key financial KPIs such as annual revenue and operating profit, and flag risks like operating losses for the past 3 years.
  • A dedicated agent performs a web search to find the company's official website, programmatically filtering out irrelevant results.
  • The company and all its active personnel are screened against live Sanctions, Politically Exposed Persons (PEP), and Adverse Media lists. Crucially, the system performs entity disambiguation, using date-of-birth validation to confirm true positive matches and filter out false positives.
  • Showcasing multimodal output, it transforms complex ownership data into a clear, visual organisation chart, saved as a PNG image after generating mermaid code.

Automated Risk Assessment: A specialised risk agent synthesises all gathered information- including financial health, screening results for both the company and personnel, company jurisdiction, and personnel nationalities- to calculate a final, multi-factor Overall KYC Risk Rating and score (Low, Medium, or High).

Final Report Generation: The process culminates with a Summary Agent that assembles all findings into a professional, multi-section due diligence report. This report includes an Executive Summary, detailed data tables, evidence-based screening results, a transparent risk breakdown, and a final actionable recommendation (e.g., "Proceed with Onboarding" or "Escalate for Enhanced Due Diligence"). The final report is delivered as both an immediate Markdown preview within the UI and a permanent, shareable Google Doc- both with direct links to created resources e.g. created Salesforce account, GCS path the generated org chart images and links to company registrar pages and filings.

In essence, this project creates a powerful analytical partner that dramatically accelerates the due diligence process, reduces manual effort, and provides compliance analysts with deeper, more consistent, and fully auditable insights.

How I Built It

This solution is a sophisticated orchestration of 12 distinct AI agents, built with Python and the Google Agent Development Kit (ADK). The architecture is centred around a main Router Agent that acts as an intelligent controller for the entire application, deciding which specialist sub-agent or pipeline to execute based on the state of the conversation.

The system leverages three different agent types provided by the ADK, each chosen for a specific purpose:

1. The Router Agent: A standard Agent manages the interactive, multi-turn conversation. Its flexibility was essential for the complex conditional logic required to greet the user, handle the interactive search, and trigger the main pipeline.

2. The Sequential Pipeline: A Sequential Agent was the perfect choice for the main due diligence workflow. It guarantees that each data gathering and analysis step happens in a specific, logical order, ensuring a reliable and repeatable process.

3. The Parallel Processors: To optimise for speed, the main sequential pipeline contains two Parallel Agents for tasks that can run concurrently, such as extracting financial data from a PDF/image while simultaneously generating the org chart structure. This significantly reduces total execution time.

Tooling Philosophy: "Tools Over Prompts" A core design principle for this project was to ensure reliability. It quickly became clear that asking an LLM to perform complex data processing (like parsing API responses or building tables) in a prompt is fragile. Therefore, all complex logic was moved into robust Python tools. The agents are responsible for high-level reasoning and orchestrating which tools to call, but the low-level data manipulation is handled by predictable code.

Custom Tools Deployed: Key tools include process_confirmed_company (which fetches and enhances all Companies House data), screen_all_entities_and_categorize, and calculate_final_risk_assessment.

Built-in & Advanced Tools: The project leverages the pre-built Google Search tool and uses the powerful AgentTool pattern, which allows the main Router to call other, complete agents as if they were simple tools.

Challenges I Ran Into

The biggest architectural challenge was creating a truly interactive, multi-turn conversation. A standard Sequential Agent runs non-stop, so making it "pause" for user confirmation required designing the Router Agent pattern. This allows the system to complete one turn (asking the user to choose a company) and then start a new, separate process based on that user's confirmed input.

Another significant hurdle was state management between agents. Early versions suffered from "silent failures," where one agent would fail to save its data correctly, causing a downstream agent to fail without a clear reason. This led to a key design principle: every agent's tool must be resilient and handle its own state updates reliably, providing a clear success or error object for the next agent in the chain.

Accomplishments I'm Proud Of

I am most proud of building this entire end-to-end agentic workflow, given my background is in cloud architecture rather than extensive programming. It demonstrates the power of leveraging an LLM like Gemini as a collaborative coding partner to rapidly turn a complex architectural vision into a working reality.

Technically, the most significant accomplishment is the screening disambiguation. The system doesn't just list potential matches; it uses date-of-birth validation to intelligently assess if a hit is a true positive or a false positive, providing a level of analysis that saves a human analyst immense time and reduces noise.

What I Learned

This project was a deep dive into the practicalities of agentic design. The most important lesson was the "Tools over Prompts" philosophy: delegate complex, deterministic logic to reliable Python tools and use the LLM for what it excels at—reasoning and orchestration.

I also learned the critical importance of clear data contracts between agents. A failure in one agent can cascade, so designing each step to be resilient and to report its status clearly is key to building a stable pipeline.

What's Next

This project has laid a powerful foundation. The next evolution would focus on even deeper analysis:

  • Automated UBO Unwrapping: Recursively trace ownership through corporate entities to find the ultimate human owners.
  • Financial Trend Analysis: Analyse the last 3-5 years of annual reports to assess financial health based on trends rather than a single snapshot.
  • Dedicated Adverse Media Analysis: Create a new agent to find and summarise negative news (e.g., regulatory fines, legal disputes) related to the company and its personnel.

Built With

  • adk
  • agent-development-kit
  • companies-house-api
  • firestore
  • gcs
  • gemini
  • gemini-2.5-flash
  • gemini-2.5-pro
  • gemini2.5
  • gemini2.5flash
  • gemini2.5pro
  • google-docs
  • mermaid
  • opensanctions.org-api
  • python
  • salesforce
Share this project:

Updates