PDF X is a lightweight Telegram bot that lets users upload PDF files and chat with them using AI. It's a personal project built just for fun (and usefulness!) β with a sprinkle of weird and premium ideas. π¬β¨
- π§ AI-powered chat with PDF files
- π₯ Upload and process PDF documents
- β‘ Telegram Bot Integration
- π Premium Plan (1 Birr) with:
- Increased file upload limit (from 1MB to 5MB)
- Up to 3 PDFs instead of 1
- Node.js + Express β REST API
- MongoDB + Mongoose β Database
- PHP β Handles Telegram bot webhook
- pdf-parse β Extracts text from PDFs
- Custom Chunking β Splits and stores text for retrieval
- Gemini AI β For AI answers from chunks
βββ πpdf-x
βββ πbot
βββ ai.php
βββ file-upload.php
βββ index.php
βββ πserver
βββ .env
βββ .gitignore
βββ πcontroller
βββ file.controller.js
βββ payment.controller.js
βββ user.controller.js
βββ πmodel
βββ chunk.model.js
βββ payment.model.js
βββ pdf.model.js
βββ user.model.js
βββ package-lock.json
βββ package.json
βββ πrouter
βββ file_router.js
βββ payment_router.js
βββ user_router.js
βββ server.js
βββ πutils
βββ chunkText.js
βββ pdfParse.js
βββ .gitignore
- User uploads PDF via Telegram bot.
- Bot sends file to backend API.
- PDF is parsed and chunked.
- Chunks are saved to MongoDB and linked to the user.
- User chats with the bot β questions are answered by matching chunk + AI.
- Premium users get extra limits and features.
This is just a tiny plan (1 birr) to test fun features and support the project.
| Feature | Free Plan | Premium Plan |
|---|---|---|
| Max file size | 1 MB | 5 MB |
| PDF upload limit | 1 PDF | 3 PDFs |
- Project hosted on free services β performance may vary.
- AI responses are limited in size due to Telegram restrictions.
- Markdown formatting is supported (up to 4096 characters per message).
Created by yonitad2404@gmail.com
Feel free to message for questions or ideas.
You can try the bot using Telegram at:
π t.me/pdf_x_bot