An AI-powered document question-answering system built with Node.js, Next.js, and OpenAI. Upload PDFs → system extracts + embeds content → stores vectors in Postgres (pgvector) → answers queries with GPT grounded in document context.

- 📂 Upload PDFs via frontend
- 🔄 Background indexing with BullMQ + Redis
- 🧩 Text chunking & OpenAI embeddings
- 🗄 Vector search using Postgres + pgvector
- 🤖 Context-aware answers with GPT-4o-mini
- 🌐 Next.js + Material UI frontend for a polished UI
- 🐳 Dockerized for easy deployment
git clone https://github.com/abhicode/document-workflow-assistant.git
cd document-workflow-assistant
Create .env
files at the root:
# Redis
REDIS_URL=redis://redis:6379
# OpenAI
OPENAI_API_KEY=sk-proj-***
EMBEDDING_MODEL=text-embedding-3-small
EMBEDDING_DIM=1536
TOP_K=5
# Server
PORT=8080
FRONTEND_URL=http://localhost:3000
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=vector_db
DATABASE_URL=postgres://postgres:postgres@db:5432/vector_db
docker-compose up --build
Frontend → http://localhost:3000
Backend API → http://localhost:8080
- Upload a PDF from the frontend.
- Wait for it to be indexed (processed by a worker).
- Enter a question → system retrieves relevant chunks → GPT answers with context + sources.
- Backend:
Node.js
,Express
,BullMQ
,Redis
- Database:
PostgreSQL
+pgvector
- Workers: PDF parsing,
OpenAI
embeddings - Frontend:
Next.js
(TypeScript
) +Material UI
- AI Models:
OpenAI
embeddings +GPT-4o-mini
- Local: Docker Compose (frontend + backend + redis + postgres)
- Cloud: Easily deployable to AWS, GCP, Azure, Railway, or Render