# πͺπΉ Amharic QA Chatbot
An AI chatbot that answers questions in **Amharic** about Ethiopian history, universities, government services, agriculture, health, and more.
Built with: Hugging Face Transformers Β· FastAPI Β· Streamlit Β· SQLite
---
## Quick Start
### Step 1 β Install dependencies (one time only)
```cmd
venv\Scripts\pip.exe install -r requirements.txt
```
Or with npm style:
```cmd
npm run install
```
---
### Step 2 β Start everything
**Option A β Double-click (easiest)**
Double-click **`start.bat`** in the project folder.
It opens two terminal windows and launches both servers automatically.
**Option B β npm style commands**
```cmd
npm start
```
or
```cmd
npm run dev
```
**Option C β Run each server manually**
Terminal 1 (API):
```cmd
npm run api
```
Terminal 2 (UI):
```cmd
npm run ui
```
---
### Step 3 β Open in browser
| What | URL |
|------|-----|
| π¬ Chat UI |
localhost |
| π API Docs |
localhost |
---
## All Commands
| Command | What it does |
|---------|-------------|
| `npm start` | Starts API + UI together |
| `npm run dev` | Same as start |
| `npm run api` | Starts FastAPI backend only (port 8000) |
| `npm run ui` | Starts Streamlit frontend only (port 8501) |
| `npm run install` | Installs Python dependencies |
Or use the `.bat` shortcuts:
| File | What it does |
|------|-------------|
| `start.bat` | Starts both API and UI |
| `run_api.bat` | Starts API only |
| `run_ui.bat` | Starts UI only |
---
## Project Structure
```
Amahric chatbot/
βββ app/
β βββ database.py # SQLite β chats, feedback, qa_pairs
β βββ embadding.py # Sentence embedding engine (multilingual)
β βββ inference.py # Cosine similarity QA logic
β βββ main.py # FastAPI routes
βββ data/
β βββ qa_dataset.csv # Amharic Q&A knowledge base (60+ pairs)
βββ .streamlit/
β βββ config.toml # Streamlit server config
βββ streamlit_app.py # Chat UI
βββ start.bat # Start everything (doubl β¦