All work

Case study 01 / 06

Production GenAI · RAG · MCP · AI orchestration

KYP — AI-Powered Insurance Assistant

A production GenAI assistant that retrieves policy and product context and calls enterprise capabilities through MCP tools. I built its four MCP tools, code-based routing and role-based access control.

Role
Built the MCP tool layer · contributed to retrieval and integration
Company
ICICI Lombard
Stack
  • Python
  • FastAPI
  • MCP
  • RAG
  • Vertex AI
  • Vertex AI Search
  • Next.js
  • React
  • GCP
KYP architecture: a user query is routed by a FastAPI service through role-based access control to one of four MCP tools, whose context grounds a Vertex AI response.INPUTUser queryNEXT.JS CLIENTFastAPI serviceCODE-BASED ROUTINGRBAC · SIGNED TOKEN CLAIMSMCP TOOLSPolicy lookupCORE POLICY SYSTEMWorkflow guidanceSTEP-BY-STEPCompany profileANSWERSProduct RAGVERTEX AI SEARCHVertex AIGROUNDED GENERATIONGrounded response12,000+ PEAK DAU · REPORTED
Simplified, public-level view of the documented architecture

01

Overview

KYP is a production AI assistant for insurance policy and customer queries. It combines retrieval-augmented generation over product information with MCP tools that expose enterprise capabilities — such as policy lookup from the core policy system — to the model in a controlled way.

02

Context

Insurance questions are rarely generic: the right answer depends on the product line (health, travel, motor, home), the specific policy, and the user's role. An assistant that answers from model memory alone is a liability in that setting.

03

Problem

Give users fast, grounded answers by retrieving the right context and calling the right enterprise capability for each query — while keeping every tool call inside defined security boundaries.

04

Constraints

  • Answers must be grounded in enterprise data, not model memory.
  • Tool access has to respect who is asking (role-based access).
  • Must serve production traffic — the assistant reports a peak of 12,000+ daily active users.
  • Confidential policy and customer data must never leak across users.

05

My contribution

  • Built the four MCP tools behind KYP: policy lookup from the core policy system across health, travel, motor and home; step-by-step workflow guidance; company-profile answers; and RAG over product information.
  • Implemented code-based tool routing so each query reaches the specialised tool that can answer it.
  • Implemented role-based access control on tool calls using signed token claims.
  • Worked on semantic retrieval and policy-aware context selection.
  • Contributed to migrating retrieval from OpenAI Vector Stores to Google Vertex AI retrieval infrastructure.
  • Built frontend and backend integrations, and tested services with pytest, pytest-asyncio and httpx.
  • Checked answers against a golden-set evaluation.

06

Architecture

Query → route → tool → grounded response

A user query enters a FastAPI service. Code-based routing selects one of four MCP tools. Each tool call is scoped by role-based access control from signed claims. Retrieval tools pull context from Vertex AI Search; the policy tool reads from the core policy system. The model composes a response from that retrieved context.

  • Interface: Next.js / React client talking to FastAPI services.
  • Routing: deterministic, code-based selection across four specialised MCP tools.
  • Security boundary: RBAC on every tool call via signed token claims.
  • Retrieval: semantic search on Vertex AI Search / Discovery Engine (migrated from OpenAI Vector Stores).
  • Generation: Vertex AI models on GCP, answering from retrieved context.

07

Decisions & trade-offs

Code-based tool routing
Deterministic routing makes behaviour predictable and testable for known use cases, instead of leaving every dispatch decision to the model.
MCP as the tool contract
Enterprise capabilities are exposed through one standard tool interface, so new capabilities can be added without rewiring the assistant.
Access control at the tool boundary
Enforcing roles where data is fetched means a prompt cannot talk its way into data the user is not allowed to see.
Golden-set evaluation
A fixed set of expected answers gives a repeatable check on answer quality when retrieval or prompts change.

08

Impact

  • 12,000+

    Peak daily active users

    Reported peak DAU

  • 700–1,300 ms

    Standard query time

    Measured at the API gateway for standard queries

  • 4

    MCP tools

    Built and in production

  • Retrieval infrastructure migrated from OpenAI Vector Stores to Vertex AI.

Described at a public level — no confidential company, customer or system details.