Skip to content

Tanmoy-Parvez/docpilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 RAG File Chat API

A simple RAG-based backend built with Node.js, Express, MongoDB, and OpenAI. Upload files and ask questions from them using AI.


🚀 Features

  • Upload PDF files
  • Extract and chunk text
  • Generate embeddings (OpenAI)
  • Store in MongoDB
  • Ask questions using RAG
  • Get AI-generated answers

🛠️ Tech Stack

  • Node.js
  • Express.js
  • MongoDB + Mongoose
  • OpenAI API
  • Multer
  • PDF-Parse

📁 Project Flow

Upload → Extract Text → Chunk → Embed → Store in DB
Ask Question → Embed Query → Retrieve Chunks → AI Response


⚙️ Setup

pnpm install
pnpm dev

🔐 Environment Variables

PORT=8080
MONGO_URI=your_mongodb_uri
OPENROUTER_API_KEY=your_openrouter_api_key

📡 API

Upload File

POST /api/v1/upload

Ask Question

POST /api/v1/ask

🧠 Concept

RAG = Retrieval + Generation We retrieve relevant text from documents and pass it to AI for answering.

About

AI-powered document Q&A system using RAG

Topics

Resources

Stars

Watchers

Forks

Contributors