Inspiration

Growing up, I didn’t just hear about banking—I lived it. My dad was a banker, and our dinner table conversations often revolved around interest rates, customer trust, and the invisible threats that could shake a financial institution to its core. I saw firsthand how a single act of fraud or a lapse in compliance could ripple through an entire system, sometimes leading to devastating consequences. One story in particular stuck with me: a regional bank that collapsed under the weight of unchecked internal fraud and regulatory violations. My dad had worked closely with that institution. Watching the fallout—lost jobs, shattered reputations, and families affected—left a mark.

That experience planted a seed. I became obsessed with the idea that technology could do more than just process transactions—it could protect them. I wanted to build something that could think ahead, spot the red flags early, and help banks stay resilient. This project is my way of honoring that vision. It’s not just code—it’s a tribute to the lessons I learned growing up, and a step toward a future where financial systems are smarter, safer, and more proactive.

How I Built It

The project was built as a new microservice within the Bank of Anthos architecture. Here's a breakdown of the key steps:

  1. Environment Setup

    • Cloned the Bank of Anthos repo
    • Used Google Cloud Shell for development and deployment
    • Installed tools: Docker, Skaffold, kubectl, Python 3.12+, JDK 21+
  2. Agent Microservice Development

    • Created a new Python-based service: risk-agent
    • Defined dependencies using piptools and requirements.in
    • Integrated Gemini via google-cloud-aiplatform
    • Used ADK to define a listening agent with a custom action: analyzefinancialtransaction
  3. Core Logic

    • The agent receives transaction data and sends a prompt to Gemini:
      python prompt = f"Analyze the following financial transaction for potential risk and fraud indicators..."
    • Gemini returns a risk score and explanation, which is logged and returned to the calling service.
  4. Deployment

    • Updated skaffold.yaml to include the new microservice
    • Created Kubernetes manifests (deployment.yaml, service.yaml)
    • Deployed the full stack to GKE using Skaffold

What I Learned

Building this project was more than just a technical exercise—it was a personal reckoning. Growing up around banking, I thought I understood the stakes. But diving into the architecture of a modern financial system, I realized how fragile trust can be when risk isn’t proactively managed.

Here’s what I truly learned:

  • Technology can be a guardian: With the right tools—like Gemini and the Agent Developer Kit—I saw how AI can shift from being reactive to proactive. It’s not just about catching fraud after it happens; it’s about predicting it before it does.

  • Legacy lessons meet modern systems: My dad’s stories taught me the human cost of noncompliance. This project taught me how those lessons can be encoded into intelligent systems that learn, adapt, and protect.

  • Cloud-native thinking is powerful: Working with GKE and Skaffold showed me how scalable, modular architectures can make innovation faster and safer. I learned how to deploy microservices that talk to each other, evolve independently, and stay resilient under pressure.

  • AI isn’t magic—it’s design: Prompt engineering, latency optimization, and model selection were all critical. I learned how to shape AI responses with precision, and how to validate them with real-world heuristics.

  • Every line of code carries responsibility: When you’re building something that could one day protect millions of dollars—or livelihoods—you start to see software not just as a tool, but as a promise.

Challenges Faced

  • Environment Errors: Initial setup using runinbash_session failed due to file system issues. Switching to Google Cloud Shell resolved this.
  • Model Integration: Gemini wasn’t directly available via ADK initially, so I used text-bison as a placeholder.
  • Deployment Complexity: Ensuring the agent was properly wired into the existing Bank of Anthos architecture required careful updates to Skaffold and Kubernetes configs.
  • Latency: Real-time analysis required optimizing prompt structure and response handling to minimize delays.

Bonus: Risk Scoring Formula

While Gemini handles the natural-language analysis, I experimented with a simple risk scoring heuristic:

$$ R = \alpha \cdot T + \beta \cdot F + \gamma \cdot C $$

Where:

  • ( R ) = Risk score
  • ( T ) = Transaction amount
  • ( F ) = Frequency of similar transactions
  • ( C ) = Country risk index
  • ( \alpha, \beta, \gamma ) = Tunable weights

This formula was used to validate Gemini’s output and explore hybrid scoring models.

Built With

Share this project:

Updates