A revolutionary PDF chatbot that uses no vector embeddings or traditional RAG. Instead, it leverages Large Language Models for intelligent document selection and page relevance detection, providing a completely stateless and privacy-first experience.
Traditional PDF chatbots convert documents into vector embeddings for semantic search. This approach:
- โ Requires expensive vector databases
- โ Needs pre-processing and indexing
- โ Stores document data on servers
- โ Loses context and nuance in embeddings
Our Vectorless approach:
- โ Uses LLM reasoning instead of vectors
- โ Processes documents in real-time
- โ Completely stateless - no server storage
- โ Preserves full document context
- โ Privacy-first - documents stay in your browser
graph TD
A[๐ User uploads PDFs] --> B[๐ง LLM Document Selection]
B --> C[๐ฏ LLM Page Relevance Detection]
C --> D[๐ฌ Contextual Answer Generation]
B --> B1[Analyzes collection description<br/>+ document filenames<br/>+ user question]
C --> C1[Examines actual page content<br/>from selected documents<br/>in parallel processing]
D --> D1[Generates comprehensive answer<br/>with proper citations]
- LLM reads your collection description and document filenames
- Intelligently selects which documents are likely to contain relevant information
- No embeddings needed - uses reasoning and context understanding
- LLM examines actual page content from selected documents
- Processes multiple documents in parallel for speed
- Identifies the most relevant pages based on question context
- Uses only the relevant pages to generate accurate answers
- Maintains full document context and nuance
- Provides proper citations and references
- Zero Server Storage: Documents processed and stored entirely in your browser
- LocalStorage Persistence: Your documents persist across browser sessions
- No Data Leakage: Document content never persists on servers
- Serverless-Friendly: Perfect for Vercel/Netlify deployments
- Up to 100 PDF documents per session
- Chunked Upload System: Automatically handles large file sets (>4.5MB)
- 4.5MB per file limit - processes substantial documents
- Real-time Processing: No pre-indexing required
- Multi-Model Support: GPT-4, GPT-5-mini, and more
- Parallel Processing: Multiple documents analyzed simultaneously
- Context Preservation: Full document context maintained throughout
- Dynamic Descriptions: Edit collection descriptions anytime
- Responsive Design: Works on desktop and mobile
- Real-time Progress: Visual feedback during uploads and processing
- GitHub Integration: Easy access to source code
- Error Handling: Comprehensive error messages and recovery
- Next.js 15: React framework with App Router
- TypeScript: Type safety and better development experience
- Tailwind CSS: Modern utility-first styling
- Lucide React: Beautiful, consistent icons
- Python Functions: Serverless API endpoints
- PyPDF2: Reliable PDF text extraction
- OpenAI GPT: Advanced language models for reasoning
- Chunked Processing: Handle large uploads efficiently
- Vercel Deployment: Seamless serverless hosting
- No Databases: Completely stateless architecture
- Automatic Scaling: Handle traffic spikes effortlessly
- Node.js 18+ and npm
- OpenAI API key
git clone https://github.com/roe-ai/vectorless-chatbot.git
cd vectorless-chatbot
npm installCreate .env.local:
# Only needed for local development
OPENAI_API_KEY=your_openai_api_key_herenpm run devVisit http://localhost:3000
- Push to GitHub
- Connect to Vercel
- Set environment variable:
OPENAI_API_KEY=your_key - Deploy! โ
- Click "Add Your First Document" or "Add Files"
- Select up to 100 PDF files (4.5MB each max)
- Add a description of your document collection
- Large uploads are automatically chunked for reliability
- Ask questions about your documents in natural language
- Watch the 3-step process: Document Selection โ Page Detection โ Answer Generation
- Get detailed answers with timing and cost breakdowns
- Add more documents anytime
- Edit collection descriptions
- Start new sessions as needed
- All data stays in your browser
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Browser โ โ Vercel Functions โ โ OpenAI API โ
โ โ โ โ โ โ
โ โข LocalStorage โโโโโบโ โข /api/upload โโโโโบโ โข GPT Models โ
โ โข Document Data โ โ โข /api/chat/streamโ โ โข Real-time โ
โ โข Chat History โ โ โข No Storage โ โ Processing โ
โ โข Session State โ โ โข Stateless โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
When uploading large document sets:
- Size Detection: Frontend calculates total upload size
- Automatic Chunking: Splits into 3.5MB chunks if needed
- Parallel Processing: Each chunk processed independently
- Progressive Results: Documents become available as chunks complete
- Error Recovery: Failed chunks can be retried individually
Upload and process PDF documents
- Input: FormData with files and description
- Output: Processed documents with extracted text
- Features: Automatic chunking, progress tracking
Stream chat responses in real-time
- Input: Question, documents, chat history
- Output: Server-sent events with processing steps
- Features: Real-time progress, cost tracking, citations
Service health check
- Output: System status and mode information
| Traditional RAG | Vectorless Approach |
|---|---|
| ๐๏ธ Requires vector database | ๐ซ No database needed |
| ๐ Pre-processes to embeddings | ๐ Real-time processing |
| ๐ฐ Expensive infrastructure | ๐ธ Serverless & cost-effective |
| ๐ Stores data on servers | ๐ก๏ธ Browser-only storage |
| ๐ Limited by embedding dimensions | ๐ง Full context understanding |
| โก Fast retrieval, lossy context | ๐ฏ Accurate reasoning, full context |
- Upload: Marketing team uploads 50 company PDFs
- Describe: "Company policies, procedures, and guidelines"
- Ask: "What is our remote work policy?"
- Process:
- ๐ง LLM selects "HR Handbook" and "Remote Work Guidelines"
- ๐ฏ Identifies relevant pages about remote work
- ๐ฌ Generates comprehensive answer with citations
- Result: Accurate answer in ~15 seconds with cost breakdown
- Multi-format Support: Word docs, PowerPoint, Excel
- Advanced Citations: Highlight exact text passages
- Collaboration Features: Share sessions with team members
- Analytics Dashboard: Usage patterns and insights
- Custom Models: Support for local and custom LLMs
- Batch Operations: Process multiple questions simultaneously
We welcome contributions! This project showcases how modern LLMs can replace traditional vector-based approaches while providing better accuracy and user experience.
MIT License - see LICENSE file for details.
โญ Star us on GitHub if you find this vectorless approach interesting!
Built with โค๏ธ by ROE AI Inc.