AWS for Industries
How Remita Uses Generative AI to Enhance Payment Experience and Integration
In an era where AI transformation rapidly reshapes industries, financial technology (fintech) companies like Remita constantly seek innovative solutions to enhance their service offerings. One such innovation is the integration of Generative AI, which has the potential to revolutionize various aspects of fintech operations, most importantly enhancing user experience. Remita, a leading Nigerian fintech company, has successfully harnessed the power of generative AI by leveraging the Amazon Bedrock API to build an Agentic Retrieval Augmented Generation (RAG) solution from the ground up to power its AI transformation initiatives. In this blog, we will discuss how Remita used generative AI to enhance user experiences across four customer touchpoints, built on AWS using Amazon Bedrock.
Why Amazon Bedrock?
Amazon Bedrock is a fully managed API service provided by Amazon Web Services (AWS) that simplifies the development and deployment of generative AI applications. Bedrock offers a range of foundational models (FMs) from Amazon and other leading third-party model providers. It allows developers to consume or fine-tune these models with their own data, deploy them and seamlessly integrate with existing systems. The flexibility, scalability, and ease of use provided by Bedrock make it an ideal choice for organizations looking to integrate AI-driven capabilities into their operations.
Remita’s AI-Driven Transformation – Enhancing User Experience
Remita has been at the forefront of innovation in the fintech sector, offering a wide range of services, including bills, peer-to-peer payment processing, and electronic invoicing. To further enhance its offerings and stay ahead of the competition, Remita has adopted generative AI to improve user experience across payment channels for its customers. These included:
- Enabling customers to get answers to questions about Remita product offerings using natural language.
- Automating and reducing time to access merchant payment links for goods and services using natural language.
- Providing code snippets to reduce the time for developers to integrate with Remita APIs.
- Automating receipt validations for merchants to reduce fraudulent claims of payments.
Using Amazon Bedrock, Remita built generative AI-powered assistants to provide these experiences for customers. They built the assistants using Remita proprietary data and customer interaction data to provide instant, accurate, and context-aware responses. With these new assistants, Remita saw a 22% reduction in integration support cases raised by integration partners; 19% reduction on product related queries raised by customer support agents and reduced the time to verify receipts from an average of 4 mins to 30 second. In the next sections, we will go through each of the assistants and the Remita generative AI assistant platform used to deliver these innovative customer experiences.
Payment Assistant:
Our AI-powered Payment Assistant helps customers discover payments on the Remita platform. With over 10,000 available payment types, some users may struggle to find the exact service they need. By interacting with the AI assistant, customers can now identify and start payments through simple conversations. For example, if a customer says, “I want to buy MTN airtime,” the AI assistant will provide a clickable payment link that takes them directly to the airtime purchase page. This feature is useful for first-time users, reducing the time spent searching for the correct payment option. By extracting the payments and their relevant IDs, we use RAG combined with prompts and regular expressions to generate dynamically payment links for users.
Figure 1: Remita Payment Assistant UI interface
Product Knowledge Assistant:
The Product Knowledge Assistant responds to customer inquiries about Remita’s products and services. Users ask questions regarding our offerings, how-to guides, FAQs, or services and receive immediate responses. We observed startup founders consulting the assistant to discuss their business ideas, and, in return, the assistant suggests relevant Remita products or services that speed up their business and guide them on how to onboard. This assistant leverages our RAG system with prompt fine-tuning to provide accurate, tailored responses.
Developer API Assistant:
Remita’s Developer API Assistant serves as a helpful guide for customers integrating with Remita’s APIs. It provides detailed information about our API specifications and generates code snippets to streamline the integration process, reducing time to market for developers to integrate with Remita API. Remita indexed the AI assistant’s data using Postman collections and sample curl requests/responses within our RAG solution. The assistant uses this data to generate REST API code snippets in a variety of programming languages, enhanced by prompt engineering techniques for code formatting and validation.
Figure 2: Remita Developer API Assistant UI interface
Confirm Receipt Validity Assistant:
The Confirm Receipt Validity Assistant uses Anthropic’s Claude Haiku 3 with vision capabilities to verify the authenticity of a Remita receipt. Merchants take a photo of a Remita receipt provided by a customer, and the AI assistant will extract the payment reference. Using function calling, it retrieves the receipt details, validates them, and presents the verified information to the merchant before the customer receives the value.
AI Agents:
By leveraging function calling and advanced tooling, Remita integrated AI agents across the assistants to automate tasks such as verifying or resending payment receipts, displaying bank account balances, and downloading recent transaction reports. These agents enhance the customer experience by streamlining processes and providing a seamless, end-to-end service.
Remita Generative AI Assistant Platform
The Remita Generative AI Assistant Platform has enabled Remita to build AI assistants to enhance user experiences and improve operational efficiency. The diagram below shows a high-level overview of the architecture. It comprises an indexing pipeline used to vectorize Remita datasets; an inferencing pipeline used to augment user queries with retrieved documents and generate responses; and agents which integrate with a set of tools and APIs to perform actions based on user queries. The Payment Assistant, Product Knowledge Assistant, Developer API Assistant and Confirm Receipt Assistant are built on top of the platform, with each assistant customized with a defined workflow to retrieve data from the vector stores and generate a response tailored to the user queries. The following section will delve into each key component of the architecture.
Figure 3: Remita Generative AI Assistant Platform
1. Data Preparation
To deliver the customer experience, RAG is used to generate responses using the Remita internal dataset. These datasets were transformed and stored as text files in Amazon S3 buckets. For example, with the payment assistant, the payment links available from each payment provider were retrieved from the database and stored a text file. For the developer API assistant, using tools such as Postman, the API documentation was exported to 3 JSON files. For the product knowledge assistant, the Remita product documentation and customer guides were converted to a text document.
2. Indexing Pipeline
The indexing pipeline ingests data from Amazon Simple Storage Service (Amazon S3) and creates a vector embedding of the data. The following are the steps involved in the indexing pipeline:
- A scheduled cron job runs at a defined interval to ingest transformed data from the Amazon S3 bucket. This makes sure that new data is ingested and processed by the pipeline.
- The data is split into chunks using a fixed-size chunking strategy with overlapping while also verifying that complete sentences are preserved within each chunk.
- The Amazon Titan v2 embedding model from Amazon Bedrock is used to generate embedding of each chunk and the embedding is stored in a Pinecone database.
Figure 4: Indexing Pipeline
3. Inferencing Pipeline
The inferencing pipeline takes a user query and generates a response using a combination of RAG and prompt engineering to provide an accurate response to the query is generated. The inferencing pipelines are composed of these stages:
- When a user submits a query, the inferencing service will generate the user query embedding using the Amazon Titan v2 embedding model.
- The user query vector embedding is used to perform a semantic search on the vector database (Pinecone) to retrieve relevant chunks with “top K” (most similar vectors to a query vector in a vector database) set to 3.
- Prompt engineering is used to augment the user query with the search results, including guardrails to make sure that the assistants are not used to answer questions outside of the services provided by Remita. A sample prompt for implementing this guardrail includes:
“If the user’s question is outside of the scope of the content:
- Do not attempt to answer questions outside of the given context
- Respond with: “This is outside the scope of my training data, go to https://www.remita.next – for more information on Remita”
- The response is formatted before displaying to the user. For example, with the developer assistant, the code is formatted with indentation before displaying to the user and for the payment assistant, the payment link URL is embedded as a hyperlink in the response generated.
Figure 1.2: Inferencing pipeline
4. Agent Runtime
Merchants that integrate with Remita have use cases where they need to confirm a receipt issued by Remita and presented by a customer as evidence for payment. Before the assistant, merchants had to verify receipts manually by retrieving the Remita reference and making an API call or submitting a ticket to Remita. With the confirm receipt assistant, merchants upload a receipt via the assistant and ask questions to validate the receipt. Here is how it works:
- Anthropic’s Claude 3 Haiku vision capabilities extract Remita payment references from the receipt.
- This triggers an agent runtime that uses Anthropic’s Claude 3 Haiku on Amazon Bedrock for function calling to generate the Remita API payload to validate the receipt.
- The Remita API is invoked to validate the receipt.
- The response is passed to Anthropic’s Claude 3 Haiku for formatting before displaying to the user.
Figure 1.3: Remita confirm receipt pipeline
A similar workflow is used to implement other agents for displaying bank account balances, downloading recent transaction reports, and using the logged in user ID to tailor the responses based on the current user.
Below is a table that shows the model names from Amazon Bedrock used for each assistant.
Architectural Challenges and Solutions
Generative AI stacks come with their own set of challenges. Issues such as hallucinations, output bias, and prompt injections are still prevalent in LLMs. To mitigate these concerns, we employed prompt engineering techniques and data fine-tuning. We built a feedback mechanism into our AI assistants where users provide feedback via thumbs up/down. This data is reviewed regularly to help improve our prompts and address hallucinations. We also used a few shots prompting to tackle cases of prompt injection and jailbreaks, making sure that the assistants were used only within Remita’s context.
Conclusion
In conclusion, Remita’s use of Amazon Bedrock to build its generative AI solution is a testament to the power of AI in reshaping the fintech landscape. By embracing AI-driven innovation, Remita is not only improving its service offerings, but also setting a new standard for excellence in the industry. Looking ahead, Remita will modernize the architecture by moving to serverless services and leveraging new functionalities in Amazon Bedrock, such as Amazon Bedrock Guardrails and Amazon Bedrock Prompt Flows.