A multi-agent customer support platform built with Gemini 3, Neo4j, and MCP that delivers verified refund decisions with grounded, explainable reasoning from a policy knowledge graph.
| Demo URL | https://storage.googleapis.com/mcp_frontend/index.html |
| Demo Video | YouTube Demo |
No login required. The demo is publicly accessible.
Customer support teams spend 70%+ of their time on repetitive refund/return requests. Each request requires:
- Reading customer emails with attachments
- Cross-referencing order databases
- Consulting return policy documents
- Making consistent decisions
VARA.ai automates this entire workflow using Gemini 3's advanced reasoning capabilities.
VARA.ai is an end-to-end AI system that:
- Monitors Gmail for incoming refund/return requests
- Classifies emails using Gemini's understanding capabilities
- Extracts order details from email text and invoice attachments (Gemini Vision)
- Verifies against database using MCP-connected PostgreSQL
- Adjudicates requests by traversing a policy knowledge graph
- Records decisions with full reasoning transparency
https://storage.googleapis.com/mcp_frontend/index.html
No login required. The demo is publicly accessible.
-
Open the demo URL β You'll land on the Email Pipeline page
-
Select a scenario from the "Select Demo Scenario" dropdown
-
View the request β Email content and attached invoice displayed on the left panel
-
Click "Process Email Request" to trigger the full AI pipeline
-
Watch the pipeline execute in real-time (~1 minute to complete):
- Email Classification
- Order Extraction (Gemini Vision)
- Database Verification
- Policy Adjudication (Extended Thinking)
- Decision with Explanation
Note: In production, this pipeline runs automatically when a customer sends an email to
vara.assist@gmail.com. The demo uses pre-defined scenarios because processing a real email requires the corresponding order to exist in our database. This website serves as a prototype to demonstrate the fully automated end-to-end pipeline.
- Click "Policy Knowledge Base" in the navigation bar
- Click "Visualize Graph" to view the pre-compiled knowledge graph (Best Buy return policy)
- Interactive controls:
- Scroll to zoom
- Drag to pan
- Click nodes for details
- Upload any company's terms and conditions PDF
- Full compilation takes ~20-25 minutes (based on document length), orchestrated entirely by Gemini 3 Pro
The multi-agent system will automatically:
π Parse PDF β Markdown (LlamaParse)
β
π§ Design graph schema (Ontology Agent)
β
π€ Extract entities & relationships (Extraction Agent)
β
π Validate quality (Critic Agent)
β
π¨ Build Neo4j graph (Builder Agent)
| Agent | Role | Gemini Feature |
|---|---|---|
| Ontology Agent | Designs knowledge graph schema from policy documents | Structured Output |
| Extraction Agent | Extracts policy rules, conditions, and relationships | JSON Schema |
| Critic Agent | Validates extraction quality and suggests improvements | System Instruction |
| Builder Agent | Constructs Neo4j knowledge graph with Cypher queries | Structured Output |
| Adjudicator Agent | Makes refund decisions with full reasoning | Extended Thinking |
VARA.ai uses FastMCP to create modular, tool-based AI capabilities:
| Tool | Description |
|---|---|
list_orders_by_customer_email |
Fetch order history for a customer email |
find_order_by_invoice_number |
Lookup single order with full details |
find_order_by_order_invoice_id |
Alternative lookup by order_invoice_id |
list_order_items_by_order_invoice_id |
Get line items for an order |
verify_from_email_matches_customer |
Check if email exists in customers table |
get_customer_orders_with_items |
Deep fetch with order items |
select_order_id |
LLM-assisted order matching |
llm_find_orders |
Generate SQL from natural language |
| Tool | Description |
|---|---|
process_invoice |
Decode base64 PDF, parse text, and save to file |
| Tool | Description |
|---|---|
analyze_defect_image |
Analyze product defect images using Gemini Vision |
Policy knowledge graph operations for storing and querying return policies.
| Function | Description |
|---|---|
check_neo4j_connection |
Test database connectivity |
get_graph_schema |
Retrieve node labels and relationships |
get_graph_statistics |
Node/relationship counts |
execute_cypher_query |
Run read-only Cypher queries |
execute_cypher_write |
Run write Cypher (CREATE, MERGE) |
execute_cypher_batch |
Bulk graph construction |
create_node |
Create/merge a node with properties |
create_relationship |
Create relationship between nodes |
create_schema_constraints |
Set up indexes and constraints |
clear_graph |
Delete all data (destructive) |
validate_graph_integrity |
Check for missing citations, orphans |
sample_graph_data |
Get sample nodes for verification |
PDF document parsing using LlamaParse for policy ingestion.
| Function | Description |
|---|---|
parse_all_policy_documents |
Parse all PDFs in directory to combined Markdown |
parse_single_policy_document |
Parse a single PDF document |
|
AI/ML
|
Databases
|
Cloud (GCP)
|
Frameworks
|
Processing
|
mcp_customer_support/
β
βββ gmail-event-processor/ # π§ Email Ingestion Service (Cloud Run)
β βββ app.py # FastAPI Pub/Sub endpoint
β βββ classifier.py # Gemini email classification
β βββ gmail_processor.py # Gmail API integration
β βββ store_email.py # GCS storage & Cloud Tasks queue
β βββ history_store.py # Firestore state tracking
β βββ secret_manager.py # Credentials management
β βββ Dockerfile
β βββ requirements.txt
β
βββ mcp_processor/ # βοΈ Main Processing Service (Cloud Run)
β βββ app.py # Cloud Tasks endpoint
β βββ processor.py # MCPProcessor orchestrator
β βββ Dockerfile
β βββ requirements.txt
β
βββ policy_compiler_agents/ # π€ Multi-Agent System
β βββ agent.py # Pipeline orchestrator
β βββ ontology_agent.py # Graph schema design
β βββ extraction_agent.py # Entity & relationship extraction
β βββ critic_agent.py # Quality validation
β βββ builder_agent.py # Neo4j graph construction
β βββ adjudicator_agent.py # Decision making (Extended Thinking)
β βββ graph_traversal.py # Policy graph traversal
β βββ source_retrieval.py # Citation lookup
β βββ visualize_graph.py # Graph visualization
β βββ ingestion.py # Document ingestion
β βββ tools.py # Shared utilities
β
βββ db_verification/ # ποΈ MCP Server - Database
β βββ db_verification_server.py # MCP tools for order lookup
β βββ db.py # Cloud SQL connector
β βββ llm_sql_runner.py # Natural language SQL
β
βββ doc_server/ # π MCP Server - Document Processing
β βββ mcp_doc_server.py # Invoice PDF parsing
β
βββ defect_analyzer/ # π MCP Server - Defect Analysis
β βββ mcp_server.py # Gemini Vision defect analysis
β
βββ neo4j_graph_engine/ # π· Neo4j Graph Operations
β βββ mcp_server.py # Graph query functions
β βββ db.py # Neo4j async driver
β
βββ policy_engine/ # π Policy Document Parser
β βββ mcp_server.py # LlamaParse integration
β
βββ knowledge_base_server/ # π Policy Compiler Web Service
β βββ main.py # FastAPI server with SSE
β βββ compiler_service.py # Compilation orchestration
β βββ static/ # Web UI assets
β
βββ web_dashboard_ui/ # π₯οΈ Frontend Dashboard
β βββ static/ # HTML/CSS/JS assets
β
βββ policy_docs/ # π Policy Documents
β βββ combined_policy.md # Parsed policy content
β βββ combined_policy_index.json # Citation index
β βββ policy_pdfs/ # Source PDF files
β
βββ artifacts/ # π Processing Outputs
β βββ knowledge_graph/ # Graph build artifacts
β
βββ Sample_Database_Creation/ # π§ Database Setup Scripts
β βββ invoice.sql # Schema definitions
β βββ process_invoices_update_db.py
β
βββ scripts/ # π οΈ Utility Scripts
β βββ cloud_db_connect.py # Database connection test
β βββ setup_gmail_auth.py # OAuth setup
β
βββ mcp_client.py # π§ͺ Interactive MCP client
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container configuration
βββ cloudbuild_gmail_processor.yaml # Gmail processor deployment
βββ cloudbuild_mcp_processor.yaml # MCP processor deployment
βββ cloudbuild_policy_compiler.yaml # Policy compiler deployment
- Python 3.11+
- Docker (optional)
- Google Cloud account with enabled APIs
- Neo4j Aura instance
- LlamaParse API key
# Clone the repository
git clone https://github.com/gagan0116/mcp_customer_support.git
cd mcp_customer_support
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # macOS/Linux
# Install dependencies
pip install -r requirements.txtCreate a .env file in the project root:
# Gemini API
GEMINI_API_KEY=your_gemini_api_key
# Neo4j Aura
NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io
NEO4J_USER=neo4j
NEO4J_PASSWORD=your_neo4j_password
# Cloud SQL (PostgreSQL)
CLOUD_INSTANCE=project:region:instance
CLOUD_DB_NAME=refunds_db
CLOUD_DB_USER=postgres
CLOUD_DB_PASS=your_db_password
# LlamaParse
LLAMA_CLOUD_API_KEY=your_llamaparse_key
# Google Cloud Storage
GCS_BUCKET_NAME=your_bucket_name# Run the MCP client (interactive testing)
python mcp_client.py
# Run the policy compiler web service
cd knowledge_base_server
python main.py| Name | GitHub |
|---|---|
| Gagan Vadlamudi | @gagan0116 |
| Naga Sai Satish Amara |