https://github.com/nazzal5448/portfolio-bot
A micro-service RAG chatbot for my portfolio website
https://github.com/nazzal5448/portfolio-bot
ai chatbot fastapi langchain langchain-python rag
Last synced: 11 months ago
JSON representation
A micro-service RAG chatbot for my portfolio website
- Host: GitHub
- URL: https://github.com/nazzal5448/portfolio-bot
- Owner: nazzal5448
- Created: 2025-04-17T13:42:33.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-21T06:36:24.000Z (about 1 year ago)
- Last Synced: 2025-06-10T09:05:57.902Z (about 1 year ago)
- Topics: ai, chatbot, fastapi, langchain, langchain-python, rag
- Language: Python
- Homepage: https://nazzalkausar.com
- Size: 369 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ค Portfolio Bot โ AI Assistant for Nazzal Kausar
**Xel** (aka Portfolio Bot) is an AI-powered assistant that helps visitors learn about Nazzal Kausar and his services.
Built with LangChain, Groq LLMs, Hugging Face Embeddings, and FastAPI, this chatbot supports secure conversations with memory and document-based knowledge retrieval.
---
## ๐ Features
- ๐ **Token-secured API** using Bearer authentication
- ๐ง **Conversational Memory** via LangChain's buffer memory
- ๐ **RAG (Retrieval-Augmented Generation)** from uploaded PDF
- โก **Groq LLM** integration for ultra-fast inference (`mixtral` / `llama-4`)
- ๐พ FAISS vector store for fast semantic retrieval
- โ๏ธ Ready for deployment on Render / Railway
---
## ๐ ๏ธ Tech Stack
- ๐งฑ **LangChain** (chat chains, memory, retrieval)
- ๐ง **Groq** LLMs via `langchain-groq`
- ๐ฌ **Hugging Face** embeddings (`e5-small-v2`)
- ๐ง **FAISS** for vector indexing
- โก **FastAPI** backend
---
## ๐ Project Structure
```
portfolio-bot/
โโโ data/ # PDF documents
โโโ faiss_index/ # FAISS vector store (optional)
โโโ main.py # FastAPI app
โโโ langchain_setup.py # LLM, embedding, retriever, memory setup
โโโ .env # API keys
โโโ requirements.txt # All dependencies
โโโ README.md
```
---
## ๐งช Local Setup
> โก Requires Python 3.11+ (use `uv`, `venv`, or `poetry`)
### 1. Clone & install dependencies
```bash
git clone https://github.com/nazzal5448/portfolio-bot.git
cd portfolio-bot
# Option 1: Using uv (recommended)
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
```
### 2. Setup `.env`
```env
GROQ_API_KEY=your_groq_key_here
CHATBOT_API_KEY=nazzal_secret_token
```
### 3. Run the API
```bash
uv run uvicorn main:app --reload
```
Then open:
```
http://localhost:8000/docs
```
---
## ๐ Authentication
All requests must include the `Authorization` header:
```
Authorization: Bearer nazzal_secret_token
```
---
## โ๏ธ Deploying to Render (Python)
1. Create a new **Web Service** on [Render.com](https://render.com)
2. Set your Python version to `3.11`
3. Set build command:
```bash
uv pip install -r requirements.txt
```
4. Set start command:
```bash
uv run uvicorn main:app --host 0.0.0.0 --port 10000
```
5. Add environment variables in Render's dashboard:
- `GROQ_API_KEY`
- `CHATBOT_API_KEY`
---
## ๐ฌ API Example (cURL)
```bash
curl -X POST http://localhost:8000/chat \
-H "Authorization: Bearer nazzal_secret_token" \
-H "Content-Type: application/json" \
-d '{"query": "Tell me about Nazzal\'s services."}'
```
---
## ๐ Future Features
- ๐พ Multi-user memory via Redis
- ๐ Async background task queues
- ๐ง Skill-based tool calling (RAG + n8n)
---
## ๐งโ๐ป About Nazzal
This project is built by [Nazzal Kausar](https://nazzalkausar.com), an aspiring AI Engineer focused on RAG systems, GenAI apps, and workflow automation.
---
## ๐ License
MIT โ feel free to fork, reuse, and improve!
```