A bilingual (English & Yoruba) hymn search bot using embeddings, FAISS, Telegram and gradio for quick lyric-based lookup.
# πΆ ChoralMind β Hymn Search Bot
ChoralMind is a Telegram bot that helps you search and retrieve **English** and **Yoruba** hymns using semantic search with FAISS embeddings.
Try here: ChoralMind or here: ChoralMind
## π Features
- Search hymns in **English** and **Yoruba** by typing any line from the hymn.
- Retrieves relevant hymns using **Google Generative AI embeddings** (`models/text-embedding-004`).
- Supports multilingual hymn databases with separate FAISS indexes.
- Interactive **language selection** via Telegram inline buttons.
- Logs all bot activity for debugging and analytics.
- Maintains `hymn_id` mapping so results link back to the full hymn text.
## π Tech Stack
- **Python 3.12**
- python-telegram-bot
- LangChain for text chunking and FAISS vector storage
- Google Generative AI API for embeddings
- FAISS for similarity search
- pdfplumber for PDF hymn extraction
- Gradio for interactive web interface
## π Project Structure
```
βββ docs/ # hymns PDF source
βββ data/ # Extracted hymns in JSON
βββ embeddings/ # embedding scripts and FAISS Index
βββ retriever/
β βββ retriever.py # HymnRetriever class
βββ llm/
β βββ generate_response.py # Formats retrieved results into Telegram reply
βββ telegran_bot # Telegram bot entrypoint
β βββ bot.py
βββ main.py # main program
βββ requirements.txt # Python dependencies
|ββ gradio_app.py # interactive web interface
```
## βοΈ Installation
**Clone the repository**
```bash
git clone
github.com
cd ChoralMind
```
## π¦ Create and Activate a Virtual Environment
```bash
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
```
## π₯ Install Dependencies
```bash
pip install -r requirements.txt
```
## βοΈ Set Up Environment Variables
Create a `.env` file:
```ini
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
GEMINI_API_KEY=your_google_generative_ai_key
```
---
## π β¦