This is a simple RAG demo for a bank's customer support bot, for use with the Multinear platform.
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.
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.
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.
-
Clone the Repository
git clone https://github.com/multinear-demo/demo-bank-support-lc-py cd demo-bank-support-lc-py
-
Configure Environment Variables
Create a
.env
file in the root directory and add your OpenAI API key:echo "OPENAI_API_KEY=your-api-key-here" > .env
uv
is the fastest way to run the application with minimal setup.
# Setup Environment
uv sync
# Start the Application
uv run main.py
pyenv
allows you to manage multiple Python versions and virtual environments.
# Setup Environment
pyenv install 3.9
pyenv virtualenv 3.9 demo-bank
pyenv local demo-bank
pip install -r requirements.txt
# Start the Application
python main.py
# Setup Environment
python3 -m venv .venv
source .venv/bin/activate
# On Windows:
# .\.venv\Scripts\activate
pip install -r requirements.txt
# Start the Application
python3 main.py
Open http://127.0.0.1:8080 to see the application.
Try asking different questions to see how the bot handles them:
- Hi there!
- How do I reset my password?
- What's the current exchange rate?
- Where is the closest coffee shop?
Enable LLM tracing with Arize Phoenix in the .env
file (see .env.example and tracing.py).
# Using uv
uv run --with jupyter jupyter lab notebook.ipynb
# Using pyenv / virtualenv
pip install jupyter
jupyter lab notebook.ipynb
Key system components:
- RAG Engine for document ingestion, indexing, and query processing using the
LangChain
library andOpenAI
model. - API Server with
FastAPI
endpoints for chat, reindexing, and session management. - HTML & React JS frontend.
- Dataset for the RAG engine.
- Experiment Runner entry point for
Multinear
platform. - Configuration for evaluation tasks.
The platform is designed to facilitate the development and evaluation of GenAI applications through systematic experimentation.
-
Define Tasks
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. -
Execute Experiments
Run
Multinear
platform.# Using uv uv run multinear web_dev # Using pyenv / virtualenv multinear web_dev
Open http://127.0.0.1:8000 and start experimenting.
This project is licensed under the MIT License.
Built by Multinear.