ContextIQ is a sleek, AI-powered chatbot that allows you to chat with your files and URLs using Retrieval-Augmented Generation (RAG). With a responsive UI, document upload capabilities, and conversational memory, ContextIQ helps you extract contextually relevant answers from any source you provide.
🔍 Upload files, add URLs, and let the bot fetch accurate answers from your custom context.
- 🧠 Conversational memory with multi-turn chat history
- 📄 PDF, DOCX, and TXT document upload support
- 🌐 URL ingestion with BeautifulSoup scraping
- 🔎 ChromaDB vector search with OpenAI embeddings
- 💬 Chatbot-style frontend UI (typing effect + alignment)
- ⚡ Powered by FastAPI backend and React + Tailwind frontend
flowchart TD
A[User Input: Chat / Upload / URL] --> B[React Frontend]
B --> C[FastAPI Backend]
C --> D1[Document Upload]
C --> D2[URL Scraping]
D1 --> E1[Parse and Chunk Documents]
D2 --> E2[Extract Web Content]
E1 --> F[Generate Embeddings via OpenAI]
E2 --> F
F --> G[Store in Chroma Vector DB]
A --> H[Retrieve Relevant Context via RAG]
G --> H
H --> I[Generate Answer]
I --> J[Return Answer to Frontend]
J --> K[Display Response]
git clone https://github.com/het0814/ContextIQ-rag-chatbot.git
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install Python dependencies
pip install -r requirements.txt
# Add your OpenAI key
export OPENAI_API_KEY=your-api-key
uvicorn main:app --reloadcd ../frontend
npm install
npm run devPOST /add-url
{ "url": "https://www.bbc.com/news" }POST /upload-document
(file = .pdf / .docx / .txt)POST /generate-response
{ "query": "What’s the latest news?" }| Layer | Tech Used |
|---|---|
| Frontend | React, Tailwind CSS, Framer Motion |
| Backend | FastAPI, Python |
| LLM | OpenAI GPT-4o (via LangChain) |
| Embeddings | OpenAI Embeddings |
| Vector DB | ChromaDB |
| Memory | ConversationBufferMemory |
- Markdown rendering in responses
- Source highlighting per answer
- Multi-user chat sessions
- Dark mode toggle
- Response citation UI
Contributions are welcome!
To contribute:
- Fork this repo
- Create a branch (
git checkout -b feature/add-citation) - Commit changes
- Push (
git push origin feature/add-citation) - Open a pull request 🚀
This project is under the MIT License. Feel free to use it in personal or commercial projects.
See LICENSE for full terms.
