
Explore how Bankstack's AI layer integrates Spring AI, RAG, and MCP, with multi-agent orchestration to transform enterprise banking architecture, featuring phase-wise prompts, memory, and workflows.
Join Bankstack AI GitHub, accept invite, clone repositories, build with Maven, and run Account Service, Biller Service, Payment Orchestrator, and Customer Service to enable MCP demos and trace banking APIs.
Learn how to turn banking APIs into enterprise ai using large language models, ai system behavior, three capability types, and Bankstack's ai constitution to manage hallucinations.
Discover how large language models generate text token by token from learned patterns, not by retrieving fixed answers, and how prompts and interfaces shape responses in banking today.
Illustrate how deterministic systems ensure exact balance changes in banking transactions. Compare probabilistic AI outputs with authoritative deterministic ledgers, clarifying that AI assists while the ledger remains authoritative.
Explore how LLMs deploy reasoning, retrieval, and tools to power enterprise AI in banking, with RAG grounding answers in approved documents and live system actions via tools.
Understand AI hallucination: models generate plausible but unverified answers; learn to separate questions by source of truth and rely on retrieval, governance, and live banking data to prevent invented information.
Explain the Bankstack architecture, a three-layer enterprise AI framework—reasoning, integration, governance—for mapping probabilistic LLM reasoning, retrieval, tools, and governance controls.
Define the BankStack AI Constitution—eight articles that declare AI is not the source of truth and require traceable verification against core deterministic banking systems.
Choose the model and framework for an enterprise banking AI app; start with OLAMA on-premise to focus on architecture, then use Spring AI with Java to swap providers.
Install OLAMA locally, verify the engine on port 11434, then pull and run LAMA 3.2 with no system prompt, no rules, no governance.
Demonstrate how a single Spring AI starter enables a local AI-powered Spring Boot app with OLAMA, via the chat model abstraction and simple configuration.
Explore how system prompts and user prompts form the instruction layer of AI, and learn the CTIDR framework—context, task, instructions, data, and response format—to build reliable prompt contracts for production.
Discover how prompt contracts guide enterprise banking ai to answer only from approved policy documents, using a fixed data section, retrieval, and citations to prevent hallucination.
Explains a Spring-based eval harness that validates rule-driven responses across multiple prompts, using a JSON policy file and test cases to produce CSV and JSON reports.
Follow the eval-harness-runner, an evaluation framework that runs test cases five times, scores results, detects flakiness, and writes report.json and report.csv from eval suites and policy chunks.
learn how retrieval augmented generation solves enterprise knowledge access by storing and retrieving evidence from embeddings and vector databases, then assembling context and citations into a policy-aware answer.
Explore the RAG mental model, where ingestion prepares the knowledge base and retrieval supplies evidence in real time, using embeddings to enable meaning-based search.
Store and search embeddings in pgVector-enabled PostgreSQL to perform semantic search across thousands of vectors, leveraging embedding models lama3.2 and nomic embedtext.
Convert business documents into structured markdown to improve retrieval, using top-level hashes for use cases and subsections for goals, rules, and criteria to create precise chunk boundaries and better embeddings.
Understand how ingestion cleans, chunks by policy boundaries, enriches with metadata, and uses embeddings with vector stores and keyword indexes for robust hybrid retrieval.
Trace the ingestion pipeline from post request to vector store, featuring markdown chunking, idempotent ingestion, deterministic chunk IDs, policy-aware chunks, and batch embeddings into a PostgreSQL index.
Ingest the customer lifecycle document for banking rag, with five use cases as chunks per heading, highlighting login is disabled until kyc verified and vector plus keyword indexing for retrieval.
Navigate a classified retrieval pipeline that builds access context, enforces permissions, and retrieves evidence via hybrid vector and keyword search to produce a compliant, traceable answer with citations.
Explore a practical hybrid retrieval pipeline that combines semantic vector search and exact keyword matching, with JWT-based access control, policy-based request classification, and merged scoring from vector and keyword streams.
Apply permission filtering to determine visible chunks by caller context, check sensitivity and allowed scopes, with administrators bypassing checks, then enforce policy validity using start and end dates.
Explore how the hybrid search re-ranker refines retrieved evidence by extracting important terms, applying a lexical overlap boost, and promoting top K candidates. Note this is a prototype re-ranker.
Apply the relevance gate to ensure results exist and meet a relevance threshold, then assemble a citation-ready context with up to three deduplicated snippets for the CTIDR prompt.
Constructs a CTIDR prompt from retrieved evidence, optionally loads conversation memory for follow-ups, and performs citation verification to ensure the final answer derives strictly from the assembled chunks.
Demonstrate end-to-end rag retrieval from question to verified answer in a banking context. Trace authentication with jwt tokens, semantic and keyword retrieval, policy checks, and citation verification.
Ingest content and retrieve through a governed rag system, including cleaning, chunking, fingerprinting, permissions, vector storage, and citation-verified evidence assembly.
Learn how the model uses the model context protocol (MCP) to act on banking systems through a controlled interface of approved tools, enabling authorized actions with guardrails and audit trails.
Describe the MCP architecture with a host, a translator client, and a server that governs tools through a json rpc transport. Learn handshakes and per-request validation for safe banking actions.
Deploy the MCP server as a SpringBoot app, exposing the MCP endpoint at /MCP and auto-registering tools via annotation scanning, with YAML configuring synchronous tool execution over streamable JSON RPC.
Develop and register a first MCP tool to fetch account balance, wiring a single input/output tool with consistent responses, safety checks, token relay, and a shaped result for the AI.
Explore how read tools like getTransactions and getCustomerProfile handle parameters, optional filters, and pagination. The AI uses the tool contract and response shapes, including KYC status.
Implement a two-step design for write tools in banking: prepare bill pay with validation and fraud check to issue a time-limited token, then confirm bill pay to submit funds.
Learn to prepare bill pay with Bankstack tools, validate all six fields in one pass, and generate a time-limited confirmation token while applying a fraud gate.
Explore confirm bill pay: a single-use token validates existence, tool name, actor, and expiry, then rebuilds the payment and submits via an approved service layer, plus policy documents search tool.
Explore the knowledge tool that searches policy documents in Bankstack, routing a language query to rack service within the MCP tool ecosystem, delivering the answer with verification status and citations.
Enforce a safety layer that validates JWTs, determines who is calling, verifies tool access, and checks resource ownership, while auditing every tool execution.
Identify who is calling by resolving the authenticated caller from the JWT, map authorities to roles, and propagate a current actor and invocation context through the safety layer.
Explore how ToolPolicyEvaluator enforces access controls for tools by validating actor role, confirmation, and OTP, ensuring policy-driven tool access is auditable.
Verify ownership and log every tool invocation to enforce access control in banking tools, including admin bypass, customer external ID checks, and a structured tool audit with a correlation ID.
Uncover the complete tool pattern that underpins Bankstack tools, combining the safety layer, invocation context, ownership and role checks, audit trail, and precise response shaping across tools.
Learn how errors act as a tool contract in enterprise AI for banking, using the MCP test harness to verify tool calls, token scope, and structured errors.
Test the MCP tool contract with Postman to verify token-based permissions, ownership enforcement, deterministic tools, and RAG policy search across balance, transactions, and payments.
Revisits the MCP architecture by building a gateway-controlled banking agent where the model assists, while the gateway selects and validates tools like get account balance and repair bill pay.
Configure the MCP client in Spring Boot with Spring AI Starter MCP Client to manage handshake, tool discovery, session management, and tool call transport; run two models locally via OLAMA.
Spring AI reads the MCP client config from application.yaml, connects to the MCP server, and creates callbacks for tools, packaging arguments for execution via the MCP transport layer.
The agent gateway coordinates user messages, enforces a 4,000-character cap, and returns the full execution picture—route taken, tool used, arguments, and MCP results—while resolving sessions and confirming two-step bill pay.
Route classification in the gateway uses four layers: safety, deterministic routing, AI, and keyword fallback to decide tool versus AI model, prioritizing safety and deterministic responses.
Explore how the enterprise gateway resolves tool intent through a deterministic router, AI tool intent resolver, and keyword fallback, ensuring approved tools with a 0.7 confidence threshold before execution.
Identify and extract tool arguments in a contract-driven gateway pipeline, from simple messages with no extraction to complex billpay arguments, using grounding validator to prevent hallucinations.
Normalize and validate model extractions through alias resolution and regex recovery, yielding a normalized confidence score and a structured needs input for missing fields before MCP calls.
Validate the tool callback by name, unwrap mcp content to json, and deserialize into a tool execution result, ensuring contract validity and safe, tool-specific error messages for http failures.
The MCP server presents tool execution results deterministically: it formats successful outputs into human-readable sentences (balances, transaction counts, policy answers) and returns the full structured result alongside the answer.
Explains the two-turn bill payment flow, showing how a prepared token is stored in an in-memory store against the session ID and released after an explicit yes.
Explore the end-to-end bank agent workflow, from api boundary validation and safety guard to deterministic router, ai classifier with confidence scores, keyword fallback, and secure mcp tool execution.
Showcases a Postman demo where the ai agent safely routes requests through approved MCP tools to initiate a two-turn bill payment within the authenticated banking boundary.
The stateless boundary in phase 5 exposes the limits of single-message understanding, where the gateway, extraction, and routing work but memory fails; controlled memory joins next.
Explore controlled memory and structured conversation context in the bankstack memory agent, preserving the original prepare and confirm flow while tracking incomplete tool calls with awaiting fields.
Learn how missing field recovery works in the Bankstack gateway, including intent switching detection and mergeContinuation based argument merging.
Watch a live demo of controlled memory in action as the Bankstack memory agent merges partial inputs across turns to complete bill payment with the MCP server and confirmation token.
AI Usage Disclosure
This course includes the use of artificial intelligence technologies for educational demonstration.
Technology Stack:
Spring Boot, Spring AI, Java, Ollama, PostgreSQL, PGVector, Model Context Protocol (MCP)
Course Overview
Enterprise AI for Banking with Spring AI, RAG, MCP & Agents is a hands-on, architecture-driven course that demonstrates how governed AI capabilities can be added to a realistic Spring Boot banking platform.
Everything built in this course is a working educational prototype. The code is designed to teach enterprise Java AI architecture: how components fit together, why particular design decisions are made, and how these patterns can be applied in a regulated banking context.
What You Will Learn
Throughout this advanced Spring Boot course, you will learn how to design AI systems that combine:
Large Language Models (LLMs) and prompt contracts
Evaluation and controlled refusal patterns
Retrieval-Augmented Generation (RAG) with PostgreSQL and PGVector
MCP-based banking tools and model context protocol implementation
Governed agent gateways and authorization boundaries
Controlled conversational memory and context recovery
Guardrails and high-risk action confirmation boundaries
Multi-step workflows and deterministic validation rules
Multi-agent orchestration and delegation
Why Spring AI?
Spring AI is used as the primary framework for implementing the AI layer. The objective is not to recreate an AI framework from scratch, but to understand how Spring AI fits into a broader enterprise architecture where deterministic banking services, microservices, audit trails, and validation rules remain authoritative.
Across the course, the BankStack application evolves from a traditional microservices platform into a governed enterprise AI prototype. You will see how AI can:
Answer user queries securely from approved documents
Invoke enterprise banking tools through controlled boundaries
Preserve and recover context during complex user interactions
Coordinate multi-step transactional workflows
Enforce strict human-in-the-loop confirmation before high-risk actions
Delegate complex work to specialized account, payment, support, and risk agents
Target Audience & Prerequisites
This is not a beginner-level, line-by-line coding course. This course is specifically intended for professional software engineers, software architects, and tech leads who are already comfortable with Java, Spring Boot, REST APIs, microservices, and the basic fundamentals of Spring AI.
By the end of this course, you will master production-style enterprise AI architectures using Spring Boot and Spring AI. You will walk away with a fully functioning, advanced prototype demonstrating RAG, MCP, memory, workflows, guardrails, and multi-agent patterns end-to-end.
Enrol today to bridge the gap between traditional enterprise Spring Boot applications and cutting-edge Multi-Agent AI engineering!