An open API service indexing awesome lists of open source software.

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

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!
```