DocuMind is a full-stack, document-grounded FAQ assistant. Upload a UTF-8 .txt document, ask a question, and receive an answer generated from the most relevant parts of that document -- along with the source chunks used to create it.
- Upload and index a
.txtknowledge document - Generate grounded answers with a Groq-hosted LLM
- Retrieve relevant document chunks with semantic search
- Show the source chunks used for every answer
- Save conversation history and uploaded-document metadata in Supabase/PostgreSQL
- View recent questions, documents, and the active knowledge source in the UI
- Use FAISS for vector search, with a NumPy fallback for Windows development
TXT document -> chunking -> embeddings -> vector search -> relevant chunks -> Groq LLM -> answer + sources
- A
.txtdocument is uploaded through the Next.js interface. - The backend splits it into overlapping chunks and generates embeddings with
sentence-transformers. - FAISS (or the Windows NumPy fallback) identifies the chunks most relevant to the question.
- Those chunks are sent to the configured Groq model with the user's question.
- The answer and its sources are returned to the UI and saved to PostgreSQL.
Each new upload replaces the currently active knowledge document, keeping answers tied to the latest file.
| Layer | Tools |
|---|---|
| Frontend | Next.js, React, Tailwind CSS |
| Backend | FastAPI, Uvicorn |
| RAG | Sentence Transformers, FAISS, NumPy |
| LLM | Groq API (configurable model) |
| Database | Supabase PostgreSQL |
.
|- faq-bot/ # FastAPI backend, RAG pipeline, database schema
|- frontend/ # Next.js chat interface
|- backend_faq-bot.md
`- README.md
- Python 3.10+
- Node.js 18+
- A Groq API key
- A Supabase PostgreSQL project and connection string
git clone https://github.com/Uv0503/DocuMind-RAG-Based-FAQ-Assistant.git
cd DocuMind-RAG-Based-FAQ-AssistantCreate faq-bot/.env:
DATABASE_URL=your_supabase_postgres_connection_string
GROQ_API_KEY=your_groq_api_key
# Optional; defaults to openai/gpt-oss-20b
GROQ_MODEL=openai/gpt-oss-20bInstall and start the API:
cd faq-bot
python -m venv venvWindows PowerShell:
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python -m uvicorn main:app --host 0.0.0.0 --port 8888The API will be available at http://localhost:8888, and interactive API documentation is available at http://localhost:8888/docs.
In the Supabase SQL Editor, run the contents of faq-bot/schema.sql.
Create frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8888In a second terminal:
cd frontend
npm install
npm run devOpen http://localhost:3000, upload a .txt file, and start asking questions.
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
API welcome message |
GET |
/health/db |
Database health check |
GET |
/knowledge |
Active source and indexed chunk count |
POST |
/upload |
Upload and index a .txt document |
POST |
/ask |
Ask a question about the active document |
GET |
/conversations |
Saved question-and-answer history |
GET |
/documents |
Uploaded document history |
Example question request:
curl -X POST http://localhost:8888/ask \
-H "Content-Type: application/json" \
-d "{\"question\":\"What does this document say about pricing?\"}"- Keep
GROQ_API_KEYandDATABASE_URLin local.envfiles only. - Do not commit
.env,.env.local, virtual environments,node_modules, or uploaded documents. - The repository
.gitignorealready excludes these local and sensitive files.
- Support PDF, DOCX, and multiple-document uploads
- Add user authentication and per-user document libraries
- Store embeddings in a persistent vector database
- Add citations that include document names and page/section information
Aman Singh Chauhan GitHub: @Uv0503