AWS Machine Learning Blog 2024年07月19日
Secure AccountantAI Chatbot: Lili’s journey with Amazon Bedrock
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Lili 是一款专为企业设计的金融平台,它将先进的商业银行业务与内置的会计和税务准备软件相结合。通过将金融工具整合到一个用户友好的界面中,Lili 简化了管理企业财务的过程,使其成为寻求集中式和高效方式管理财务运营的企业主的理想解决方案。本文将探讨 Lili 如何利用 Amazon Bedrock 为小企业主构建一个安全且智能的 AccountantAI 聊天机器人。

🤔 **问题验证:** AccountantAI 采用了一个两阶段架构,包括一个摄取工作流和一个检索工作流。摄取工作流是一个离线过程,用于准备系统以服务客户查询。Lili 策划了一个全面的财务会计问题黄金集,从常见问题以及多年来客户群的真实问题中汲取灵感。这个多样化且高质量的集合充当参考语料库,确保聊天机器人能够处理各种相关查询。摄取工作流使用 Amazon Titan 文本嵌入模型 API 将这些策划的问题转换为向量嵌入。此过程在 AWS 私有链接中完成,AWS 私有链接是 VPC 中的受保护和私有连接。向量嵌入存储在应用程序的内存中。这些向量将有助于在检索工作流期间验证用户输入。

💡 **上下文丰富:** 每个策划的向量嵌入都与一个匹配的提示模板配对,该模板在测试期间被评估为最有效。此模板包含有关代理的角色、Lili 平台的详细信息、Lili 产品功能的详细列表、预期响应格式、与回答客户问题相关的数据以及特定于问题的会计知识。

🚀 **检索工作流:** Lili 的网络聊天机器人网络界面允许用户提交查询并接收实时响应。当客户提出问题时,系统会将其发送到后端系统进行处理。系统首先使用 Amazon Titan 文本嵌入模型 API 将查询转换为向量嵌入,该 API 通过私有链接安全访问。接下来,系统在黄金集的预先计算的嵌入中执行相似性搜索,以找到与用户查询最相关的匹配项。系统根据预定的阈值评估搜索结果的相似性分数。如果用户的问题产生相似性分数低的匹配项,则认为该问题格式错误或不清楚,并提示用户重新措辞或完善他们的查询。但是,如果用户的问题产生相似性分数高的匹配项,则认为它是一个合法查询。在这种情况下,Lili 的后端系统将使用与用户查询最相似的黄金问题进行进一步处理。基于相似性分数最高的黄金问题,系统将检索相应的提示模板。

💰 **成本效益:** Anthropic Claude 3 Haiku 模型在三个关键评估指标方面表现出显着改进:质量、响应时间和成本。Anthropic Claude 3 Haiku 在 Amazon Bedrock 上提供更高质量的输出,提供比其前身更详细和措辞更佳的响应。与 Claude Instant 相比,Anthropic Claude 3 Haiku 的响应时间提高了 10% 到 20%,提供了更快的性能。Anthropic Claude 3 Haiku 在 Amazon Bedrock 上是最具成本效益的选择。例如,与 Anthropic Claude Instant 相比,每 1,000 个输入/输出令牌的成本最多降低 68%,同时提供更高水平的智能和性能。

🤝 **结论:** AccountantAI 功能专为 Lili 客户提供,减少了雇用专业会计师的需要。虽然专业会计师可以提供宝贵的指导和专业知识,但他们的服务对于许多小企业来说可能过于昂贵。AccountantAI 已经回答了数千个问题,为企业带来了真正的价值,并为财务、税务和会计查询提供了优质的响应。通过使用 Amazon Bedrock,Lili 能够快速有效地构建一个安全且智能的 AccountantAI 聊天机器人,从而为其小企业客户提供无缝且经济高效的财务咨询。

This post was written in collaboration with Liran Zelkha and Eyal Solnik from Lili.

Small business proprietors tend to prioritize the operational aspects of their enterprises over administrative tasks, such as maintaining financial records and accounting. While hiring a professional accountant can provide valuable guidance and expertise, it can be cost-prohibitive for many small businesses. Moreover, the availability of accountants might not always align with the immediate needs of business owners, leaving them with unanswered questions or delayed decision-making processes.

In the rapidly evolving world of large language models (LLMs) and generative artificial intelligence (AI), Lili recognized an opportunity to use this technology to address the financial advisory needs of their small business customers. Using Anthropic’s Claude 3 Haiku on Amazon Bedrock, Lili developed an intelligent AccountantAI chatbot capable of providing on-demand accounting advice tailored to each customer’s financial history and unique business requirements. The AccountantAI chatbot serves as a virtual assistant, offering affordable and readily available financial guidance, empowering small business owners to focus on their core expertise while ensuring the financial health of their operations.

About Lili

Lili is a financial platform designed specifically for businesses, offering a combination of advanced business banking with built-in accounting and tax preparation software.

By consolidating financial tools into a user-friendly interface, Lili streamlines and simplifies managing business finances and makes it an attractive solution for business owners seeking a centralized and efficient way to manage their financial operations.

In this post, we’ll explore how Lili, a financial platform designed specifically for businesses, used Amazon Bedrock to build a secure and intelligent AccountantAI chatbot for small business owners. Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies like Anthropic, Meta, Mistral AI, Stability AI, Cohere, AI21 Labs, and Amazon through a single API, along with a broad set of capabilities that you need to build generative AI applications with security, privacy, and responsible AI.

Solution overview

The AccountantAI chatbot provides small business owners with accurate and relevant financial accounting advice in a secure manner. To achieve this, the solution is designed to address two key requirements:

To address the two key requirements of question validation and context enrichment, the AccountantAI solution employs a two-stage architecture comprising an ingestion workflow and a retrieval workflow.

Ingestion workflow

The ingestion workflow is an offline process that prepares the system for serving customer queries. For this stage, Lili curated a comprehensive golden collection of financial accounting questions, drawing from common inquiries as well as real-world questions from their customer base over the years. This diverse and high-quality collection serves as a reference corpus, ensuring that the chatbot can handle a wide range of relevant queries. The ingestion workflow transforms these curated questions into vector embeddings using Amazon Titan Text Embeddings model API. This process occurs over AWS PrivateLink for Amazon Bedrock, a protected and private connection in your VPC. The vector embeddings are persisted in the application in-memory vector store. These vectors will help to validate user input during the retrieval workflow.

Each curated vector embedding is paired with a matching prompt template that was evaluated during testing to be the most effective.

Example prompt template

<role>Provides context about the agent's role as Lili's AI assistant for financial questions and outlines the general guidelines applied to all queries.</role><about>Provides details on Lili platform.</about><features>Lists out all of Lili's product features in detail. This section aims to explain Lili's features in detail, ensuring that answers are aligned with the Lili platform. For instance, when addressing questions about tax reduction management, highlight the relevant features that Lili offers, which customers should be familiar with.</features><output_format>Outlines the required formatting for the response to ensure it meets the expected structure.</output_format><user_data>Data relevant to answering the customer's question.</user_date><knowledge>Specific accounting knowledge that is relevant to the question and the model is not familiar with, such as updated data for 2024.<knowledge><question>Contains the user's actual question.</question><instructions>Provides the core instructions on how to approach answering the question appropriately and meet expectations. It also defines the steps in providing a detailed and high-quality answer.</instructions><reminders>Important guidelines to remind the agent and make sure it follows them, such as the exact format of the answer.</reminders>

Retrieval workflow

Lili’s web chatbot web interface allows users to submit queries and receive real-time responses. When a customer asks a question, it’s sent to the backend system for processing.

    The system first converts the query into a vector embedding using the Amazon Titan Text Embeddings model API, which is accessed securely through PrivateLink. Next, the system performs a similarity search on the pre-computed embeddings of the golden collection, to find the most relevant matches for the user’s query. The system evaluates the similarity scores of the search results against a predetermined threshold. If the user’s question yields matches with low similarity scores, it’s deemed malformed or unclear, and the user is prompted to rephrase or refine their query. However, if the user’s question produces matches with high similarity scores, it’s considered a legitimate query. In this case, Lili’s backend system proceeds with further processing using the golden question that has the highest similarity score to the user’s query. Based on the golden question with the highest similarity score, the system retrieves the corresponding prompt template.

This template is augmented with up-to-date accounting information and the customer’s specific financial data from external sources such as Amazon RDS for MySQL. The resulting contextualized prompt is sent to Anthropic’s Claude 3 Haiku on Amazon Bedrock, which generates a tailored response addressing the customer’s query within their unique business context.

Because model providers continually enhance their offerings with innovative updates, Amazon Bedrock simplifies the ability to adopt emerging advancements in generative AI across multiple model providers. This approach has demonstrated its advantages right from the initial rollout of AccountantAI. Lili transitioned from Anthropic’s Claude Instant to Claude 3 within two weeks of its official release on the Amazon Bedrock environment and three weeks after its general availability.

Lili selected Anthropic’s Claude model family for AccountantAI after reviewing industry benchmarks and conducting their own quality assessment. Anthropic Claude on Amazon Bedrock consistently outperformed other models in understanding financial concepts, generating coherent natural language, and providing accurate, tailored recommendations.

After the initial release of AcountantAI, Amazon Bedrock introduced Anthropic’s Claude 3 Haiku model, which Lili evaluated against Anthropic Claude Instant version. The Anthropic Claude 3 Haiku model demonstrated significant improvements across three key evaluation metrics:

For customers like Lili, this underscores the importance of having access to a fully managed service like Amazon Bedrock, which offers a choice of high-performing foundation models to meet diverse enterprise AI needs. There is no “one size fits all” model, and the ability to select from a range of cutting-edge FMs is crucial for organizations seeking to use the latest advancements in generative AI effectively and cost-efficiently.

Conclusion

The AccountantAI feature, exclusively available to Lili customers, reduces the need for hiring a professional accountant. While professional accountants can provide valuable guidance and expertise, their services can be cost-prohibitive for many small businesses. AccountantAI has already answered thousands of questions, delivering real value to businesses and providing quality responses to financial, tax, and accounting inquiries.

Using Amazon Bedrock for easy, secure, and reliable access to high-performing foundation models from leading AI companies, Lili integrates accounting knowledge at scale with each customer’s unique data. This innovative solution offers affordable expertise on optimizing cash flow, streamlining tax planning, and enabling informed decisions to drive growth. AccountantAI bridges the gap in accounting resources, democratizing access to high-quality financial intelligence for every business.

Explore Lili’s AccountantAI feature powered by Amazon Bedrock to gain affordable and accessible financial intelligence for your business today, or use Amazon Bedrock Playgrounds to experiment with running inference on different models on your data.


About the authors

Doron Bleiberg is a senior AWS Startups Solution Architect helping Fintech customers in their cloud journey.

Liran Zelkha is the co-founder and CTO at Lili, leading our development and data efforts.

Eyal Solnik is the head of Data at Lili and leads our AccountantAI product.

Fish AI Reader

Fish AI Reader

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

FishAI

FishAI

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

联系邮箱 441953276@qq.com

相关标签

Amazon Bedrock AccountantAI 聊天机器人 金融平台 小企业
相关文章