Building a Reliable Multi-Agent customer support chatbot- Authentication Agent Part-3
This is in continuation of our article series for building customer support Chatbot. In this Article we will explore Authentication crew design in more detail.
Introduction
As our chatbot is for banking applications, So before we can fetch or show any private data as part of conversation with user, its very important to authenticate the user.
Authenticator Crew
This Crew handles the basic authentication of user before any loan application related information can be fetched for user. This crew consist of Authenticator Agent with its own Mobile number and OTP tasks.
Introduction
Based on the users message, Router will determine if user needs to be authenticated or else. Based on users query like
“I need to know my loan application status?”
or
“Need to apply for education loan?”
Router will invoke the Authenticator crew workflow, where in the agent will ask user for his mobile number and OTP and performs OTP verfication via API calls done through the custom tools.
Authenticator Agent
This agent performs 2 tasks sequentially.
- To get mobile number from user , validate it and send OTP to user using auth tools.
- To get OTP from user , validate and then verify it using auth tools.
Code for Authenticator crew is shared below-
In code on line — 1–55 we define all custom tools needed to do the required validations and API calls.
Line 58–93 — We define the authenticator crew to be used as LangGraph node.
Line 95- 128 — We create authenticator agent with role, goal and backstory defining agents System prompt.
Line 131–End — We define authenticator tasks to Ask the user for mobile number / OTP, validating it and then verifying via API call.
Stay Tuned for Part 4 of this series where we will be exploring Loan Manager Crew and will conclude this series. Subsequently we will explore RAG agent in more depth.