AWS Machine Learning Blog 2024年10月09日
Automate user on-boarding for financial services with a digital assistant powered by Amazon Bedrock
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了一种利用生成式 AI 来简化金融服务用户入职流程的解决方案,该解决方案通过数字助理实现。在银行业,新客户入职是客户旅程中的关键步骤,涉及一系列旨在满足了解您的客户 (KYC) 要求、进行必要的验证以及向他们介绍银行产品或服务的活动。传统上,客户入职一直是一个繁琐且高度人工化的流程。我们的解决方案通过在 AWS 上使用生成式 AI 助理,为解决这一挑战提供了实用指导。Amazon Bedrock 是一种完全托管的服务,通过单个 API 提供来自领先 AI 公司(如 AI21 Labs、Anthropic、Cohere、Meta、Mistral AI、Stability AI 和 Amazon)的高性能基础模型 (FM) 的选择,以及构建生成式 AI 应用程序所需的广泛功能,包括安全、隐私和负责任的 AI。我们使用 Anthropic 的 Claude 3.5 Sonnet 在 Amazon Bedrock 上构建了一个数字助理,它可以自动执行文档处理、身份验证并通过对话交互与客户互动。因此,客户可以通过安全、自动化的工作流程在几分钟内完成入职。本文为您提供了一种解决方案以及相应的代码,银行可以使用这些代码来大幅提升客户体验,并从一开始就建立牢固的客户关系。

🤔 传统入职流程的挑战: 传统银行入职流程面临着当前数字环境中的挑战,因为许多机构没有完全自动化的账户开户系统。虽然其他行业的客户可以访问智能助理,但银行行业的客户往往会遇到遗留流程。随着金融服务行业适应不断变化的消费者期望,需要满足对即时和全天候服务可用性的需求。 与手动入职流程相关的挑战包括但不限于以下内容: - 耗时的文书工作 - 新客户被要求手动填写大量的文书工作,包括账户开户表格、披露文件等。审查纸质文件也占用宝贵的工作人员时间。这种冗长的文书工作流程会导致入职速度缓慢,并造成糟糕的客户体验。 - 安全风险 - 与数字流程相比,纸质文件和面对面身份验证缺乏安全性,因为它们容易被篡改、丢失且缺乏可追溯性。例如,使用纸质文件存在更大的身份盗窃和欺诈风险,因为它们可以被更改或丢失,而不会留下审计跟踪。 - 可访问性问题 - 要求在分支机构进行面对面账户开户会为许多客户带来可访问性挑战,包括老年人和残疾人。 - 服务时间有限 - 账户开户流程仅在分支机构营业时间内可用,这限制了客户完成入职流程的时间范围。这种限制影响了客户在他们喜欢的时间启动账户开户的灵活性。 - 成本高昂 - 手动文书处理和面对面验证是劳动密集型任务,需要大量的工作人员时间和资源,导致运营成本高昂。

🤖 AI 驱动的服务: AI 驱动的服务为自助账户开户提供了自动化、安全和合规的流程。提供与当前数字标准一致的入职体验可能会为未来银行提供竞争优势。

💡 解决方案概述: 该解决方案允许用户通过对话界面远程开立银行账户,无需前往实体分支机构。我们创建了一个名为 Penny 的数字助理,以指导用户完成整个流程,包括上传 KYC 文档以及使用文档扫描和面部识别来促进身份验证。该方法使用检索增强生成 (RAG),它将文本生成功能与数据库查询相结合,以针对客户查询提供上下文相关的响应。实施数字入职减少了传统手动账户开户流程中存在的可访问性障碍。此解决方案的代码可在 GitHub 存储库中找到。 我们应用程序的大脑是一个自定义 LangChain 代理。当用户想要开立新的银行账户时,代理将帮助他们使用与每个入职步骤相对应的预配置阶段完成入职流程。每个阶段都可能使用 LangChain 工具,从而实现入职的自动化和编排。这些工具调用 AWS 服务 API 以获得所需的功能。 下图表示所提议解决方案的高级架构。 应用程序的流程如下: - 用户访问托管在 AWS Amplify 中的前端网站。AWS Amplify 是一种端到端解决方案,使前端 Web 开发人员能够构建和部署安全、可扩展的全栈应用程序。 - 网站调用 Amazon CloudFront 端点以与数字助理 Penny 进行交互,Penny 被容器化并部署在 AWS Fargate 中。Fargate 是一个无服务器容器计算引擎,它为您管理和扩展容器,与 Amazon Elastic Container Service (Amazon ECS) 兼容。 - 数字助理使用自定义 LangChain 代理来回答有关银行产品和服务的疑问,并编排入职流程。 - 如果用户询问有关银行产品或服务的常规问题,代理将使用名为 ProductSearch 的自定义 LangChain 工具。此工具使用链接到包含银行数据的 Amazon Simple Storage Service (Amason S3) 数据源的 Amazon Kendra。Amazon Kendra 是一种由机器学习驱动的智能企业搜索服务,使公司能够索引和搜索其文档存储中的内容。 - 如果用户表示他们想要开立新账户,代理将提示用户输入他们的电子邮件。用户回复后,应用程序将调用名为 EmailValidation 的自定义 LangChain 工具。此工具通过调用部署在 Amazon API Gateway 中的端点来检查银行的 Amazon DynamoDB 数据库中是否存在现有账户。 - 电子邮件验证后,将收集 KYC 信息,例如姓名和姓氏。然后,系统会提示用户提供身份证明文件,该文件将上传到 Amazon S3。 - 代理将调用名为 IDVerification 的自定义 LangChain 工具。此工具通过调用部署在 Amazon API Gateway 中的端点来检查会话期间输入的用户详细信息是否与 ID 相符。通过使用 Amazon Textract(一种自动从扫描文档中提取文本、手写体、版式元素和数据的机器学习 (ML) 服务)提取文档文本来验证详细信息。 - 身份验证后,系统会要求用户提供自拍照。图像将上传到 Amazon S3。然后,代理将调用名为 SelfieVerification 的自定义 LangChain 工具。此工具通过调用部署在 API Gateway 中的端点来检查上传的自拍照是否与 ID 上的面部相符。使用 Amazon Rekognition 检测面部匹配,Amazon Rekognition 提供预先训练的和可自定义的计算机视觉 (CV) 功能,以从您的图像和视频中提取信息和见解。 - 面部验证成功后,代理将使用名为 SaveData 的自定义 LangChain 工具。此工具通过调用部署在 API Gateway 中的端点在银行的 DynamoDB 数据库中创建一个新账户。 - 用户将收到通知,告知他们的新账户已成功创建,使用 Amazon Simple Email Service (Amazon SES)。

In this post, we present a solution that harnesses the power of generative AI to streamline the user onboarding process for financial services through a digital assistant. Onboarding new customers in the banking industry is a crucial step in the customer journey, involving a series of activities designed to fulfill know your customer (KYC) requirements, conduct necessary verifications, and introduce them to the bank’s products or services. Traditionally, customer onboarding has been a tedious and heavily manual process. Our solution provides practical guidance on addressing this challenge by using a generative AI assistant on AWS.

Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies like AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon through a single API, along with a broad set of capabilities you need to build generative AI applications with security, privacy, and responsible AI. Using Anthropic’s Claude 3.5 Sonnet on Amazon Bedrock, we build a digital assistant that automates document processing, identity verifications, and engages customers through conversational interactions. As a result, customers can be onboarded in a matter of minutes through secure, automated workflows. In this post we provide you a solution and the accompanying code that banks can use to dramatically enhance the customer experience and establish a strong customer relationship from the outset.

Challenges with traditional onboarding

The traditional onboarding process for banks faces challenges in the current digital landscape because many institutions don’t have fully automated account-opening systems. While customers in other sectors have access to intelligent assistants, those in banking often encounter legacy processes. As the financial services industry adapts to changing consumer expectations, there’s a need to address the demand for instant and 24/7 availability of services.

The challenges associated with the manual onboarding process include but aren’t limited to, the following:

AI-powered services enable automated, secure, and compliant processes for self-service account opening. Providing onboarding experiences aligned with current digital standards might offer a competitive edge for banks in the future.

Solution overview

The solution allows users to open bank accounts remotely through a conversational interface, eliminating the need to visit a physical branch. We created a digital assistant named Penny to guide users through the process, including uploading KYC documents and facilitating identity verification using document scanning and facial recognition. The approach uses Retrieval Augmented Generation (RAG), which combines text generation capabilities with database querying to provide contextually relevant responses to customer inquiries. Implementing digital onboarding reduces the accessibility barriers present in traditional manual account opening processes. The code for this solution is available in a GitHub repository.

The brain of our application is a custom LangChain Agent. When a user wants to open a new bank account, the agent will help them complete the onboarding process using preconfigured stages corresponding to each onboarding step. Each stage might use a LangChain tool, allowing for the automation and orchestration of onboarding. These tools call on AWS service APIs for the required functionality.

The following figure represents the high-level architecture of the proposed solution.

The flow of the application is as follows:

    Users access the frontend website hosted within AWS Amplify. AWS Amplify is an end-to-end solution that enables frontend web developers to build and deploy secure, scalable full stack applications. The website invokes an Amazon CloudFront endpoint to interact with the digital assistant, Penny, which is containerized and deployed in AWS Fargate. Fargate is a serverless compute engine for containers that manages and scales your containers for you, compatible with Amazon Elastic Container Service (Amazon ECS). The digital assistant uses a custom LangChain agent to answer questions on the bank’s products and services and orchestrate the onboarding flow. If the user asks a general question related to the bank’s products or service, the agent will use a custom LangChain tool called ProductSearch. This tool uses Amazon Kendra linked with an Amazon Simple Storage Service (Amason S3) data source that contains the bank’s data. Amazon Kendra is an intelligent enterprise search service powered by machine learning that enables companies to index and search content across their document stores. If the user indicates that they want to open a new account, the agent will prompt the user for their email. After the user responds, the application will invoke a custom LangChain tool called EmailValidation. This tools checks if there is an existing account in the bank’s Amazon DynamoDB database, by calling an endpoint deployed in Amazon API Gateway. After the email validation, KYC information is gathered, such as first and last name. Then, the user is prompted for an identity document, which is uploaded to Amazon S3. The agent will invoke a custom LangChain tool called IDVerification. This tool checks if the user details entered during the session match the ID by calling an endpoint deployed in Amazon API Gateway. The details are verified by extracting the document text using Amazon Textract, a machine learning (ML) service that automatically extracts text, handwriting, layout elements, and data from scanned documents. After the ID verification, the user is asked for a selfie. The image is uploaded to Amazon S3. Then, the agent will invoke a custom LangChain tool called SelfieVerification. This tool checks if the uploaded selfie matches the face on the ID by calling an endpoint deployed in API Gateway. The face match is detected using Amazon Rekognition, which offers pre-trained and customizable computer vision (CV) capabilities to extract information and insights from your images and videos. After the face verification is successful, the agent will use a custom LangChain tool called SaveData. This tool creates a new account in the bank’s DynamoDB database by calling an endpoint deployed in API Gateway. The user is notified that their new account has been created successfully, using Amazon Simple Email Service (Amazon SES).

Prompt design for agent orchestration

Now, let’s take a look at how we give our digital assistant, Penny, the capability to handle onboarding for financial services. The key is the prompt engineering for the custom LangChain agent. This has been specified in PennyAgent.py. This prompt includes onboarding stages and relevant LangChain tools that the agent might need to complete the onboarding steps.

To begin, we provide the agent with a name, role and company.

AGENT_TOOLS_PROMPT = """Never forget your name is {assistant_name}. You work as a {assistant_role}.You work at company named {bank_name}

Next, we define the various stages of onboarding and specify the respective tools and expected responses. Having stages in a sequential and structured format while also providing awareness of all possible stages helps the agent determine the onboarding stage with accuracy.

<STAGES>These are the stages:Introduction or greeting:  When conversation history is empty, choose stage 1Response: Start the conversation with a greeting. Say that you can help with {bank_name} related questions or open a bank account for them. Do this only during the start of the conversation.Tool:     General Banking Questions: Customer asks general questions about AnyBankResponse: Use ProductSearch tool to get the relevant information and answer the question like a banking assistant. Never assume anything.Tool: ProductSearch    Account Open 1: Customer has requested to open an account.Response: Customer has requested to open an account. Now, respond with a question asking for the customer's email address only to get them started with onboarding. We need the email address to start the process.Tool:    Account Open 2: User provided their email.Response: Take the email and validate it using a EmailValidation tool. If it is valid and there is no existing account with the email, ask for account type: either CHEQUING or SAVINGS. If it is invalid or there is an existing account with the email, the user must try again. Tool: EmailValidation    Account Open 3: User provided which account type to open.Response: Ask the user for their first nameTool: Account Open 4: User provided first name.Response: Ask the user for their last nameTool: Account Open 5: User provided last name.Response: Ask the user to upload an identity document.Tool:    Account Open 6: Penny asked for identity document and then System notified that a new file has been uploadedResponse: Take the identity file name and verify it using the IDVerification tool. If the verification is unsuccessful, ask the user to try again. Tool: IDVerification    Account Open 7: The ID document is valid. Response: Ask the user to upload their selfie to compare their face to the ID.Tool:    Account Open 8: Penny asked user for their selfie and then "System notified that a file has been uploaded. "Response: Take the "selfie" file name and verify it using the SelfieVerification tool. If there is no face match, ask the user to try again.Tool: SelfieVerification: Use this tool to verify the user selfie and compare faces.     Account Open 9: Face match verifiedResponse: Give the summary of the all the information you collected and ask user to confirm. Tool:        Account Open 10: ConfirmationResponse: Save the user data for future reference using SaveData tool. Upon saving the data, let the user know that they will receive an email confirmation of the bank account opening.Tool: SaveData

We append the tools, their descriptions, and their response formats to the prompt. When calling on a specific tool, the agent can generate input parameters as required. Access to all the tools helps the agent identify the best tool choice based on the conversation stage.

TOOLS:------Penny has access to the following tools:{tools}

We include some guidelines that the agent needs to follow while generating outputs. By using emotion-based prompt engineering, we minimize hallucinations and deviation from expected outputs. These guidelines were chosen after extensive testing to minimize edge cases and help prevent common agent mistakes.

<GUIDELINES>1. If you ever assume any user response without asking, it may cause significant consequences.2. It is of high priority that you respond and use appropriate tools in their respective stages. If not, it may cause significant consequences.3. It is of high priority that you never reveal the tools or tool names to the user. Only communicate the outcome.4. It is critical that you never reveal any details provided by the System including file names. 5. If ever the user deviates by asking general question during your account opening process, Retrieve the necessary information using 'ProductSearch' tool and answer the question. With confidence, ask user if they want to resume the account opening process and continue from where we left off. 

The agent uses the ReAct framework to make decisions about how to respond based on user input. ReAct provides the agent with a thinking structure, through which it selects the most appropriate tool for a given task. Such frameworks make LLM agents versatile and adaptable to different use cases.

Based on the stage descriptions and the tools available, if the LLM generates a response that requires access to an external tool, then the response of the LLM will include Thought, Decision, Action, Action Input and Observation. The agent comes with a string matcher, which will detect Action and Action Input from the LLM’s response and trigger the respective tool. Based on the response from the tool, the LLM with decide whether to proceed with the Final Answer, and then the output will be returned by the agent.

FORMAT:------To use a tool, please always use the following format:```Thought: {input}Decision: Do I need to use a tool? yAction: what tool to use, should be one of [{tool_names}]Action Input: the input to the actionObservation: the result of the action```When I am finished, I will have a response like this: Final Answer: [your response as a banking assistant]

Finally, we give the agent access to the conversation history to better decide what stage the conversation is currently in. In addition, we also give access to an agent scratchpad where it can store its thought processes to execute certain actions.

Be confident that you are a banking assistant and only respond with final answer.Begin!<Conversation history>{conversation_history}{agent_scratchpad}

Orchestrating intelligent digital assistants requires thoughtful prompt engineering to handle complex tasks. By structuring the conversation into stages, providing tooling, and setting guidelines, we enable the assistant to systematically complete the onboarding process. This approach allows assistants to scale across use cases while maintaining accuracy. With the right guardrails, assistants can deliver smooth, trustworthy customer experiences.

Prompt design is key to unlocking the versatility of LLMs for real-world automation. Amazon Bedrock Prompt Management can be used to streamline the creation, evaluation, versioning and testing of prompts. This will help developers and prompt engineers save time by applying the same prompt to different onboarding processes. When you create a prompt, you can select a different model for inference and adjust the variables to obtain the best-suited results for a variety of workflows.

The following sections explain how to deploy the solution in your AWS account.

Note: Running this workload would have an estimated hourly cost of $1.34 for the Oregon (us-west-2) AWS Region. Check the pricing details for each service to understand the costs you might be charged for different usage tiers and resource configurations.

Setup

To deploy the agent, visit the project Github Repository, and use the following instructions:

    Ensure the pre-requisites are completed as mentioned in the README. Deploy the solution including the agent, tools infrastructure, and demo application—in that order—based on the instructions in the README. After the deployment is successful, visit the outputted domain where the demo application is running. You can now begin testing the agent.

Testing the agent

Begin your exploration by accessing the Amplify endpoint where the demonstration is hosted. The demonstration incorporates an interactive chat interface, enabling you to engage in a conversational exchange with the digital assistant, Penny. Whenever you want to initiate a new instance of the agent, refresh the web page.

Let’s start talking to Penny:

    Enter Hi

Penny will respond with a friendly greeting

    Enter What are the cutoff times to receive wire transfers on the same day?

Penny will use the ProductSearch tool to find the relevant information from the loaded product catalog. You can try asking other questions about the bank’s product or services including the AnyBank Travel Rewards Visa Infinite Card or New Vehicle Loans.

    Enter I would like to open a new bank account

Penny will recognize that the account opening flow needs to be initiated and will proceed with the first step, which is asking you for an email address.

    Enter the verified customer email you registered with the Amazon SES identity. For our demonstration, we will use anup@test.com(parameter SesCustomerEmail used in the example command to setup infrastructure)

Penny will take the email address and run the EmailValidation Tool. If there is an existing account with this email, it will ask you to retry. Otherwise, it will move on to the next step which is gathering your account type.

    Enter I want a savings account or indicate that you want a checking account.

Penny will record your account type and move on to the KYC questions.

    Enter Anup

Penny will record your first name and continue gathering the remaining KYC information.

    Enter Ravi

It will record your last name and prompt you for an ID next. We used Ravi to match the ID document provided below.

    Download the picture ID. It’s also located at ./api/lambdas/test/passport.png

Upload it to the chat by selecting Choose File.

After uploading the image, you will receive a confirmation message on the chat stating We have received your document. Penny will use ID Verification to compare the name entered during the session to the document. After verification is complete, Penny will prompt you to upload a selfie.

    Upload the selfie located at ./api/lambdas/test/selfie.png to the chat by selecting Choose File.

After the upload is complete, you will receive a confirmation message on the chat stating We have received your document. Penny will use Selfie Verification to compare the face on the ID to the selfie for a face match. After verification is complete, Penny will prompt you to confirm that you want to proceed.

    Enter Yes I confirm

Penny will use Create Account to complete the onboarding process and send an email confirmation. It will inform to you of this update in the chat.

Check the customer email you used. The email address specified as the SesCustomerEmail parameter (in this example: anup@test.com) during setup will receive a new email from the email address you set as the SesBankEmail parameter (in this example: owner@anybank.com).

    Go to the DynamoDB console, select Table from the navigation pane and select the table created by the AWS CloudFormation This is the accounts table in the bank’s AWS account. From the Table page, choose Explore items. You will see a new account created with the details that you entered.

Guardrails and security

Security is a critical part of any application and must be rigorously addressed when developing and deploying solutions, especially those that involve handling sensitive data or interacting with users. For a solution similar to the example in this post, several robust security measures should be implemented to maintain the confidentiality, integrity, and availability of the system.

By implementing these robust security measures and fostering a culture of continuous security awareness and improvement, the solution can better protect against potential threats, safeguard user privacy, and maintain the integrity and reliability of the service.

Cleanup

Follow the cleanup Instructions in the README of the Github repository to remove the environment from your account.

Conclusion

In this post, we presented an end-to-end solution that demonstrates how banks can transform user onboarding with an AI-powered digital assistant. By orchestrating workflows across AWS services, we enabled automated, secure account opening within minutes. The conversational interface delivers exceptional customer experiences while reducing operational costs.

This solution can be quickly deployed and enhanced using the features of Amazon Bedrock. Amazon Bedrock Agents streamlines workflows by executing multistep tasks and integrating with company systems and data sources. Amazon Bedrock Knowledge Bases provides contextual information from proprietary data sources, enhancing the accuracy and relevance of responses. Additionally, Amazon Bedrock Guardrails implements safeguards to enable responsible AI usage, filtering harmful content and protecting sensitive information. These can enable a robust and secure deployment of an AI-powered onboarding solution.

Key outcomes of this solution include:

Instant, secure, and scalable delivery has become the norm that customers demand. This AI assistant solution, powered by AWS, showcases the potential future of user onboarding for financial institutions. As consumer behaviors and expectations continue to be influenced by the latest digital experiences across industries, banks that invest in advanced technologies will gain a competitive edge over their rivals.

Ready to future proof your banking experience? Visit Artificial Intelligence and Machine learning for Financial services with AWS.


About the authors

Anup Ravindranath is a Senior Solutions Architect at Amazon Web Services (AWS) based in Toronto, Canada working with Financial Services organizations. He helps customers to transform their businesses and innovate on cloud.

Arya Subramanyam is a Solutions Architect based in Toronto, Canada. She works with Enterprise Greenfield customers as well as Small & Medium businesses as a technical advisor, helping them solve business challenges with cloud solutions. Arya holds a Bachelor of Applied Science in Computer Engineering from the University of British Columbia, Vancouver. Her passion for Generative AI has led her to develop various solutions leveraging Large Language Models (LLMs) with a focus on prompt engineering and AI agents.

Venkata Satyanarayana Chivatam is a Solutions Architect at AWS. He specializes in Generative AI and Computer Vision, with a particular focus on driving adoption across industries such as healthcare and finance. At AWS, he helps ISV and SMB customers leverage cutting-edge AI technologies to unlock new possibilities and solve complex challenges. He is passionate about supporting businesses of all sizes in their AI journey.

Akshata Ramesh Rao is a Solutions Architect in Toronto, Canada. Akshata works with enterprise customers to accelerate innovation and advise them through technical challenges. She also loves working with SMB customers and help them reach their business objectives quickly, safely, and cost-effectively with AWS services, frameworks, and best practices. Prior to joining AWS, Akshata worked as Devops Engineer at Amazon and holds a master’s degree in computer science from University of Ottawa.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

生成式 AI 金融服务 用户入职 数字助理 Amazon Bedrock LangChain
相关文章