Skip to content

nithu0035/AI-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🤖 AI Chatbot

AI chatbot with semantic search (RAG), voice transcription, text-to-speech, user authentication, and a React frontend — powered by OpenAI and FastAPI.

Features

  • 💬 AI Chat — Powered by OpenAI GPT (gpt-3.5-turbo) with personality modes: Friendly, Professional, Sarcastic, Motivational
  • 🔍 Semantic RAG — ChromaDB-backed knowledge base with semantic search using OpenAI embeddings
  • 🎙️ Voice Input — Whisper-based audio transcription endpoint
  • 🔊 Text-to-Speech — gTTS integration for audio responses
  • 🔐 Authentication — JWT-based user login with SQLite storage
  • 📊 Usage Tracking — Per-user token and cost accounting
  • 🐳 Docker Ready — Full Docker Compose setup for local development
  • CI/CD — GitHub Actions workflow with integration tests

Tech Stack

Layer Technology
Frontend React 18, Axios
Backend Python, FastAPI, Uvicorn
AI OpenAI GPT, Whisper, Embeddings
Vector DB ChromaDB
Auth JWT (PyJWT)
Database SQLite
TTS gTTS
Deployment Docker, Render, Hugging Face

Project Structure

ai-chatbot/
├── backend/
│   ├── app.py              # FastAPI backend (chat, auth, RAG, TTS, Whisper)
│   ├── requirements.txt    # Python dependencies
│   └── Dockerfile
├── frontend-react/
│   ├── src/
│   │   ├── App.js          # React UI (chat, auth, KB upload, audio)
│   │   └── index.css
│   └── package.json
├── tests/
│   ├── integration_api_test.py
│   └── test_integration_endpoints.py
├── deploy/
│   ├── docker_deploy.md
│   ├── render.md
│   └── hf_instructions.md
├── docker-compose.yml
└── README.md

Setup & Installation

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • OpenAI API Key

1. Clone the repository

git clone https://github.com/nithu0035/AI-chatbot.git
cd AI-chatbot/ai-chatbot

2. Backend Setup

cd backend
pip install -r requirements.txt

Create a .env file:

OPENAI_API_KEY=your_openai_api_key_here
JWT_SECRET=your_secret_key_here

Start the backend:

uvicorn app:app --host 0.0.0.0 --port 8000

3. Frontend Setup

cd frontend-react
npm install
npm start

Open your browser at http://localhost:3000


🐳 Run with Docker

# From the ai-chatbot/ directory
OPENAI_API_KEY=your_key JWT_SECRET=your_secret docker-compose up --build
Service URL
Frontend http://localhost:3000
Backend API http://localhost:8000

API Endpoints

Method Endpoint Description
GET / Health check
POST /register Register a new user
POST /login Login and get JWT token
POST /chat Send a message and get AI reply
POST /transcribe Upload audio for Whisper transcription
POST /tts Convert text to speech
POST /upload-kb Upload document to knowledge base

Running Tests

cd tests
pip install pytest httpx
pytest integration_api_test.py

Deployment

See the deploy/ folder for step-by-step guides:

  • Dockerdeploy/docker_deploy.md
  • Renderdeploy/render.md
  • Hugging Face Spacesdeploy/hf_instructions.md

📄 License

MIT

👤 Author

Gudipatoju Nitesh
GitHub: @nithu0035

About

An advanced AI chatbot using GPT, ChromaDB, Whisper, and TTS. Supports multiple personalities, KB uploads, chat, voice transcription, and audio responses. Full-stack React frontend with secure auth, usage tracking, and Docker deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors