{"id":30208768,"url":"https://github.com/yash-learnerr/pdf-chat-assistant","last_synced_at":"2026-04-14T06:33:35.859Z","repository":{"id":307597223,"uuid":"1029831898","full_name":"yash-learnerr/pdf-chat-assistant","owner":"yash-learnerr","description":"Build a powerful PDF Chat Assistant using Node.js, LangChain, and Google Gemini. Upload PDFs, extract content, and interact with them using natural language queries powered by Gemini LLM. Ideal for document Q\u0026A, contract analysis, resume review, and more.","archived":false,"fork":false,"pushed_at":"2025-08-01T03:44:14.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-13T18:29:51.317Z","etag":null,"topics":["ai-chatbot","ai-pdf-reader","document-ai","document-qa","gemini-api","google-gemini","google-llm","langchain","langchain-nodejs","llm-backend","nodejs-llm","openai-alternative","pdf-chat-assistant","pdf-chat-node","pdf-chatbot","pdf-question-answering","rag","semantic-search"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yash-learnerr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-31T16:36:57.000Z","updated_at":"2025-08-01T03:44:17.000Z","dependencies_parsed_at":"2025-08-01T05:30:24.704Z","dependency_job_id":"90a94a49-5fd0-4e60-a310-e3d951c218f7","html_url":"https://github.com/yash-learnerr/pdf-chat-assistant","commit_stats":null,"previous_names":["yash-learnerr/pdf-chat-assistant"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yash-learnerr/pdf-chat-assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yash-learnerr%2Fpdf-chat-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yash-learnerr%2Fpdf-chat-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yash-learnerr%2Fpdf-chat-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yash-learnerr%2Fpdf-chat-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yash-learnerr","download_url":"https://codeload.github.com/yash-learnerr/pdf-chat-assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yash-learnerr%2Fpdf-chat-assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31785677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-chatbot","ai-pdf-reader","document-ai","document-qa","gemini-api","google-gemini","google-llm","langchain","langchain-nodejs","llm-backend","nodejs-llm","openai-alternative","pdf-chat-assistant","pdf-chat-node","pdf-chatbot","pdf-question-answering","rag","semantic-search"],"created_at":"2025-08-13T18:02:22.286Z","updated_at":"2026-04-14T06:33:35.854Z","avatar_url":"https://github.com/yash-learnerr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📄 PDF Chat Assistant using Node.js + LangChain + Google Gemini\r\n\r\n**Chat with your PDFs using AI!** This open-source project lets you upload any PDF file and ask natural language questions about its content using **Google Gemini LLM**, **LangChain**, and **Node.js**.\r\n\r\n\u003e Ideal for document analysis, contract review, resume Q\u0026A, and building AI-powered document search systems.\r\n\r\n---\r\n\r\n## ⭐ Features\r\n\r\n- Upload PDF files and parse content.\r\n- Chunk and embed text using **Gemini Embeddings**.\r\n- Store embeddings in-memory using LangChain’s `MemoryVectorStore`.\r\n- Perform similarity search on user questions.\r\n- Query **Google Gemini** to generate accurate contextual responses.\r\n\r\n\r\n## 🚀 **Powered by**: \r\n\r\n`Google Gemini`, `LangChain`, `FAISS`, `Express.js`, and `pdf-parse`\r\n\r\n## 📚 **Keywords**: \r\n\r\n`PDF Chat Assistant`, `LangChain Node.js`, `Gemini LLM`, `Document Q\u0026A`, `RAG`, `AI Chatbot`, `PDF Parser`, `Semantic Search`\r\n\r\n---\r\n\r\n## 🧰 Tech Stack\r\n\r\n| Component       | Technology                  |\r\n|----------------|-----------------------------|\r\n| Backend         | Node.js (Express)           |\r\n| AI/LLM API      | Google Gemini (via LangChain)|\r\n| PDF Parsing     | `pdf-parse`                 |\r\n| Embedding Store | LangChain Memory Vector DB  |\r\n| Chunking        | Manual with configurable size |\r\n\r\n---\r\n\r\n## 🛠️ Installation\r\n\r\n```bash\r\ngit clone https://github.com/your-username/pdf-chat-gemini.git\r\ncd pdf-chat-gemini\r\nnpm install\r\n\r\n```\r\n\r\n## 🔐 Environment Variables\r\n\r\nCreate a .env file in the root:\r\n\r\n```\r\nPORT=3000\r\nGEMINI_API_KEY=your_google_gemini_api_key\r\n```\r\n\r\n##### ✅ You need access to Google AI Studio or Vertex AI to get your Gemini API key.\r\n\r\n## 📦 Run the Project\r\n\r\n```\r\nnode app.js\r\n```\r\n\r\n## 📬 API Endpoints\r\n\r\n### 1. Upload PDF\r\n\r\n```\r\nPOST /api/chat/upload\r\nContent-Type: multipart/form-data\r\nForm field: pdf (upload a .pdf file)\r\n```\r\n\r\n- Parses PDF\r\n- Extracts text\r\n- Chunks and embeds it into memory\r\n\r\n### 2. Ask a Question\r\n\r\n```\r\nPOST /api/chat/ask\r\nContent-Type: application/json\r\n\r\n{\r\n  \"question\": \"What is this PDF about?\"\r\n}\r\n```\r\n\r\n- Returns answer based on the most relevant chunks from the uploaded PDF\r\n\r\n#\r\n\r\n## 📁 Project Structure\r\n\r\n```\r\npdf-chat-assistant/\r\n├── app.js\r\n├── .env\r\n├── controllers/\r\n│   └── chatController.js\r\n├── routes/\r\n│   └── chatRoutes.js\r\n├── services/\r\n│   ├── pdfService.js\r\n│   ├── embeddingService.js\r\n│   └── geminiService.js\r\n├── utils/\r\n│   └── chunkText.js\r\n├── uploads/\r\n└── vector-store/\r\n```\r\n\r\n##  🧠 How It Works\r\n\r\n- Upload: PDF gets parsed and split into chunks.\r\n- Embed: Each chunk is turned into a vector using Gemini Embeddings.\r\n- Store: Vectors are stored in a temporary in-memory vector store.\r\n- Query: User asks a question → similar chunks are retrieved.\r\n- Answer: Gemini responds using those chunks as context.\r\n\r\n## 🧪 Example Usage\r\n\r\nUse Postman or Insomnia to:\r\n\r\n1. Upload a PDF to `/api/chat/upload`\r\n\r\n2. Then POST to `/api/chat/ask` with your question\r\n\r\n## Demo Link\r\n\r\n[Demo](https://jam.dev/c/b569bc2b-6417-49ad-87ce-5672bbc63a22)\r\n\r\n## 📄 License\r\nMIT License\r\n\r\n## 🙌 Acknowledgements\r\nLangChain\r\n\r\nGoogle Generative AI (Gemini)\r\n\r\npdf-parse\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyash-learnerr%2Fpdf-chat-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyash-learnerr%2Fpdf-chat-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyash-learnerr%2Fpdf-chat-assistant/lists"}