├── __init__.py ├── static ├── favicon.ico ├── screenshot.png ├── index.html └── app.js ├── .multinear ├── multinear.db ├── task_runner.py └── config.yaml ├── requirements.txt ├── .gitignore ├── .env.example ├── main.py ├── pyproject.toml ├── session.py ├── LICENSE ├── tracing.py ├── api.py ├── engine.py ├── README.md ├── notebook.ipynb └── data └── acme_bank_faq.txt /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multinear-demo/demo-bank-support-lc-py/HEAD/static/favicon.ico -------------------------------------------------------------------------------- /static/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multinear-demo/demo-bank-support-lc-py/HEAD/static/screenshot.png -------------------------------------------------------------------------------- /.multinear/multinear.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/multinear-demo/demo-bank-support-lc-py/HEAD/.multinear/multinear.db -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi>=0.115.4 2 | python-dotenv>=1.0.1 3 | uvicorn>=0.32.0 4 | multinear>=0.1.1 5 | langchain-openai>=0.2.10 6 | langchain-community>=0.3.4 7 | langchain>=0.3.8 8 | faiss-cpu>=1.9.0.post1 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | .env 6 | .venv/ 7 | .ipynb_checkpoints 8 | .python-version 9 | 10 | # IDE 11 | .vscode/ 12 | .idea/ 13 | 14 | # OS 15 | .DS_Store 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | OPENAI_API_KEY=your-api-key-here 2 | 3 | # Uncomment to enable tracing with Phoenix (pip install arize-phoenix arize-phoenix-otel openinference-instrumentation-langchain) 4 | # TRACE_PHOENIX=true 5 | 6 | # Uncomment to enable tracing with Logfire (pip install logfire) 7 | # TRACE_LOGFIRE=true 8 | 9 | # Uncomment to enable stdout tracing 10 | # TRACE_SIMPLE=true 11 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | """ 2 | Entry point for the Bank Customer Support RAG application. 3 | Starts the FastAPI server using uvicorn with hot-reload enabled for development. 4 | The application runs on http://localhost:8080 and serves both the API endpoints 5 | and static frontend files. 6 | """ 7 | 8 | import uvicorn 9 | 10 | 11 | if __name__ == "__main__": 12 | uvicorn.run("api:app", host="127.0.0.1", port=8080, reload=True, use_colors=True) 13 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "demo-bank-customer-support" 3 | version = "0.1.0" 4 | description = "Demo Bank Customer Support" 5 | readme = "README.md" 6 | requires-python = ">=3.9" 7 | dependencies = [ 8 | "fastapi>=0.115.4", 9 | "python-dotenv>=1.0.1", 10 | "uvicorn>=0.32.0", 11 | "multinear>=0.1.1", 12 | "langchain-openai>=0.2.10", 13 | "langchain-community>=0.3.4", 14 | "langchain>=0.3.8", 15 | "faiss-cpu>=1.9.0.post1", 16 | ] 17 | -------------------------------------------------------------------------------- /session.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, List, Tuple 2 | 3 | 4 | class SessionManager: 5 | """ 6 | Manages session message history. Uses in-memory storage. 7 | In production, we recommend using Redis or another persistent storage. 8 | """ 9 | 10 | def __init__(self): 11 | self.sessions: Dict[str, List[Tuple[str, bool]]] = {} 12 | 13 | def get_history(self, chat_id: str) -> List[Tuple[str, bool]]: 14 | """ 15 | Retrieves the message history for a given chat. 16 | """ 17 | return [tuple(msg) for msg in self.sessions.get(chat_id, [])] 18 | 19 | def add_message(self, chat_id: str, message: Tuple[str, bool]) -> None: 20 | """ 21 | Adds a message to the session history. 22 | """ 23 | if chat_id not in self.sessions: 24 | self.sessions[chat_id] = [] 25 | self.sessions[chat_id].append(message) 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Multinear 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /tracing.py: -------------------------------------------------------------------------------- 1 | """ 2 | LLM observability configuration for the Bank Customer Support app. 3 | Provides integration with various tracing tools based on environment variables: 4 | - Logfire (https://logfire.pydantic.dev) 5 | - Arize Phoenix (https://phoenix.arize.com) 6 | - Simple stdout logging 7 | 8 | This module helps in debugging and monitoring the RAG system's behavior and performance. 9 | """ 10 | 11 | import os 12 | 13 | 14 | def init_tracing(): 15 | """ 16 | Initialize tracing and observability tools based on environment variables. 17 | 18 | Configures integration with the following tools if the corresponding environment 19 | variables are set. 20 | """ 21 | # if os.getenv("TRACE_LOGFIRE", False): 22 | # print("Initializing Logfire tracing") 23 | # import logfire 24 | # logfire.configure() 25 | # logfire.instrument_openai(Settings._llm._get_client()) 26 | 27 | if os.getenv("TRACE_PHOENIX", False): 28 | print("Initializing Phoenix tracing") 29 | import phoenix as px 30 | px.launch_app() 31 | from phoenix.otel import register 32 | tracer_provider = register() 33 | from openinference.instrumentation.langchain import LangChainInstrumentor 34 | LangChainInstrumentor().instrument(tracer_provider=tracer_provider) 35 | 36 | if os.getenv("TRACE_SIMPLE", False): 37 | print("Initializing stdout tracing") 38 | from langchain.globals import set_debug 39 | set_debug(True) 40 | -------------------------------------------------------------------------------- /.multinear/task_runner.py: -------------------------------------------------------------------------------- 1 | """ 2 | Multinear platform integration module for the Bank Customer Support app. 3 | This module serves as the entry point for the Multinear platform, 4 | allowing testing and evaluation of the RAG system. 5 | 6 | It provides: 7 | - A singleton RAG engine instance for consistent testing 8 | - Task execution interface (entry point) for the Multinear platform 9 | - Integration with the main application's configuration and tracing 10 | """ 11 | 12 | import sys 13 | from pathlib import Path 14 | import asyncio 15 | from dotenv import load_dotenv 16 | 17 | 18 | # Add parent directory to Python path so we can import engine 19 | sys.path.append(str(Path(__file__).parent.parent)) 20 | # flake8: noqa: E402 21 | from engine import RAGEngine 22 | from tracing import init_tracing 23 | 24 | # Singleton instance 25 | _rag_engine = None 26 | 27 | 28 | def _get_rag_engine(): 29 | global _rag_engine 30 | if _rag_engine is None: 31 | load_dotenv() 32 | init_tracing() 33 | _rag_engine = RAGEngine() 34 | _rag_engine.refresh_index() 35 | return _rag_engine 36 | 37 | 38 | def run_task(input: str) -> dict: 39 | """ 40 | Execute a task with the given input using the RAG engine. 41 | 42 | Args: 43 | input (str): The user query or input to process. 44 | 45 | Returns: 46 | dict: A dictionary containing: 47 | - 'output' (str): The AI's response. 48 | - 'details' (dict): Metadata (the model and temperature used). 49 | """ 50 | engine = _get_rag_engine() 51 | response, _ = asyncio.run(engine.process_query([(input, True)])) 52 | 53 | return { 54 | 'output': response, 55 | 'details': { 56 | 'model': engine.model, 57 | 'temperature': engine.temperature, 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Demo Bank RAG (LangChain) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 43 | 44 | 45 | 56 | 57 | 58 | 59 |
60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /api.py: -------------------------------------------------------------------------------- 1 | """ 2 | FastAPI server implementation for the Bank Customer Support RAG application. 3 | Provides REST API endpoints for: 4 | - Chat interactions with RAG-powered responses 5 | - Chat history management 6 | - Index refresh functionality (vector database) 7 | Also serves the static frontend files. 8 | 9 | The server uses FastAPI with CORS enabled and maintains chat sessions using an 10 | in-memory store. 11 | """ 12 | 13 | from fastapi import FastAPI 14 | from fastapi.middleware.cors import CORSMiddleware 15 | from fastapi.staticfiles import StaticFiles 16 | from pydantic import BaseModel 17 | from typing import List 18 | 19 | from engine import RAGEngine 20 | from session import SessionManager 21 | from dotenv import load_dotenv 22 | 23 | from tracing import init_tracing 24 | 25 | 26 | load_dotenv() 27 | init_tracing() 28 | 29 | 30 | app = FastAPI(title="RAG Chat Application") 31 | 32 | # Configure CORS 33 | app.add_middleware( 34 | CORSMiddleware, 35 | allow_origins=["*"], # In production, replace with specific origins 36 | allow_credentials=True, 37 | allow_methods=["*"], 38 | allow_headers=["*"], 39 | ) 40 | 41 | # Initialize RAG engine (singleton) 42 | rag_engine = RAGEngine() 43 | 44 | # Initialize SessionManager (singleton) 45 | session_manager = SessionManager() 46 | 47 | 48 | # Schemas 49 | class NewChatMessage(BaseModel): 50 | message: str 51 | session_id: str 52 | 53 | 54 | class ChatResponse(BaseModel): 55 | response: str 56 | sources: List[str] 57 | 58 | 59 | @app.post("/api/chat", response_model=ChatResponse, tags=["chat"]) 60 | async def chat(body: NewChatMessage): 61 | """ 62 | Process a chat message using RAG and return the response with sources. 63 | 64 | Args: 65 | body (NewChatMessage): The incoming chat message containing 66 | the message text and session ID. 67 | 68 | Returns: 69 | ChatResponse: The AI-generated response along with the sources used. 70 | """ 71 | # Add user's message 72 | user_message = (body.message, True) 73 | session_manager.add_message(body.session_id, user_message) 74 | 75 | # Retrieve session history 76 | msg_list = session_manager.get_history(body.session_id) 77 | 78 | # Process the query using RAG engine with history 79 | response, sources = await rag_engine.process_query(msg_list) 80 | 81 | # Add AI's response 82 | ai_message = (response, False) 83 | session_manager.add_message(body.session_id, ai_message) 84 | 85 | return ChatResponse(response=response, sources=sources) 86 | 87 | 88 | @app.post("/api/refresh-index", tags=["chat"]) 89 | async def refresh_index(): 90 | """ 91 | Refresh the document index by reprocessing all documents in the data directory. 92 | """ 93 | rag_engine.refresh_index() 94 | return {"status": "success", "message": "Index refreshed successfully"} 95 | 96 | 97 | @app.get("/api/get-history", tags=["chat"]) 98 | async def get_history(session_id: str): 99 | """ 100 | Retrieve the chat history for a given session. 101 | """ 102 | history = session_manager.get_history(session_id) 103 | return history 104 | 105 | # Mount static files (frontend) 106 | app.mount("/", StaticFiles(directory="./static", html=True), name="frontend") 107 | -------------------------------------------------------------------------------- /engine.py: -------------------------------------------------------------------------------- 1 | """ 2 | Core RAG (Retrieval-Augmented Generation) engine implementation using LangChain. 3 | This module provides the main RAG functionality for the Bank Customer Support app: 4 | - Document ingestion from FAQ text files 5 | - Vector indexing of documents 6 | - Query processing using GPT-4 with retrieval augmentation 7 | """ 8 | 9 | from langchain_community.document_loaders import TextLoader 10 | from langchain.text_splitter import RecursiveCharacterTextSplitter 11 | from langchain_community.vectorstores import FAISS 12 | from langchain_openai import OpenAIEmbeddings, ChatOpenAI 13 | from langchain.chains import ConversationalRetrievalChain 14 | import os 15 | from typing import Tuple, List 16 | from pathlib import Path 17 | 18 | 19 | class RAGEngine: 20 | """ 21 | Core RAG engine using LangChain. 22 | This class handles document ingestion, indexing, and query processing. 23 | """ 24 | 25 | def __init__(self): 26 | """ 27 | Initialize the RAG engine by setting up the document index. 28 | """ 29 | if not os.getenv("OPENAI_API_KEY"): 30 | raise ValueError("OPENAI_API_KEY environment variable not set") 31 | 32 | self.model = os.getenv("OPENAI_MODEL", "gpt-4o") 33 | self.temperature = float(os.getenv("OPENAI_TEMPERATURE", 0.2)) 34 | 35 | self.embeddings = OpenAIEmbeddings() 36 | self.llm = ChatOpenAI( 37 | model_name=self.model, 38 | temperature=self.temperature 39 | ) 40 | self.vector_store = None 41 | 42 | def refresh_index(self): 43 | """ 44 | (Re)build the document index by processing all documents in the data directory. 45 | """ 46 | # Load the document 47 | loader = TextLoader(str(Path(__file__).parent / "data" / "acme_bank_faq.txt")) 48 | documents = loader.load() 49 | 50 | # Split documents into chunks 51 | text_splitter = RecursiveCharacterTextSplitter( 52 | chunk_size=1000, 53 | chunk_overlap=200 54 | ) 55 | splits = text_splitter.split_documents(documents) 56 | 57 | # Create vector store 58 | self.vector_store = FAISS.from_documents(splits, self.embeddings) 59 | 60 | async def process_query( 61 | self, msg_list: List[Tuple[str, bool]] 62 | ) -> Tuple[str, List[str]]: 63 | """ 64 | Process a user query using RAG with the provided chat history. 65 | 66 | Args: 67 | msg_list (List[Tuple[str, bool]]): A list of messages from session history. 68 | Each tuple contains: 69 | - str: The message text. 70 | - bool: Indicator if the message is from the user (True) or AI (False). 71 | 72 | Returns: 73 | Tuple[str, List[str]]: A tuple containing: 74 | - str: The AI's response to the user's query 75 | - List[str]: A list of source documents used (empty for now) 76 | """ 77 | try: 78 | # Build index if not already loaded 79 | if not self.vector_store: 80 | self.refresh_index() 81 | 82 | # Format chat history for LangChain 83 | chat_history = [] 84 | for i in range(0, len(msg_list) - 1, 2): 85 | if i + 1 < len(msg_list): 86 | chat_history.append((msg_list[i][0], msg_list[i + 1][0])) 87 | 88 | # Create QA chain 89 | qa_chain = ConversationalRetrievalChain.from_llm( 90 | llm=self.llm, 91 | retriever=self.vector_store.as_retriever( 92 | search_kwargs={"k": 3} 93 | ), 94 | return_source_documents=True, 95 | verbose=False 96 | ) 97 | 98 | # Get response 99 | result = await qa_chain.ainvoke({ 100 | "question": msg_list[-1][0], 101 | "chat_history": chat_history 102 | }) 103 | 104 | return result["answer"], [] 105 | except Exception as e: 106 | print(e) 107 | return "Error processing request. Try again.", [] 108 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Demo Bank Customer Support 2 | 3 | This is a simple RAG demo for a bank's customer support bot, for use with the [Multinear](https://multinear.com) platform. 4 | 5 | 6 | 7 | ## Introduction 8 | 9 | This project shows how simple it is to build a proof-of-concept using RAG for a customer support bot answering user questions on FAQ data, with platforms like [LangChain](https://github.com/langchain-ai/langchain). 10 | 11 | The real challenge is to ensure that this bot is **reliable** - always giving the right answer, not hallucinating, and knowing how to deal with ambiguous or off-topic questions. GenAI is a powerful technology, but it's also **unpredictable by design**, and the only way to make it reliable is to build comprehensive test coverage and guardrails. 12 | 13 | That's exactly what the Multinear platform is for. Multinear allows developers to define evaluations in a simple yet powerful way and iteratively develop their GenAI applications, ensuring reliability and security. 14 | 15 | 16 | ## Installation 17 | 18 | 1. **Clone the Repository** 19 | 20 | ```bash 21 | git clone https://github.com/multinear-demo/demo-bank-support-lc-py 22 | cd demo-bank-support-lc-py 23 | ``` 24 | 25 | 2. **Configure Environment Variables** 26 | 27 | Create a `.env` file in the root directory and add your OpenAI API key: 28 | 29 | ```bash 30 | echo "OPENAI_API_KEY=your-api-key-here" > .env 31 | ``` 32 | 33 | ### Option 1: Using `uv` (Recommended) 34 | 35 | [`uv`](https://github.com/astral-sh/uv) is the fastest way to run the application with minimal setup. 36 | 37 | ```bash 38 | # Setup Environment 39 | uv sync 40 | 41 | # Start the Application 42 | uv run main.py 43 | ``` 44 | 45 | ### Option 2: Using `pyenv` 46 | 47 | [`pyenv`](https://github.com/pyenv/pyenv) allows you to manage multiple Python versions and virtual environments. 48 | 49 | ```bash 50 | # Setup Environment 51 | pyenv install 3.9 52 | pyenv virtualenv 3.9 demo-bank 53 | pyenv local demo-bank 54 | pip install -r requirements.txt 55 | 56 | # Start the Application 57 | python main.py 58 | ``` 59 | 60 | ### Option 3: Using Python's built-in `venv` 61 | 62 | ```bash 63 | # Setup Environment 64 | python3 -m venv .venv 65 | source .venv/bin/activate 66 | # On Windows: 67 | # .\.venv\Scripts\activate 68 | pip install -r requirements.txt 69 | 70 | # Start the Application 71 | python3 main.py 72 | ``` 73 | 74 | Open http://127.0.0.1:8080 to see the application. 75 | 76 | Try asking different questions to see how the bot handles them: 77 | 78 | - Hi there! 79 | - How do I reset my password? 80 | - What's the current exchange rate? 81 | - Where is the closest coffee shop? 82 | 83 | ## Tracing 84 | 85 | Enable LLM tracing with [Arize Phoenix](https://phoenix.arize.com) in the `.env` file (see [.env.example](.env.example) and [tracing.py](tracing.py)). 86 | 87 | --- 88 | 89 | ### Jupyter Notebook 90 | 91 | ```bash 92 | # Using uv 93 | uv run --with jupyter jupyter lab notebook.ipynb 94 | 95 | # Using pyenv / virtualenv 96 | pip install jupyter 97 | jupyter lab notebook.ipynb 98 | ``` 99 | 100 | ## Architecture 101 | 102 | Key system components: 103 | 104 | 1. [RAG Engine](engine.py) for document ingestion, indexing, and query processing using the `LangChain` library and `OpenAI` model. 105 | 2. [API Server](api.py) with `FastAPI` endpoints for chat, reindexing, and session management. 106 | 3. [HTML](static/index.html) & [React JS](static/app.js) frontend. 107 | 4. [Dataset](data/acme_bank_faq.txt) for the RAG engine. 108 | 5. [Experiment Runner](.multinear/task_runner.py) entry point for `Multinear` platform. 109 | 6. [Configuration](.multinear/config.yaml) for evaluation tasks. 110 | 111 | ## Experimentation Platform 112 | 113 | The platform is designed to facilitate the development and evaluation of GenAI applications through systematic experimentation. 114 | 115 | ### Running Experiments 116 | 117 | 1. **Define Tasks** 118 | 119 | Configure your evaluation tasks in `.multinear/config.yaml`. Each task represents a specific input scenario for the customer support bot, and defines how to evaluate the output. 120 | 121 | 2. **Execute Experiments** 122 | 123 | Run `Multinear` platform. 124 | 125 | ```bash 126 | # Using uv 127 | uv run multinear web_dev 128 | 129 | # Using pyenv / virtualenv 130 | multinear web_dev 131 | ``` 132 | 133 | Open http://127.0.0.1:8000 and start experimenting. 134 | 135 | ## License 136 | 137 | This project is licensed under the [MIT License](LICENSE). 138 | 139 | --- 140 | 141 |

142 | Built by Multinear. 143 |

144 | -------------------------------------------------------------------------------- /notebook.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "a3d37ad9-879e-496c-83f6-36a1f9cb1eb0", 7 | "metadata": {}, 8 | "outputs": [ 9 | { 10 | "name": "stdout", 11 | "output_type": "stream", 12 | "text": [ 13 | "- loaded bank docs\n", 14 | "- created bank index\n" 15 | ] 16 | }, 17 | { 18 | "data": { 19 | "text/plain": [ 20 | "{'question': 'How do I unblock my credit card?',\n", 21 | " 'chat_history': [],\n", 22 | " 'answer': \"To unblock your credit card, follow these steps:\\n\\n1. **Access Online Banking**: Log in securely to your online banking account.\\n2. **Navigate to the Accounts Overview**: Click on the credit card that you need to unblock.\\n3. **Under 'Manage Your Card,' Select 'Block/Unblock'**: Follow the pop-up instructions for confirmation.\\n4. **Proceed with Changes**: Confirm to unblock the card immediately.\\n\\nIf online banking isn’t available, you can visit a branch or contact support for assistance.\",\n", 23 | " 'source_documents': [Document(metadata={'source': './data/acme_bank_faq.txt'}, page_content=\"Visit a branch or contact support if online banking isn’t available.\\n\\n**Blocking or Unblocking a Credit Card**\\n\\nTo block/unblock a credit card:\\n\\n1. **Access Online Banking**: Log in securely.\\n2. **Navigate to the Accounts Overview**: Click on the credit card needing modifications.\\n3. **Under 'Manage Your Card,' Select 'Block/Unblock'**: Follow the pop-up instructions for confirmation.\\n4. **Proceed with Changes**: Confirm to either block or unblock the card immediately.\\n\\nRemember, blocking prevents new transactions, though it can be undone at any time.\\n\\n**Ordering or Replacing Visa Debit and Debit Cards**\\n\\nTo order or replace cards:\"),\n", 24 | " Document(metadata={'source': './data/acme_bank_faq.txt'}, page_content=\"## Cards\\n\\n**Activating a Credit Card**\\n\\nTo activate your credit card:\\n\\n**For Cards with Existing PINs**\\n\\n1. **Visit Online Banking/ App**: Log in using your credentials.\\n2. **Select Credit Card**: Find it under the accounts section.\\n3. **Locate 'Additional Options**: Under 'Card Status,' select ‘Activate your Card.'\\n4. **In-Store Activation**: As an alternative, insert your card in-store and enter your current PIN to activate.\\n\\n**For New Cards or Those Without a PIN**\\n\\n1. **Log into Online Banking/ App**: Enter credentials and head to 'Cards.'\\n2. **Select 'Set/Change PIN'**: Enter and reconfirm a new PIN.\\n3. **Activate Without a PIN**: Choose activation while opting to sign for payments initially, if preferred.\\n\\nVisit a branch or contact support if online banking isn’t available.\\n\\n**Blocking or Unblocking a Credit Card**\\n\\nTo block/unblock a credit card:\"),\n", 25 | " Document(metadata={'source': './data/acme_bank_faq.txt'}, page_content=\"Remember, blocking prevents new transactions, though it can be undone at any time.\\n\\n**Ordering or Replacing Visa Debit and Debit Cards**\\n\\nTo order or replace cards:\\n\\n1. **Log into Online Banking**: Or use our mobile app.\\n2. **Select 'Apply & Open'**: Choose the 'Cards' option.\\n3. **Choose Card Type**: Opt for either Visa Debit or traditional debit cards.\\n4. **Enter Required Details**: Create a new PIN and link desired accounts (up to two).\\n5. **Confirm Information and Submit**: Ensure your postal address is up-to-date to receive your card within 1–2 weeks.\\n\\nFor urgent needs, visit the nearest branch.\\n\\n**Cancelling Visa Debit and Debit Cards**\\n\\nTo cancel cards effectively:\\n\\n1. **Log into Online Banking**: Use secure credentials.\\n2. **Head to Settings**: Locate 'Cancel a Card' midway through the page.\\n3. **Select and Cancel**: Choose the correct card and confirm cancellation.\\n\\nThis process avoids errors, ensuring accurate processing.\\n\\n**Setting or Changing a Card PIN**\")]}" 26 | ] 27 | }, 28 | "execution_count": 1, 29 | "metadata": {}, 30 | "output_type": "execute_result" 31 | } 32 | ], 33 | "source": [ 34 | "from langchain_community.document_loaders import TextLoader\n", 35 | "from langchain.text_splitter import RecursiveCharacterTextSplitter\n", 36 | "from langchain_community.vectorstores import FAISS\n", 37 | "from langchain_openai import OpenAIEmbeddings, ChatOpenAI\n", 38 | "from langchain.chains import ConversationalRetrievalChain\n", 39 | "from langchain.prompts import PromptTemplate\n", 40 | "\n", 41 | "from dotenv import load_dotenv\n", 42 | "load_dotenv()\n", 43 | "\n", 44 | "embeddings = OpenAIEmbeddings()\n", 45 | "llm = ChatOpenAI(model=\"gpt-4o\", temperature=0.2)\n", 46 | "\n", 47 | "loader = TextLoader(\"./data/acme_bank_faq.txt\")\n", 48 | "documents = loader.load()\n", 49 | "text_splitter = RecursiveCharacterTextSplitter(\n", 50 | " chunk_size=1000,\n", 51 | " chunk_overlap=200\n", 52 | ")\n", 53 | "splits = text_splitter.split_documents(documents)\n", 54 | "print(\"- loaded bank docs\")\n", 55 | "vector_store = FAISS.from_documents(splits, embeddings)\n", 56 | "print(\"- created bank index\")\n", 57 | "\n", 58 | "qa_chain = ConversationalRetrievalChain.from_llm(\n", 59 | " llm=llm,\n", 60 | " retriever=vector_store.as_retriever(\n", 61 | " search_kwargs={\"k\": 3}\n", 62 | " ),\n", 63 | " return_source_documents=True,\n", 64 | " verbose=False\n", 65 | ")\n", 66 | "result = qa_chain.invoke({\n", 67 | " \"question\": \"How do I unblock my credit card?\",\n", 68 | " \"chat_history\": []\n", 69 | "})\n", 70 | "print(result[\"answer\"])" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "id": "61f9f3f1-fb36-4bc0-9414-be5512e85b59", 77 | "metadata": {}, 78 | "outputs": [], 79 | "source": [] 80 | } 81 | ], 82 | "metadata": { 83 | "kernelspec": { 84 | "display_name": "Python 3 (ipykernel)", 85 | "language": "python", 86 | "name": "python3" 87 | }, 88 | "language_info": { 89 | "codemirror_mode": { 90 | "name": "ipython", 91 | "version": 3 92 | }, 93 | "file_extension": ".py", 94 | "mimetype": "text/x-python", 95 | "name": "python", 96 | "nbconvert_exporter": "python", 97 | "pygments_lexer": "ipython3", 98 | "version": "3.12.6" 99 | } 100 | }, 101 | "nbformat": 4, 102 | "nbformat_minor": 5 103 | } 104 | -------------------------------------------------------------------------------- /.multinear/config.yaml: -------------------------------------------------------------------------------- 1 | project: 2 | name: Demo - Bank Customer Support 3 | id: bank-1 4 | description: Demo project 5 | 6 | tasks: 7 | - input: I received my credit card today but there's no PIN with it. What should I do to start using it? 8 | id: activate-credit-card-no-pin 9 | checklist: |- 10 | - Answer outlines the process for activating a credit card without an existing PIN. 11 | - Answer mentions logging into Online Banking or the mobile app to access the 'Cards' section. 12 | - Answer includes steps to set a new PIN and the option to activate the card by opting to sign for payments initially. 13 | - Answer provides alternatives such as visiting a branch or contacting support if online methods are unavailable. 14 | min_score: 0.8 15 | 16 | - input: need help paying off my card balance online please 17 | id: pay-credit-card-bill-online 18 | checklist: |- 19 | - Answer explains the process of logging into Online Banking with credentials. 20 | - Answer describes accessing the credit card account from the accounts display. 21 | - Answer details clicking on 'Make Payment' and selecting the payment amount. 22 | - Answer includes choosing a payment source from linked accounts. 23 | - Answer mentions reviewing and confirming the payment, and receiving a confirmation email. 24 | min_score: 0.8 25 | 26 | - input: "how do i change my phone # in the system? also wanna update my security questions while im at it" 27 | id: update-mobile-and-security-questions 28 | checklist: |- 29 | - Answer provides steps to log into Online Banking with username and password. 30 | - Answer describes navigating to the 'Profile' or 'Settings' section for both updates. 31 | - Answer outlines the process to update the mobile number, including verification via a confirmation code. 32 | - Answer explains how to select and change security questions, ensuring they are memorable yet secure. 33 | - Answer mentions saving changes and receiving confirmation notifications for both updates. 34 | # - Answer advises contacting customer service if any verification steps cannot be completed online. 35 | min_score: 0.7 36 | 37 | - input: need to send money to my sister in germany... never done this before, how does it work? 38 | id: setup-international-money-transfer 39 | checklist: |- 40 | - Answer details logging into Online Banking securely. 41 | - Answer explains selecting the international transfer option under transfers. 42 | - Answer includes entering recipient's international account number (IBAN) and swift code accurately. 43 | - Answer mentions selecting the transfer amount and choosing the appropriate currency. 44 | - Answer describes reviewing exchange rates and associated transfer fees before confirming. 45 | - Answer outlines the confirmation process and receiving transaction notifications via email or SMS. 46 | # - Answer may suggest downloading and emailing an International Money Transfer Request form as an alternative. 47 | min_score: 0.8 48 | 49 | - input: how do i set up autopay for my bills? also need to add my landlord as a payee 50 | id: manage-automatic-payments-add-payee 51 | checklist: |- 52 | - Answer explains logging into Online Banking or the mobile app securely. 53 | - Answer describes navigating to the 'Payments' section for managing automatic payments. 54 | - Answer outlines steps to view, modify, or cancel existing automatic payments. 55 | - Answer details the process to add a new payee, including entering payee details and saving them for future transactions. 56 | - Answer mentions reviewing and confirming changes to ensure they align with the user’s financial preferences. 57 | # - Answer may reference available step-by-step guides on the Acme Bank website for additional assistance. 58 | min_score: 0.8 59 | 60 | - input: How do I reset my internet banking password? 61 | id: reset-banking-password 62 | checklist: |- 63 | - Answer explains the steps to reset the internet banking password. 64 | - Answer mentions that users who have verified their mobile number can reset the password online through internet banking or the mobile app. 65 | - Answer notes an SMS one-time code will be sent, and the user needs to answer their KeepSafe questions. 66 | - Answer informs users without a registered mobile number to call bank with their access number and ID used when opening the account. 67 | min_score: 0.7 68 | 69 | - input: How can I update my registered mobile number? 70 | id: update-registered-mobile 71 | checklist: |- 72 | - Answer explains that users can update their mobile number in internet banking or the mobile app by following specific instructions. 73 | - Answer mentions that users experiencing technical problems accessing their account online should contact bank. 74 | - Answer states users will need to provide their access number and the ID used to open their account. 75 | min_score: 0.6 76 | 77 | - input: How can I invest in cryptocurrency through Acme Bank? 78 | id: negative-invest-cryptocurrency 79 | checklist: |- 80 | - Answer indicates that this information is not available in the current documentation. 81 | - Answer suggests contacting customer support for further assistance or clarifications. 82 | min_score: 1 83 | 84 | # - input: "How do I set up payments for online shopping?" 85 | # checklist: |- 86 | # - Verify that the answer explains how to set up payments for online shopping. 87 | # - Check if it advises users to enter their card details on the payment page of the online store. 88 | # - Ensure that the answer emphasizes checking for the locked padlock icon in the browser before the website address to confirm it's a secure site. 89 | # - Confirm that it suggests users regularly check their accounts to ensure the correct amounts are going out at the right time. 90 | # - Verify that the answer references staying safe when making payments online, such as directing users to the security page. 91 | # min_score: 1 92 | 93 | # - input: "How do I activate my credit card if I don't have internet banking?" 94 | # checklist: |- 95 | # - Verify that the answer explains how to activate a credit card without internet banking. 96 | # - If the card already has a PIN: 97 | # - Check if the answer advises the user to activate the card by using it in any store, inserting the card into the EFTPOS machine, and entering their current PIN. 98 | # - If the card doesn't have a PIN: 99 | # - Ensure that the answer informs the user they can activate the card by making a purchase in-store and signing for it. 100 | # - Confirm that it mentions after making a purchase by signing, the user will be able to make contactless payments. 101 | # - Verify that it notes the user won't be able to use the card in an ATM without a PIN. 102 | # - Check if the answer suggests calling bank or visiting the nearest branch to activate the card or set a PIN. 103 | # min_score: 1 104 | 105 | # - input: "How do I change my maturity instructions for my Term Deposit?" 106 | # checklist: |- 107 | # - Verify that the answer explains how to change maturity instructions in internet banking. 108 | # - Check that the answer provides step-by-step guidance: 109 | # - Select the Term Deposit on the 'Accounts' page. 110 | # - Select 'Change' next to Maturity details. 111 | # - Ensure that the answer describes the options available: 112 | # - Change to pay out the interest at maturity to a New Zealand dollar bank account. 113 | # - Change to pay out the full Term Deposit at maturity to a New Zealand dollar bank account. 114 | # - Reinvest the Term Deposit with or without the interest by choosing the term to reinvest. 115 | # - Confirm that it mentions if the user chooses to reinvest at maturity, the Term Deposit will reinvest for the selected term at the rate on the day of maturity. 116 | # - Verify that the explanation is clear and complete. 117 | # min_score: 1 118 | 119 | # - input: "How do I apply for a home loan with bank?" 120 | # checklist: |- 121 | # - Verify that the answer correctly recognizes that the information is not available in the provided document. 122 | # - Check that the response politely informs the user that this information isn't covered in the current context. 123 | # - Ensure that it suggests visiting the bank website or contacting customer support for assistance with home loans. 124 | # - Confirm that the answer avoids providing incorrect or fabricated information. 125 | # - Verify that the response is appropriate, helpful, and adheres to policies on handling unsupported queries. 126 | # min_score: 1 127 | -------------------------------------------------------------------------------- /static/app.js: -------------------------------------------------------------------------------- 1 | const { useState, useEffect, useRef, useCallback } = React; 2 | 3 | // useCallback to prevent unnecessary re-creations on each render 4 | 5 | // API Service for handling chat-related requests 6 | const apiService = { 7 | async sendChatMessage(message, session_id) { 8 | const response = await fetch('/api/chat', { 9 | method: 'POST', 10 | headers: { 11 | 'Content-Type': 'application/json', 12 | }, 13 | body: JSON.stringify({ message, session_id }), 14 | }); 15 | if (!response.ok) throw new Error('Failed to get response from API'); 16 | return response.json(); 17 | }, 18 | 19 | async refreshIndex() { 20 | const response = await fetch('/api/refresh-index', { method: 'POST' }); 21 | if (!response.ok) throw new Error('Failed to get response from API'); 22 | return response.json(); 23 | }, 24 | 25 | async getHistory(sessionId) { 26 | const response = await fetch(`/api/get-history?session_id=${sessionId}`); 27 | if (!response.ok) throw new Error('Failed to fetch chat history'); 28 | return response.json(); 29 | }, 30 | }; 31 | 32 | /** 33 | * Notification Component 34 | * Displays temporary success or error messages to the user. 35 | * Automatically dismisses after 3 seconds. 36 | */ 37 | const Notification = ({ message, type, onClose }) => { 38 | useEffect(() => { 39 | const timer = setTimeout(onClose, 3000); // Auto-close notification 40 | lucide.createIcons(); 41 | return () => clearTimeout(timer); // Cleanup timer on unmount 42 | }, [onClose]); 43 | 44 | // Determine background color and icon based on notification type 45 | const bgColor = type === 'error' ? 'bg-red-500' : 'bg-green-500'; 46 | const icon = type === 'error' ? 'alert-circle' : 'check-circle'; 47 | 48 | return ( 49 |
50 | 51 | {message} 52 |
53 | ); 54 | }; 55 | 56 | /** 57 | * Chat Component 58 | * Root component managing the chat interface, including message handling, API interactions, 59 | * and integrating other sub-components like Header, ChatWindow, Actions, and Footer. 60 | */ 61 | const Chat = () => { 62 | const [messages, setMessages] = useState([]); 63 | const [input, setInput] = useState(''); 64 | const [isLoading, setIsLoading] = useState(false); 65 | const [isRefreshing, setIsRefreshing] = useState(false); 66 | const [notification, setNotification] = useState(null); 67 | const [sessionId, setSessionId] = useState(() => localStorage.getItem('session_id') || generateID()); 68 | 69 | const messagesEndRef = useRef(null); 70 | const inputRef = useRef(null); 71 | 72 | // Persist session ID 73 | useEffect(() => { 74 | localStorage.setItem('session_id', sessionId); 75 | }, [sessionId]); 76 | 77 | // Scroll to bottom helper 78 | const scrollToBottom = useCallback(() => { 79 | messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }); 80 | }, []); 81 | 82 | // Fetch chat history on mount 83 | useEffect(() => { 84 | const fetchHistory = async () => { 85 | try { 86 | const history = await apiService.getHistory(sessionId); 87 | const formattedHistory = history.map(([text, isUser]) => ({ text, isUser: Boolean(isUser) })); 88 | setMessages(formattedHistory); 89 | scrollToBottom(); 90 | } catch (error) { 91 | console.error('Error fetching chat history:', error); 92 | } finally { 93 | lucide.createIcons(); 94 | } 95 | }; 96 | 97 | fetchHistory(); 98 | }, [sessionId, scrollToBottom]); 99 | 100 | // Auto-focus input on mount 101 | useEffect(() => { 102 | inputRef.current?.focus(); 103 | }, []); 104 | 105 | // Handler to send messages 106 | const sendMessage = useCallback( 107 | async (e) => { 108 | e.preventDefault(); 109 | const trimmedInput = input.trim(); 110 | if (!trimmedInput) return; // Prevent sending empty messages 111 | 112 | setIsLoading(true); 113 | setMessages((prev) => [...prev, { text: trimmedInput, isUser: true }]); 114 | setInput(''); 115 | 116 | try { 117 | const data = await apiService.sendChatMessage(trimmedInput, sessionId); 118 | setMessages((prev) => [...prev, { text: data.response, isUser: false }]); 119 | } catch (error) { 120 | setMessages((prev) => [...prev, { text: error.message, isUser: false }]); 121 | } finally { 122 | setIsLoading(false); 123 | inputRef.current?.focus(); // Refocus input after sending 124 | scrollToBottom(); 125 | } 126 | }, 127 | [input, sessionId, scrollToBottom] 128 | ); 129 | 130 | // Handler to refresh index 131 | const refreshIndex = useCallback(async () => { 132 | setIsRefreshing(true); 133 | try { 134 | const response = await apiService.refreshIndex(); 135 | setNotification({ message: response.message, type: 'success' }); 136 | } catch (error) { 137 | setNotification({ message: error.message, type: 'error' }); 138 | } finally { 139 | setIsRefreshing(false); 140 | } 141 | }, []); 142 | 143 | // Handler to reset chat 144 | const resetChat = useCallback(() => { 145 | setSessionId(generateID()); 146 | setMessages([]); 147 | setInput(''); 148 | setNotification({ message: 'Chat history cleared.', type: 'success' }); 149 | }, []); 150 | 151 | return ( 152 |
153 |
154 | 163 | 170 |
172 | ); 173 | }; 174 | 175 | /** 176 | * Header Component 177 | * Displays the application's header with title and attribution. 178 | */ 179 | const Header = () => ( 180 |
181 |
182 |

Demo: Bank Customer Support

183 |
184 | 185 | Powered by 186 | 187 | LangChain 188 | 189 | 190 | 🦜️🔗 191 |
192 |
193 |
194 | ); 195 | 196 | /** 197 | * ChatWindow Component 198 | * Renders the chat messages, input field, and send button. 199 | * Handles the display of loading indicators and message styling. 200 | * 201 | * React.memo to avoid re-rendering unless its props change. 202 | */ 203 | const ChatWindow = React.memo( 204 | ({ messages, isLoading, sendMessage, input, setInput, inputRef, messagesEndRef }) => ( 205 |
206 |
207 |
208 | {messages.length === 0 && ( 209 |
210 | Start a conversation by sending a message. 211 |
212 | )} 213 | {messages.map((msg, index) => ( 214 |
215 |
222 | {msg.text.split("\n").map((line, index) => ( 223 | 224 | {line} 225 |
226 |
227 | ))} 228 |
229 |
230 | ))} 231 | {isLoading && ( 232 |
233 |
234 | AI is thinking 235 |
236 |
237 | )} 238 |
{/* Reference point to scroll into view */} 239 |
240 |
241 |
242 |
243 | setInput(e.target.value)} 248 | placeholder="Ask a question..." 249 | className="flex-grow px-4 py-2 focus:outline-none" 250 | disabled={isLoading} // Disable while loading 251 | /> 252 | 260 |
261 |
262 |
263 | ) 264 | ); 265 | 266 | /** 267 | * Actions Component 268 | * Provides buttons for resetting the chat and refreshing the index. 269 | * Displays notifications based on user actions. 270 | */ 271 | const Actions = ({ refreshIndex, resetChat, isRefreshing, notification, setNotification }) => ( 272 |
273 |
274 | 284 | 296 |
297 | {notification && ( 298 |
299 | setNotification(null)} /> 300 |
301 | )} 302 |
303 | ); 304 | 305 | /** 306 | * Footer Component 307 | * Displays footer information with credits and links. 308 | */ 309 | const Footer = () => ( 310 | 335 | ); 336 | 337 | /** 338 | * Renders the Chat component into the root DOM element. 339 | * Entry point of the React application. 340 | */ 341 | ReactDOM.render(, document.getElementById('root')); 342 | 343 | // Utility function to generate ID 344 | function generateID() { 345 | return window.crypto?.randomUUID?.() || Date.now().toString(); 346 | } 347 | -------------------------------------------------------------------------------- /data/acme_bank_faq.txt: -------------------------------------------------------------------------------- 1 | ### Increase in Scam Activities 2 | 3 | We have identified a significant rise in fraudulent activities, such as emails and phone calls, impersonating Acme Bank and other reputable companies. Stay alert and check regularly for updates on current scams to protect yourself from potential threats. 4 | 5 | # Comprehensive Assistance for Online Banking 6 | 7 | If you require detailed guidance on setting up or utilizing online banking, our support page offers answers to frequently asked questions, ensuring a seamless banking experience. 8 | 9 | ## Setting Up or Resetting Your Online Banking Account 10 | 11 | **How can I set up or enroll in online banking?** 12 | 13 | To establish your online banking access, follow these steps: 14 | 15 | 1. **Visit our website**: Navigate to the "Enroll in Online Banking" section found on the home page. 16 | 2. **Personal Information**: Enter your full name, Social Security Number, and your Acme Bank account number. 17 | 3. **Select Your Security Preferences**: Choose security questions and enter your responses. These will be used to verify your identity in future sessions. 18 | 4. **Verify Your Email and Mobile Number**: Input these for verification and to receive important notifications. 19 | 5. **Create a Username and Password**: Your password must include a mix of letters, numbers, and symbols for enhanced security. Maintain this information confidentially. 20 | 6. **Confirm and Submit**: Review your data and submit it for confirmation. A confirmation email will be sent once your account setup is complete. 21 | 22 | For those needing assistance, our support representatives can guide you through this process. Simply fill out our digital banking support form on our website, and a team member will contact you promptly. 23 | 24 | **How can I reset my online banking password?** 25 | 26 | Resetting your password involves these steps: 27 | 28 | 1. **Access the Online Banking Portal**: Visit our website and select "Forgot Password?" from the login page. 29 | 2. **Enter Identification Details**: Provide your username and the last four digits of your Social Security Number. 30 | 3. **Mobile Verification**: If your number is on file, you’ll receive a one-time SMS code. Enter this code to proceed. 31 | 4. **Security Verification**: Answer your pre-chosen security questions. 32 | 5. **Create a New Password**: Follow guidelines to ensure your password is strong. Re-enter the new password to confirm. 33 | 6. **Confirmation**: You will receive a confirmation email notifying you that your password has been reset. 34 | 35 | In absence of a registered mobile number, please call us with your access number and relevant ID (e.g., driver’s license or passport). Our representative will verify your identity and assign a temporary password over the phone. Remember to update your mobile number to facilitate future resets independently. 36 | 37 | **How can I change my security questions?** 38 | 39 | To update security questions, the process is as follows: 40 | 41 | 1. **Log into Online Banking**: Use your username and password to enter your account. 42 | 2. **Navigate to Security Settings**: Typically found under the "Profile" or "Settings" tab. 43 | 3. **Select Security Questions**: Review and update as necessary. Choose questions and answers that are easy for you to remember but difficult for others to guess. 44 | 4. **Save Changes**: Confirm your new selections and logout securely. 45 | 46 | For troubleshooting common issues with security questions, detailed solutions are accessible via our website. 47 | 48 | **How do I update my registered mobile number?** 49 | 50 | To change your mobile number, follow these detailed steps: 51 | 52 | 1. **Login to Your Account**: Use your online banking credentials. 53 | 2. **Locate the Personal Information Section**: Usually found under the "Profile" menu. 54 | 3. **Update Mobile Number**: Input your new mobile number and confirm. 55 | 4. **Verification**: A confirmation code will be sent to your new mobile number. Enter it within the online banking portal to verify the change. 56 | 5. **Confirmation**: You will receive an email confirming your mobile number has been updated. 57 | 58 | If you face any technical challenges, contact us with your access number and identification information used upon account setup. Please note that you get five complimentary calls monthly; calls exceeding this may incur a fee. 59 | 60 | **Where can I find my access number?** 61 | 62 | Your access number is easily accessible through various means: 63 | 64 | - **Monthly Statements**: Check your monthly bank statement where the access number is frequently displayed. 65 | - **Mobile App**: Login and click on the 'More' option; your access number appears under your name near the Acme Bank logo. 66 | - **Visa Debit or Credit Cards**: Look on the card's back, where your name and access number are printed. 67 | - **Welcome Email**: New online banking customers receive their access number in the welcome email shortly after registration. 68 | 69 | **How can I log back into my account after being logged out due to inactivity?** 70 | 71 | To regain access after inactivity, simply: 72 | 73 | 1. **Re-enter Your Access Number and Password**: Use the login page to input your credentials. 74 | 2. **Complete Security Verification if Prompted**: Depending on your settings, you might be asked to answer security questions or input an SMS code. 75 | 3. **Access Your Dashboard**: Once successfully logged in, you will be redirected to your account dashboard. 76 | 77 | Keep your session active by regularly moving your cursor or engaging with different features on the platform. 78 | 79 | ## Managing Your Account 80 | 81 | **How do I update my personal details?** 82 | 83 | Updating your contact information involves these steps: 84 | 85 | 1. **Log into the Account Dashboard**: Enter using your username and password. 86 | 2. **Visit the Settings or Profile Section**: Found within the top or side navigation panel. 87 | 3. **Modify Personal Details**: Ensure the accuracy of your address, phone number, and email. 88 | 4. **Submit Changes**: Save your updates. You might receive a confirmation notice verifying the changes. 89 | 5. **Confirmation via Email/SMS**: You will receive an alert confirming the updated information. 90 | 91 | For mobile number updates, a one-time code is sent for confirmation. If you have shifted to a new number unavailable for verification, get in touch with customer service. 92 | 93 | **Updating Information with Insurance Providers** 94 | 95 | Remember to update your contact details separately with our insurance partners to ensure seamless communications regarding your insurance policies. 96 | 97 | **Opening a New Account Online** 98 | 99 | **For Existing Acme Bank Customers** 100 | 101 | To initiate a new account seamlessly: 102 | 103 | 1. **Access Online Banking**: Log into your existing account. 104 | 2. **Navigate to 'Apply & Open'**: This is located on the main dashboard or menu. 105 | 3. **Select Account Type**: Choose the account you wish to open (e.g., savings, checking). 106 | 4. **Complete Application**: Fill in any necessary information, ensuring accuracy. 107 | 5. **Submit for Review and Confirmation**: After submission, you'll receive a verification email or SMS. 108 | 6. **Access Account Immediately**: Most new accounts are available for use right away unless specific verification is required. 109 | 110 | If online banks aren’t accessible, reach out to us, or visit any branch for direct assistance. 111 | 112 | **New to Acme Bank** 113 | 114 | Joining Acme Bank online is convenient: 115 | 116 | 1. **Visit the Acme Bank Website**: Locate the "Join Us" link. 117 | 2. **Begin Application Process**: Choose between individual or business accounts and enter relevant details. 118 | 3. **Identity Verification**: You’ll need to provide identification (e.g., driver's license) and current address proof. 119 | 4. **Review Available Account Options**: Choose from accounts like Free Saver and Business Edge. 120 | 5. **Submit Application**: Once reviewed, you'll receive an email detailing the next steps. 121 | 6. **Download Our App for Access**: Newly opened accounts can be linked to the mobile app once identity verification is complete. 122 | 123 | Relocating to the US? Start the process online and visit a branch after arrival to complete verification. 124 | 125 | **How do I close an account?** 126 | 127 | To close an account, ensure: 128 | 129 | 1. **Zero Account Balance**: Transfer any remaining funds to another account. 130 | 2. **Cancel Automatic Payments**: Stop any recurring transfers or redirects them to another account. 131 | 3. **Use Secure Messaging or the App**: Send a message within online banking or use the app to initiate closure. 132 | 4. **Direct Call for Assistance**: If necessary, contact our support line. Prepare any required identification information. 133 | 5. **Download Account Statements**: Before finalizing, ensure all necessary documents are downloaded as online access will be removed post closure. 134 | 135 | We appreciate feedback regarding account closure, aiding in our service enhancement efforts. 136 | 137 | **Contacting Acme Bank from Abroad** 138 | 139 | For non-urgent support while overseas: 140 | 141 | 1. **Log into Online Banking or App**: Communicate securely via message. 142 | 2. **For Urgent Support (e.g., Fraud)**: Call our dedicated international support line for immediate assistance. 143 | 3. **Travel Notification**: Inform us about your travel plans via settings under 'Travel Notice' to receive prioritized support and reduce the chance of security holds on your account. 144 | 145 | **Checking Account Balances** 146 | 147 | To view your balances: 148 | 149 | 1. **Log into Online Banking or the App**: Ensure secure login. 150 | 2. **Access Accounts Dashboard**: View balances and transactions at a glance. 151 | 3. **Detailed Transaction View**: Click on each account for further breakdown to ensure all deposits and withdrawals are recorded correctly. 152 | 153 | If issues arise or balances seem inaccurate, send us a secure message. 154 | 155 | **Why is account closure available on the app but not on online banking?** 156 | 157 | Current technology prioritizes mobile app functionality for immediate banking needs including account closure. The app offers streamlined access, leveraging device-specific security. Anticipate extending closure capabilities online in future updates. In case of app access issues, utilize secure online banking messaging for support. 158 | 159 | **Adding a Payee to an Account** 160 | 161 | To add a payee: 162 | 163 | 1. **Log into Online Banking or the App**: Securely access your account. 164 | 2. **Navigate to Payments**: Typically under a 'Pay & Transfer' section. 165 | 3. **Select 'Add Payee'**: Enter the payee's details, such as name and account number. 166 | 4. **Review and Save**: Confirm details before saving for future transactions. 167 | 168 | Detailed step-by-step guides are available on the Acme Bank website for additional guidance. 169 | 170 | **Changing Automatic Payments Online** 171 | 172 | Make changes or cancel automatic payments directly through online banking: 173 | 174 | 1. **Log into Your Account**: Securely access online banking. 175 | 2. **Visit the Payments Section**: Locate scheduled payments. 176 | 3. **Select Desired Payment**: View details for review. 177 | 4. **Modify or Cancel**: Adjust amount/dates, or select cancellation for final termination. 178 | 5. **Save and Confirm**: Confirm any changes or cancellations to take immediate effect. 179 | 180 | Comprehensive help is available online, ensuring your scheduled payments align with your financial preferences. 181 | 182 | ## Transactions 183 | 184 | **Making an Online Transfer** 185 | 186 | To transfer funds: 187 | 188 | 1. **Log into Your Account**: Ensure secure entry to online banking. 189 | 2. **Navigate to Transfers**: Easily found under the main menu. 190 | 3. **Input Recipient Details**: Enter the recipient's name and account number (domestic transfers). 191 | 4. **Confirm Transfer Amount**: Ensure accuracy before proceeding. 192 | 5. **Review and Complete**: Confirm transaction details, ensuring all data is accurate, and submit. 193 | 6. **Receive Confirmation**: An email or SMS notifies you of successful transfers. 194 | 195 | For international transfers, ensure correct IBAN (International Bank Account Number) and currency conversion options are specified, with instructions available via our website. 196 | 197 | **Sending Money Internationally** 198 | 199 | With international transfers, utilize these options: 200 | 201 | 1. **Log into Online Banking**: Ensure secure navigation. 202 | 2. **Select International Transfer Option**: Located under transfers. 203 | 3. **Fill in Recipient Details**: Ensure recipient’s international account number (IBAN) and swift code are correctly entered. 204 | 4. **Amount and Currency Selection**: Select the appropriate amount and currency, ensuring correct conversion. 205 | 5. **Review Transfer Fees**: Be aware of applicable fees. 206 | 6. **Submit and Confirm**: You will receive transaction confirmation via your registered email or SMS. 207 | 208 | Alternatively, download, complete, and email an International Money Transfer Request form. This option may be more suitable for those preferring additional documentation. 209 | 210 | **Making Payments Overseas** 211 | 212 | For payments while traveling: 213 | 214 | 1. **Access Online Banking or the App**: Use secure login credentials. 215 | 2. **Initiate Payment**: Go to the 'Pay & Transfer' section and select 'New Payment.' 216 | 3. **Specify Payment Details**: Enter payee information and payment amount. 217 | 4. **International Verification**: Ensure your phone can receive one-time codes; SIM roaming may incur fees. 218 | 5. **Notify Acme Bank of Travel Plans**: Update via the 'Travel Notice' on settings to avoid issues. 219 | 6. **Completion and Confirmation**: Confirm transaction and await confirmation email. 220 | 221 | For issues related to SMS code reception, contact us directly for assistance. 222 | 223 | **International Payments from Foreign Currency Accounts** 224 | 225 | To set up these transactions: 226 | 227 | 1. **Log into Online Banking**: Navigate through secure access. 228 | 2. **Select Foreign Currency Accounts**: Choose the account designated for international transactions. 229 | 3. **Initiate International Money Transfer**: Execute the payment following the outlined currency and destination selections. 230 | 4. **Confirm Exchange Rates and Fees**: Review all associated costs and the final amount in USD. 231 | 5. **Review and Finalize**: Confirm details and submit for processing. 232 | 233 | Comprehensive information and assistance are available through customer support for complex transactions. 234 | 235 | **Paying Bills Without Online Banking** 236 | 237 | To pay bills efficiently: 238 | 239 | 1. **Enroll in Online Banking**: Follow guided setup accessible on our website. This allows for seamless bill payments online. 240 | 2. **Utilize Traditional Methods**: If online banking isn’t an option, mail checks using provided address on billing statements. 241 | 3. **Visit Branch Locations**: In-person payments can be made at any branch location. 242 | 243 | For setup assistance or inquiries, contact customer support. 244 | 245 | **Obtaining Proof of Bank Account** 246 | 247 | To acquire account proof: 248 | 249 | 1. **Log into Online Banking**: Navigate the dashboard. 250 | 2. **Find Statement Vault**: Located within the 'Accounts' section. 251 | 3. **Select 'Account Statement'**: Choose the appropriate statement period. 252 | 4. **Download Statement**: Click to download in PDF format for printing or saving. 253 | 5. **Request Hard Copies if Needed**: Call customer support for assistance with mailing physical copies. 254 | 255 | These steps ensure convenient retrieval of bank statements for purposes such as loans or rental verifications. 256 | 257 | **Transferring Money from a Joint Account** 258 | 259 | For joint account transfers: 260 | 261 | 1. **Log into Online Banking**: Securely enter credentials. 262 | 2. **Select Joint Account**: Found on your accounts dashboard. 263 | 3. **Choose 'Transfer Funds'**: Decide the transfer type – either internal (between Acme Bank accounts) or external. 264 | 4. **Specify Amount and Details**: Enter the amount and destination account details. 265 | 5. **Verify Single Sign Authority**: Ensure the joint account allows changes by one signatory, if applicable. 266 | 6. **Confirm and Submit**: Review transaction, confirm details, and proceed. 267 | 268 | For accounts requiring both signatures, adjustments must be made in person at a branch. 269 | 270 | **Paying Credit Card Bills Online** 271 | 272 | To pay your credit card bills: 273 | 274 | 1. **Log into Online Banking**: Navigate with your credentials. 275 | 2. **Access Credit Card Account**: Select it from the accounts display. 276 | 3. **Click on 'Make Payment'**: Typically found near account balance. 277 | 4. **Choose Payment Amount**: Select minimum payment, statement balance, or other amounts. 278 | 5. **Select Payment Source**: Choose from linked accounts. 279 | 6. **Review and Confirm**: Confirm your payment to complete the process and receive a confirmation email. 280 | 281 | These guides offer seamless credit card management, ensuring timely bill payments. 282 | 283 | **Paying Taxes Online** 284 | 285 | For paying taxes: 286 | 287 | 1. **Log into Online Banking**: Ensure navigation to the tax section. 288 | 2. **Select 'Pay Tax' Option**: Found under the transfer or manage payments menu. 289 | 3. **Enter IRS Number and Tax Type**: Specify the IRS number and select the tax type from the dropdown. 290 | 4. **Verify Details and Amounts**: Ensure all entries are correct. 291 | 5. **Confirm and Submit**: Complete the transaction by confirming the details. 292 | 293 | Detailed guidance is available on our site, including IRS specifics and frequently asked questions. 294 | 295 | **Setting Up Online Shopping Payments** 296 | 297 | For online shopping: 298 | 299 | 1. **Visit the Retailer’s Payment Page**: Complete purchase selections and proceed to checkout. 300 | 2. **Enter Card Details**: Input your card number, expiration date, and CVV code. 301 | 3. **Ensure Security**: Verify a locked padlock symbol for secure connections, ensuring encrypted processing. 302 | 4. **Review Order Summary**: Confirm total amount and shipping details. 303 | 5. **Final Confirmation**: Submit payment and monitor account for immediate transaction approval. 304 | 305 | This process ensures a secure shopping experience online while safeguarding your financial information. 306 | 307 | ## Cards 308 | 309 | **Activating a Credit Card** 310 | 311 | To activate your credit card: 312 | 313 | **For Cards with Existing PINs** 314 | 315 | 1. **Visit Online Banking/ App**: Log in using your credentials. 316 | 2. **Select Credit Card**: Find it under the accounts section. 317 | 3. **Locate 'Additional Options**: Under 'Card Status,' select ‘Activate your Card.' 318 | 4. **In-Store Activation**: As an alternative, insert your card in-store and enter your current PIN to activate. 319 | 320 | **For New Cards or Those Without a PIN** 321 | 322 | 1. **Log into Online Banking/ App**: Enter credentials and head to 'Cards.' 323 | 2. **Select 'Set/Change PIN'**: Enter and reconfirm a new PIN. 324 | 3. **Activate Without a PIN**: Choose activation while opting to sign for payments initially, if preferred. 325 | 326 | Visit a branch or contact support if online banking isn’t available. 327 | 328 | **Blocking or Unblocking a Credit Card** 329 | 330 | To block/unblock a credit card: 331 | 332 | 1. **Access Online Banking**: Log in securely. 333 | 2. **Navigate to the Accounts Overview**: Click on the credit card needing modifications. 334 | 3. **Under 'Manage Your Card,' Select 'Block/Unblock'**: Follow the pop-up instructions for confirmation. 335 | 4. **Proceed with Changes**: Confirm to either block or unblock the card immediately. 336 | 337 | Remember, blocking prevents new transactions, though it can be undone at any time. 338 | 339 | **Ordering or Replacing Visa Debit and Debit Cards** 340 | 341 | To order or replace cards: 342 | 343 | 1. **Log into Online Banking**: Or use our mobile app. 344 | 2. **Select 'Apply & Open'**: Choose the 'Cards' option. 345 | 3. **Choose Card Type**: Opt for either Visa Debit or traditional debit cards. 346 | 4. **Enter Required Details**: Create a new PIN and link desired accounts (up to two). 347 | 5. **Confirm Information and Submit**: Ensure your postal address is up-to-date to receive your card within 1–2 weeks. 348 | 349 | For urgent needs, visit the nearest branch. 350 | 351 | **Cancelling Visa Debit and Debit Cards** 352 | 353 | To cancel cards effectively: 354 | 355 | 1. **Log into Online Banking**: Use secure credentials. 356 | 2. **Head to Settings**: Locate 'Cancel a Card' midway through the page. 357 | 3. **Select and Cancel**: Choose the correct card and confirm cancellation. 358 | 359 | This process avoids errors, ensuring accurate processing. 360 | 361 | **Setting or Changing a Card PIN** 362 | 363 | To modify or set a PIN: 364 | 365 | 1. **Log into Online Banking**: Use secure access. 366 | 2. **Select 'Cards'**: Navigate through the accounts overview. 367 | 3. **Choose 'Set/Change PIN'** for the desired card: Input and confirm any changes. 368 | 369 | When accessing different ATMs, this functionality ensures seamless transaction experiences. 370 | 371 | **Setting Up Mobile Payments** 372 | 373 | For mobile payment solutions: 374 | 375 | 1. **Download Respective Wallet Apps**: Apple Wallet for Apple users or Google Wallet for Android devices. 376 | 2. **Log into Our Mobile App**: Link your card within the services tab. 377 | 3. **Follow Built-In Instructions**: Set up wallet payment options and confirm. 378 | 4. **Complete Verification**: Ensure mobile bank communications to sync with your card. 379 | 380 | Enjoy easy and secure mobile payments whether shopping online or in-store. 381 | 382 | ## Fixed Deposits 383 | 384 | **Opening a Fixed Deposit** 385 | 386 | To open a fixed deposit: 387 | 388 | 1. **Visit Online Banking/ App**: Navigate to the ‘Investments’ section under the 'Apply & Open' menu. 389 | 2. **Select 'Fixed Deposit'**: Specify deposit parameters including term length. 390 | 3. **Enter Deposit Amount**: Amounts from $1,000 to $1 million USD can be entered. 391 | 4. **Provide Funding Source**: Select an Acme Bank account for initial funding. 392 | 5. **Review Terms and Confirm**: Submit once satisfied with selected details. 393 | 394 | Receive prompt confirmation and pre-maturity reminders from our team for further management. 395 | 396 | **Changing Maturity Instructions** 397 | 398 | Modify maturity options by: 399 | 400 | 1. **Log into Online Banking/ App**: Seek your Fixed Deposit within the accounts section. 401 | 2. **Select 'Change Maturity Instructions'**: Make selections for next steps upon maturity. 402 | 3. **Choose Desired Outcome**: Reinvestment choices and payout allocations available. 403 | 4. **Confirm and Save**: Verified options remain locked until maturity. 404 | 405 | Regular notifications keep you aware of investment progresses and maturity timelines. 406 | 407 | ## Statements 408 | 409 | **Locating, Downloading, and Printing Statements** 410 | 411 | Retrieve statements as follows: 412 | 413 | 1. **Log into Online Banking**: Or access through our app. 414 | 2. **Visit 'Statement Vault'**: Located within the transactions/account menu. 415 | 3. **Select Desired Statements**: Choose based on needed timeframe. 416 | 4. **Download PDF Files**: Easily accessible in print-friendly format. 417 | 5. **Store or Print for Records**: Secure usage as needed for financial documentation. 418 | 419 | Contact customer support for detailed physical records and additional requests. 420 | 421 | **Generating a Statement of Transaction History** 422 | 423 | Create transaction history statements by: 424 | 425 | 1. **Log into Online Banking**: Utilizing your credentials. 426 | 2. **Access Desired Accounts**: Through the accounts dashboard. 427 | 3. **Utilize 'Search/Export Options'**: Apply specified filters to highlight transactions. 428 | 4. **Complete Export**: Choose format like PDF for ease of printing. 429 | 430 | Comprehensive filters provide clarity, ensuring documentation of all relevant transactions. 431 | 432 | **Updating Statement Preferences** 433 | 434 | Modify preferences effectively by: 435 | 436 | 1. **Log into Online Banking**: Go to the settings menu. 437 | 2. **Select 'Statement Settings'**: Modify delivery methods (e.g., email or postal services). 438 | 3. **Update Email Preferences**: Enter any new addresses as necessary. 439 | 4. **Save and Confirm Changes**: Modification processes conclude with confirmation. 440 | 441 | Be aware that selecting postal service could involve additional charges; updates ensure timely delivery. 442 | 443 | ### Mobile App Download 444 | 445 | The Acme Bank mobile app is available free of charge via the App Store or Google Play, designed expressly for our valued customers. Transitioning to mobile usage offers seamless banking experiences and does not necessitate prior internet banking registration. 446 | 447 | For those new to mobile banking and seeking support, assistance with setup and ongoing banking processes is available upon request. Please complete our digital support form; expect prompt follow-up to address your needs. 448 | 449 | - Contact Us 450 | - Support Hub 451 | --------------------------------------------------------------------------------