A2A & MCP in action
Thanks Sora for the Image

A2A & MCP in action

Remember how AI agents could team up to become our own personal concierge services? (you can refresh your memory here: https://www.linkedin.com/pulse/your-own-personal-concierge-service-ai-agents-making-happen-jain-cjn2c) Making complex stuff, like understanding insurance policies, feel like a breeze?

Well, I couldn’t let that idea just sit there! 😅

I’m thrilled to say I’ve rolled up my sleeves and hammered out a Proof of Concept – a real working POC – and you can actually see how it all ticks under the hood right here on GitHub: https://github.com/jainds/agentic-ai-mcp-workflows

So, how does this thing actually work? Let's talk data flows and functions!

Imagine you, the customer, pop open a sleek Streamlit UI (big shout-out to the Streamlit team – Adrien Treuille , Thiago Teixeira , and Amanda Kelly – for making web app creation so intuitive!). You type in your question, say, "is my vehicle covered under insurance?"

  1. The Handshake & First Brain (Streamlit UI to Domain Agent):

  • Your query doesn't just vanish into the ether. The Streamlit app, after handling your login(well in the PoC, I have a fake login), zips your message over to our first clever gear: the Domain Agent.
  • This agent is like the project manager with understanding of what different terms mean in the context of the business. Its main job? Intent Analysis. It uses LLM smarts (I used gtp 4o-mini, Thanks OpenAI and OpenRouter) and some YAML-based prompt templates to figure out exactly what you're asking. It's also the one that formats the final answer so it sounds human, not like a robot reading a database.

2. Delegating the Nitty-Gritty (Domain Agent to Technical Agent via A2A):

  • Once the Domain Agent knows you're asking about dental coverage, it doesn't try to fetch the policy data itself. Nope, it delegates! It uses the A2A (Agent-to-Agent) protocol (Checkout this lovely article by Ramanujan) based on Google's standards for this POC – to talk to the Technical Agent.
  • Think of A2A as a super-efficient internal memo system for AI agents to give each other tasks.

3. Getting the Goods (Technical Agent to Policy Server via MCP):

  • The Technical Agent is the specialist. Its core function is to act as a bridge. It takes the Domain Agent's request and translates it into a specific data retrieval operation. It knows how to talk to the data source.
  • Crucially, it communicates with domain agent and translates the requirements to the MCP (Model Context Protocol) – via a fastmcp client – to interact with the Policy Server. MCP is fantastic because it allows the Technical Agent to discover and use "tools" exposed by the Policy Server to get precisely the data it needs.
  • This Policy Server, by the way, is a lean, mean FastAPI application (kudos to Tiangolo!) and Pydantic (cheers, Samuel Colvin!) for solid data validation, serving up mock policy data from JSON files for this POC.

4. The Journey Back (Policy Server to You):

  • The Policy Server uses its MCP tools to find your insurance coverage info and sends it back to the Technical Agent.
  • The Technical Agent checks and verifies if the data is relevant and useful for customer query, passes it to the Domain Agent.
  • The Domain Agent, remembering its role to make things human-readable, formats this data into a natural language response.
  • And finally, this friendly answer pops up on your Streamlit UI.

5. Keeping an Eye on Things (The Ever-Watchful Monitoring System):

  • Throughout this whole dance, a dedicated Monitoring System is on the job. It’s using brilliant tools like Langfuse (Thanks!, Marc Klingen, Max Deichmann, and Clemens Thielen!) for LLM observability, tracking calls and token usage. It also leverages the Prometheus client (thanks to the Prometheus community!) and OpenTelemetry (cheers to the OpenTelemetry community!) to gather performance metrics and system health data. This ensures everything runs smoothly and we can spot any hiccups.

Why is this "Pattern" So Exciting?

This isn't just an insurance chatbot. The real beauty here is the framework and the pattern of specialized agents collaborating using clear protocols like A2A and MCP.

  • Modularity: Each agent (Domain, Technical, Policy Server) has a clear job. You can update one without breaking the others.
  • Scalability: Need to add more knowledge domains? or you think more technical specialty is needed? Add more specialized Technical Agents and corresponding data servers. The Domain Agent can learn to orchestrate them.
  • Flexibility: The MCP protocol means the Technical Agent doesn't need to be hardcoded for every single query type. It discovers and uses the "tools" the Policy or other MCP Server provides. This is huge! Think connecting your existing enterprise APIs to agents in a standard, governed way.
  • Reusability: Think beyond insurance! Customer support, internal knowledge bases, interactive application forms, running finance or HR workflows... any system where you need to:Understand user intent.Orchestrate multiple steps or tools.Retrieve, update and process data from various sources.Present it back in a user-friendly way. All can be done creating small reusable agentic bots and servers.

This POC demonstrates that creating these "agentic workflows" is not just a theoretical dream but a practical reality. It's about building systems that can break down complex problems and work together, much like a well-oiled team.

I genuinely believe this kind of architecture, leveraging modern AI communication protocols, is a massive step towards building more intuitive, powerful, and adaptable AI systems. I am planning to incorporate LangGraph to provide more orchestration, structure and oversight on the system

Would love for you to dive into the GitHub repo, check out the implementation(start with deployment docs), and share your thoughts. What other use cases come to your mind for this pattern?

Let's keep the conversation going!

How can I forget to mention this? Everything was built with help from an amazing agentic ai, CursorAI.

#AI #AgenticAI #Microservices #MCP #A2A #Innovation #POC #Python #FastAPI #Streamlit #OpenSource #LLM #InsuranceTech #FutureOfAI #openai #openrouter #gpt4o-mini #cursor

Ashutosh Kumar Jha

@TOGAF @CDMP @TMF @GCP-ML @AZURE-ML | Enterprise & Data Architect,AI/ML Data Scientist ,Digital Transformation Consultant ,Cloud,Big Datalakehouse, MLOps, GenAI Expert | Global Experience | Telecom,InsurTech,Fintech

4mo

Good guide Piyushkumar Jain a perfect read for Sunday morning .

Like
Reply
Diya Singh

3x Machine Learning Intern | AWS AI & ML Scholar ‘26 | CS Honors @ Purdue University | Head TA for CS180 | Rewriting The Code

5mo

This is an exciting implementation. I can easily envision a mesh of A2A and MCP orchestrating processes across inventory management, manufacturing operations, banking, insurance application processing, and beyond. Coincidentally, at today’s Google Developer Groups (GDG) Build with AI Virtual Mixer, I applied these same concepts to develop a social event planning application powered by A2A and MCP. Exciting to see these ideas gaining momentum in real-world solutions! (https://codelabs.developers.google.com/instavibe-adk-multi-agents/instructions#0).

Sivakumar Chandrasekaran

AI for Sales | UAE Banking (11+ yrs) | Revenue Intelligence & Growth

5mo

Insightful breakdown of the A2A MCP framework.This resonates well with the strategic modeling approaches we employ in retail banking, especially when aligning business logic with behavioral scoring models.

Vikas Mishra

Lead Business & Systems Analyst

5mo

AI driven approaches are not a myth anymore. Good read.

Yogendra Pratap Singh

Principal Solutions Architect | Blogger

5mo

Exciting glimpse into the future of AI-driven convenience. The possibilities with personal AI agents are truly game-changing...

Like
Reply

To view or add a comment, sign in

More articles by Piyushkumar Jain

Others also viewed

Explore content categories