Create a production-ready multilingual chatbot for the Rental Management System using Vector Database + Local Embeddings for knowledge retrieval, supporting Amharic, English, and Afan Oromo with dynamic language switching.
---
title: Multilingual Chatbot
emoji: 💻
colorFrom: blue
colorTo: green
sdk: docker
sdk_version: '1.0'
app_file: app.main:app
pinned: true
short_description: a multilingual chatbot backend using FastAPI, LangGraph
---
# Multilingual Chatbot Backend
This project implements a multilingual chatbot backend using FastAPI, LangGraph, Google Gemini 2.0 Flash, and FAISS. It provides a REST API to answer user queries in English, Amharic, and Afaan Oromo, leveraging a knowledge base derived from various documents.
## Features
* **Multilingual Support:** Auto-detects query language and responds in the same language (English, Amharic, Afaan Oromo).
* **Knowledge Base:** Answers based on `translation.json`, `translation copy.json`, `translation copy 2.json`, `Faq.txt`, and `Final project 1-4 final.docx`.
* **FastAPI:** High-performance web framework.
* **LangGraph:** For building the RAG (Retrieval-Augmented Generation) pipeline.
* **Google Gemini 2.0 Flash:** For powerful and multilingual text generation.
* **FAISS:** Efficient similarity search for retrieving relevant information from the knowledge base.
* **Render Free Tier Optimized:** Designed for deployment on Render's free tier with in-memory FAISS and minimal resource usage.
* **Comprehensive Testing:** Includes unit tests with `pytest`.
## Tech Stack
* **Backend:** Python 3.12.3
* **Web Framework:** FastAPI
* **RAG Framework:** LangGraph
* **LLM:** Google Gemini 2.0 Flash
* **Vector Store:** FAISS (in-memory, CPU)
* **Embeddings:** `sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2`
* **Dependency Management:** `pip` with `requirements.txt`
## Setup and Local Development
### 1. Clone the Repository
```bash
git clone
cd rent-mag-chatBot
```
### 2. Create a Virtual Environment
```bash
python3.12 -m venv .venv
source .venv/bin/activate
```
### 3. Install Dependencies
```bash
pip install -r requirements.txt
```
### 4. Configure Google Gemini API Key
Obtain a Google Gemi …