Sami-Hached/Tanit-bot

Python

0

9 commits

updated Jun 16, 2026

See the code

README

Tanit Bot

An Arabic-language RAG (Retrieval-Augmented Generation) chatbot built with FastAPI, Streamlit, ChromaDB, and Google Gemini.

Prerequisites

  • Python 3.13+
  • uv package manager
  • A Google API key with access to the Gemini API

Setup

1. Clone the repo

git clone https://github.com/Sami-Hached/Tanit-bot
cd Tanit-bot

2. Install dependencies

uv sync

3. Configure environment variables

Create a .env file in the project root:

cp .env.example .env

Then open .env and fill in your API key:

GOOGLE_API_KEY=your_google_api_key_here

4. Add your documents

Place .txt files (UTF-8 encoded) in the data/ directory. These are the documents the RAG system will index and query against.

If a chroma_db/ directory already exists, the index will be loaded from disk and this step can be skipped.

Running locally

You need two terminals — one for the backend API and one for the frontend.

Terminal 1 — Start the FastAPI backend

uv run uvicorn main:app --reload

The API will be available at http://localhost:8000.

Terminal 2 — Start the Streamlit frontend

uv run streamlit run app.py

The UI will open automatically in your browser at http://localhost:8501.

Usage

  1. Open the Streamlit UI in your browser.
  2. Type a question in Arabic in the text area.
  3. Click إرسال (Send).
  4. The system retrieves relevant context from your documents and returns an answer generated by Gemini.

Project structure

.
├── app.py          # Streamlit frontend
├── main.py         # FastAPI app entry point
├── endpoints.py    # API route definitions
├── rag.py          # RAG pipeline (embeddings, ChromaDB, Gemini)
├── data/           # Source documents (.txt files)
├── chroma_db/      # Persisted vector index (auto-generated)
└── modal-code/     # Modal.com deployment scripts (optional)

Sami-Hached/Tanit-bot

Python

0

9 commits

updated Jun 16, 2026

See the code

README

Tanit Bot

An Arabic-language RAG (Retrieval-Augmented Generation) chatbot built with FastAPI, Streamlit, ChromaDB, and Google Gemini.

Prerequisites

  • Python 3.13+
  • uv package manager
  • A Google API key with access to the Gemini API

Setup

1. Clone the repo

git clone https://github.com/Sami-Hached/Tanit-bot
cd Tanit-bot

2. Install dependencies

uv sync

3. Configure environment variables

Create a .env file in the project root:

cp .env.example .env

Then open .env and fill in your API key:

GOOGLE_API_KEY=your_google_api_key_here

4. Add your documents

Place .txt files (UTF-8 encoded) in the data/ directory. These are the documents the RAG system will index and query against.

If a chroma_db/ directory already exists, the index will be loaded from disk and this step can be skipped.

Running locally

You need two terminals — one for the backend API and one for the frontend.

Terminal 1 — Start the FastAPI backend

uv run uvicorn main:app --reload

The API will be available at http://localhost:8000.

Terminal 2 — Start the Streamlit frontend

uv run streamlit run app.py

The UI will open automatically in your browser at http://localhost:8501.

Usage

  1. Open the Streamlit UI in your browser.
  2. Type a question in Arabic in the text area.
  3. Click إرسال (Send).
  4. The system retrieves relevant context from your documents and returns an answer generated by Gemini.

Project structure

.
├── app.py          # Streamlit frontend
├── main.py         # FastAPI app entry point
├── endpoints.py    # API route definitions
├── rag.py          # RAG pipeline (embeddings, ChromaDB, Gemini)
├── data/           # Source documents (.txt files)
├── chroma_db/      # Persisted vector index (auto-generated)
└── modal-code/     # Modal.com deployment scripts (optional)