Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocMind – AI Document Q&A App (RAG)

DocMind lets you upload documents and ask questions based on information available in youd document. Answers are generated by an AI model, and cite exact source in your document.

Live demo:

How it works

  1. Upload a PDF or text document.
  2. The document is split into overlapping chunks and converted into vector embeddings.
  3. Ask a question — DocMind finds the most relevant chunks using vector search, then generates an answer, citing its sources.

Tech Stack

  • Backend: Node.js, Express, TypeScript
  • Database & Vector Search: MongoDB Atlas (Atlas Vector Search)
  • AI: Google Gemini (embeddings + chat generation)
  • Frontend: HTML, CSS, vanilla JavaScript
  • File Processing: Multer (uploads), pdf-parse (PDF text extraction)

Features

  • Upload PDF or plain text documents: - .pdf .txt
  • Automatic chunking and embedding generation

Setup

Prerequisites

  • Node.js 18+
  • A MongoDB Atlas account (free) with a Vector Search index configured
  • A Google Gemini API key (free, from Google AI Studio)

Installation

git clone https://github.com/vikasranax/docmind.git
cd docmind
npm install

Environment Variables

Create a .env file in the root directory:

PORT=3000

MONGODB_URI=your_mongodb_connection_string

GEMINI_API_KEY=your_gemini_api_key

MongoDB Vector Search Index

Create a vector search index named vector_index on the docmind.documents collection:

{
  "fields": [
    {
      "type": "vector",
      "path": "embedding",
      "numDimensions": 768,
      "similarity": "cosine"
    }
  ]
}

Run locally

npm run dev

Visit http://localhost:3000.

License

MIT

About

DocMind lets you upload documents and ask questions based on information available in your document. Answers are generated by an AI model, and cite exact source in your document.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages