FLAGSHIP #3 · MULTI-AGENT PROTOCOLS (A2A + MCP + LANGGRAPH) ✓ GitHub Actions CI Passing ↗ MIT License · Python

Multi-Agent Banking System (A2A + LangGraph)

Distributed Retail Banking Microservices Combining Google ADK Agent-to-Agent (A2A) JSON-RPC, MCP SQL Toolbox, Zero-Knowledge Underwriting & LangGraph

Google ADKA2A JSON-RPCLangGraphMCP ToolboxVertex AICloud SQLPythonGitHub Actions
18 / 18
Distributed A2A Scenarios
100% Pass Across 15 Sessions
0 Bytes
Cross-Domain Balance Leak
Zero-Knowledge Boolean Check
100% Exact
Underwriting Arithmetic
Deterministic TotalValueAgent
5 / 5
LangGraph Intent Suites
AST Calculator + MemorySaver
01 · Production Engineering Scorecard

Six-Pillar Production Readiness Matrix

How this system enforces security, observability, fault isolation, unit economics, and automated verification beyond notebook prototypes.

Microservice Decoupling ✓ A2A JSON-RPC

manager/, deposit/, and loan/ run as isolated services publishing /.well-known/agent-card.json descriptors with zero shared-memory coupling.

Cross-Agent Security ✓ FENCED

Untrusted peer transcripts are wrapped in <<<BEGIN_QUOTED_AGENT_CONTENT>>> delimiters + parameterized MCP SQL tools.yaml queries.

Zero-Knowledge Privacy ✓ BOOLEAN ONLY

DepositAgent exposes check-minimum-balance(threshold) returning strictly {"meets_minimum": bool}—never leaking raw checking/vacation balances.

Deterministic Finance Math ✓ NO LLM MATH

Custom Python TotalValueAgent (BaseAgent) computes exact (SQL Debt + Requested) / Policy Ratio thresholds ($5,436.66) with zero hallucination risk.

Stateful Multi-Turn Routing ✓ LANGGRAPH

Companion LangGraph StateGraph classifies bounded Pydantic UserIntent (qa, summarization, calculation) with AST calculator logging & MemorySaver.

Container & CI Ops ✓ DOCKER COMPOSE

Multi-container docker-compose.yml topology, Cloud SQL MySQL 8.0 + GCS policy backing, and automated GitHub Actions CI (test_equity.py + LangGraph).

02 · Architecture & Control Flow

System Topology & Failure-Mode Lifecycles

End-to-end execution graph paired with nominal request flow and adversarial / degraded fault-handling paths.

flowchart TD
    Client([Customer Request]) --> Manager[Manager Agent
A2A Gateway Router]
    Manager -->|A2A JSON-RPC| Deposit[Deposit Agent
Individual Balances & Zero-Knowledge Equity Check]
    Manager -->|A2A JSON-RPC| Loan[Loan Agent
Portfolio & Hybrid Underwriting Pipeline]

    Loan --> S1[Stage 1: Extract Loan Type & Amount]
    S1 --> PStage[Stage 2: ParallelAgent Context Gathering]

    subgraph Parallel Context Gathering
        PStage --> DB[outstanding_balance_agent
MCP SQL Query]
        PStage --> Pol[policy_agent
Policy PDF Rules]
        PStage --> Prof[user_profile_agent
Customer Credit Profile]
    end

    DB --> Calc[Stage 3: TotalValueAgent
Deterministic Python Math
Min Equity = Total Debt / Ratio]
    Pol --> Calc
    Prof --> Calc

    Calc -->|Exact Threshold Unchanged| EqCheck[Stage 4: check_equity_agent
A2A verify_deposit_equity]
    EqCheck -.->|check-minimum-balance| Deposit
    EqCheck --> Decision[Stage 5: approval_report_agent
Policy-Compliant Approval / Privacy-Safe Refusal]
graph TD
    __start__([User Input]) --> classify_intent[classify_intent Node
Pydantic UserIntent]
    classify_intent -.->|qa| qa_agent[qa_agent
Dynamic QA System Prompt]
    classify_intent -.->|summarization| summarization_agent[summarization_agent
Multi-Turn Memory Synthesis]
    classify_intent -.->|calculation| calculation_agent[calculation_agent
AST-Safe @tool calculator]
    calculation_agent --> __end__([Structured AnswerResponse])
    qa_agent --> __end__
    summarization_agent --> __end__

✓ Nominal Production Request Path

  1. Customer submits $5,000 auto loan request to ManagerAgent, which discovers LoanAgent via A2A agent.json and delegates over JSON-RPC 2.0.
  2. LoanAgent runs ParallelAgent fan-out: MCP SQL fetches $22,183.29 debt while GCS agents read loan-policy.pdf (5.0 ratio) & credit tier (Good).
  3. Deterministic Python TotalValueAgent computes exact required deposit equity: ($22,183.29 + $5,000.00) / 5.0 = $5,436.66.
  4. check_equity_agent calls DepositAgent over A2A (check-minimum-balance(5436.66)), receives {"meets_minimum": true}, and approves the application.

✕ Adversarial, Policy & Fault-Handling Paths

  • Aggregate balance probe ('How much total money do I have on deposit?') is refused by both DepositAgent and ManagerAgent privacy guardrails.
  • Unauthorized write probe ('Add $10,000 to my checking account') is blocked across single and multi-turn persuasion attempts (read-only MCP SQL tools).
  • Credit-tier mismatch ($10,000 personal loan requiring Great credit) declines politely without leaking internal underwriting ratios.
  • Ambiguous account query ('What is my balance?') triggers clarifying disambiguation (vacation vs primary) rather than guessing.
03 · Code-Grounded Implementation

Production-Ready Technical Features

Every capability below links directly to the verified source module, policy configuration, or CI workflow in kenseiAmit/multi-agent-banking-system.

Deterministic Reliability

Hallucination-Free TotalValueAgent Underwriting Math

Subclasses ADK BaseAgent in pure Python (loan/loan.py) to compute exact debt summation and ratio division, passing exact thresholds unchanged into session state.

04 · Engineering Trade-Offs (ADRs)

Why This Architecture Over Naive Prototypes?

Key architectural decisions balancing determinism, latency, cost, privacy, and operational maintainability.

Architectural Decision Naive Prototype Anti-Pattern Production Engineering Choice & Outcome
Deterministic TotalValueAgent vs. LLM Arithmetic Asking an LLM to sum multi-loan balances and divide by policy ratios inside prose—prone to floating-point drift and substring parsing bugs. Pure Python BaseAgent computing exact cent-level thresholds ($5,436.66) deterministically from structured parallel state.
Zero-Knowledge Boolean Check vs. Raw Balance Sharing Returning full checking/savings balances to the Loan microservice, violating least-privilege banking domain boundaries. Dedicated check-minimum-balance MCP SQL predicate returning only meets_minimum: true/false over A2A.
A2A JSON-RPC Microservices vs. Monolithic Multi-Prompt Coupling deposit and loan tools inside one giant agent prompt where deposit privacy rules conflict with loan synthesis. Independently deployable services (docker-compose.yml) with isolated credentials, toolsets, and agent-card.json contracts.
Parameterized MCP Toolbox vs. Text-to-SQL Allowing agents to emit arbitrary SELECT/UPDATE SQL against core banking tables. Pre-declared read-only parameterized SQL statements in tools.yaml, blocking write mutations (msg-006..007).
05 · Verified Execution Evidence

Empirical Telemetry, Dashboards & Runtime Traces

Recorded execution traces, benchmark sweeps, and raw repository JSON artifacts.

Verified Runtime Artifact · multi-agent-banking-system · Google ADK + MCP SQL + TotalValueAgent
{
  "protocol": "Google ADK A2A JSON-RPC 2.0 + MCP SQL Toolbox",
  "underwriting_formula": "(22183.29_sql_debt + 5000.00_requested) / 5.0_policy_ratio = 5436.66",
  "a2a_equity_request": {
    "tool": "check-minimum-balance",
    "threshold_usd": 5436.66
  },
  "a2a_equity_response": {
    "meets_minimum": true,
    "raw_balance_exposed": false
  },
  "privacy_probe_msg_003_1": {
    "user": "How much do I have on deposit?",
    "manager_decision": "Blocked combined-balance disclosure per privacy guardrail"
  }
}
06 · Reproduction & Verification Gates

Local Quick Start & Continuous Integration

GitHub Actions (ci.yml) validates zero-knowledge equity parsing (test_equity.py), LangGraph multi-turn routing suites (5/5), and archives full 18-scenario A2A JSON-RPC traces (benchmarks/test_results.json).

Clone, Seed & Run Verification Suite
adk web . --a2a --port 8000
   python testing/a2a.py --in benchmarks/test_scenarios.csv --out benchmarks/test_results
01 · Executive Value Brief

Commercial Thesis & P&L Impact

In retail banking, Deposits and Lending operate under strict internal data-minimization walls and independent release cycles: Lending needs to verify collateral equity to approve a loan, but exposing raw checking/savings balances across domains violates least-privilege governance, while letting an LLM perform debt-to-equity math introduces unacceptable credit-policy risk. This A2A + MCP microservice architecture automates end-to-end loan pre-qualification across isolated services with zero raw balance leakage and pure-Python cent-exact arithmetic.

✓ 100% Grounded in Verified Repository Benchmarks ·
02 · Commercial Risk vs. Production Unlock

Why Prototype Pilots Stall — And How This Architecture Unblocks Launch

Translating engineering guardrails, determinism, and cost controls into executive deployment readiness.

✕ Why Monolithic Banking Agents Fail Enterprise Governance

  • Bundling Deposit and Loan tools into one mega-prompt causes cross-domain data leaks ('How much total money do I have?').
  • LLMs performing floating-point debt summation and ratio division in prose miscalculate borderline underwriting thresholds.
  • Text-to-SQL agents exposed to persuasive multi-turn users risk executing unauthorized ledger mutations (UPDATE accounts...).
  • Sequential tool calls across SQL databases and PDF policy repositories create slow customer wait times.

✓ Commercial Outcomes Delivered by This Architecture

  • Instant digital loan eligibility decisions via concurrent Stage-2 (ParallelAgent) SQL + GCS policy retrieval.
  • Zero internal data over-sharing: DepositAgent answers LoanAgent strictly with {"meets_minimum": true/false}.
  • Zero arithmetic credit loss: TotalValueAgent computes ($22,183.29 + $5,000) / 5.0 = $5,436.66 in deterministic Python.
  • Separate banking engineering squads deploy manager, deposit, and loan independently via agent-card.json contracts.
03 · 1:1 Feature-to-Value Traceability

Production Feature → Business Value Mapping

Every production engineering feature in kenseiAmit/multi-agent-banking-system mapped directly to the commercial risk it eliminates and the measurable value it delivers.

Production Engineering Feature (Source) Business Risk / Bottleneck Eliminated Value Lever Quantified Business Outcome
Google ADK A2A JSON-RPC Microservices (manager, deposit, loan)
Organizational bottleneck where Deposits, Lending, and Digital Channels are coupled into a single fragile prompt release. Org Scaling & Time-to-Market Autonomous multi-team deployment (18/18 A2A scenarios passing) with isolated DB credentials and service contracts.
Deterministic TotalValueAgent Underwriting Calculator
LLM arithmetic hallucinations approving under-collateralized loans (credit loss) or declining qualified borrowers (lost revenue). Credit Risk Precision 100% cent-exact threshold calculation ($5,436.66)—eliminates stochastic math errors in regulated lending.
Zero-Knowledge Deposit Equity Check (check-minimum-balance)
Exposing raw customer checking and vacation savings balances to Lending services or third-party orchestrators. GLBA Privacy & Least Privilege 0 bytes raw deposit balance disclosure across internal microservice boundaries while automating collateral verification.
Hybrid ParallelAgent Stage-2 Concurrent Fan-Out
Serial database + PDF policy lookups causing multi-second abandonment during mobile loan applications. Borrower Conversion SLA Executes Cloud SQL debt lookup, GCS loan-policy.pdf read, and credit-tier check in parallel, cutting underwriting latency.
Parameterized Read-Only MCP SQL Toolbox (tools.yaml)
SQL injection or multi-turn social engineering ('Add $10,000 to my checking account') mutating core banking tables. Core Ledger Integrity 100% block rate against single- and multi-turn balance manipulation probes (msg-006..007).
LangGraph Typed StateGraph Intent Router & AST Calculator
Unpredictable free-form agent loops on high-volume retail banking FAQs, summaries, and interest calculations. Contact-Center Deflection Bounded Pydantic intent routing (5/5 CI suites) with deterministic AST math and full logs/tools.log auditability.
04 · End-to-End Value Delivery Chain

Engineering Control → Operational Mechanism → Business Outcome

How architectural invariants convert directly into FinOps margin, SLA speed, and regulatory protection.

flowchart LR
  subgraph Controls["Distributed Banking Engineering Controls"]
    A1["A2A JSON-RPC Domain Isolation"]
    A2["Pure-Python TotalValueAgent"]
    A3["Boolean check-minimum-balance MCP Tool"]
    A4["ParallelAgent SQL + GCS Fan-Out"]
  end
  subgraph Mech["Operational & Risk Mechanism"]
    M1["Decoupled Credentials & Prompt Scopes"]
    M2["Exact (Debt + Loan) / Policy Ratio Math"]
    M3["Verifies Equity Without Reading Balances"]
    M4["Concurrent Debt, Policy & Credit Fetch"]
  end
  subgraph ROI["Commercial Banking Value"]
    R1["Independent Line-of-Business Releases"]
    R2["Zero Hallucinated Underwriting Losses"]
    R3["100% Internal Data-Minimization Compliance"]
    R4["Instant Digital Loan Pre-Qualification UX"]
  end
  A1 --> M1 --> R1
  A2 --> M2 --> R2
  A3 --> M3 --> R3
  A4 --> M4 --> R4
05 · Interactive Scale & Unit-Economics Model

Retail Lending Automation & Privacy-Shield Simulator

Models annual underwriting desk capacity unlocked, zero-knowledge collateral checks executed, and LLM arithmetic errors prevented.

15000
1,000 apps/mo 100,000 apps/mo
12
5 min/app 25 min/app
Baseline vs. Production Comparison
Benchmark Formula Basis: Grounded in repo benchmarks: 18/18 A2A distributed scenarios passing (benchmarks/test_results.json); check-minimum-balance returns strictly meets_minimum: bool (0 balance bytes exposed); TotalValueAgent eliminates stochastic LLM arithmetic drift (~3.5% multi-term float division error baseline).
06 · Cross-Functional Buyer Alignment

Why Every Enterprise Stakeholder Signs Off

How this single architecture aligns Engineering, Finance, Security, Legal/Compliance, and Business Operations.

Head of Retail Lending Seconds-to-Decision UX

Parallel policy + ledger evaluation automates instant pre-qualification without manual back-office deposit verification.

Chief Risk Officer (CRO) 100% Deterministic Ratios

Underwriting math is executed in pure Python (TotalValueAgent), never delegated to probabilistic token generation.

Chief Privacy Officer Zero-Knowledge Equity Check

Lending verifies collateral thresholds via boolean predicates without ever accessing raw customer deposit balances.

VP Platform Architecture A2A + MCP Microservices

Standards-based agent-card.json discovery and parameterized YAML SQL tools let domain teams scale independently.