Skip to content

CodePlato3721/pdf-eater

Repository files navigation

🍽️ PDF Eater

Upload your PDFs. Ask anything. Get precise answers.


🤔 Why PDF Eater?

Most people find AI assistants like ChatGPT or Claude incredibly useful for everyday tasks. But when it comes to specialized domains — medical reports, legal documents, academic papers, technical manuals — things start to fall apart:

  • 🤥 AI hallucinates. It confidently gives you wrong answers when it doesn't know something.
  • 🎯 AI goes off-topic. It answers questions you didn't ask, based on its general training data rather than your specific document.
  • 🔍 AI lacks precision. It can't reliably point you to the exact passage, clause, or data point you're looking for.

On top of that, keeping up with a ChatGPT or Claude subscription gets expensive. And if you're calling APIs directly, the costs add up even faster.

The truth is, most people don't need a general-purpose AI assistant for document work. They just need something that can read their PDF and answer questions about it accurately — using a cheap, fast model.

That's exactly what PDF Eater does. 🍽️


✨ Features

  • 📄 Upload one or multiple PDF files
  • 💬 Ask questions in natural language
  • 🔎 Semantic search powered by OpenAI Embeddings
  • 🧠 Answers generated by GPT-3.5
  • 📌 See exactly which pages your answer came from
  • 🕓 Full conversation history with memory

🛠️ Tech Stack


🚀 Getting Started

1. Clone the repository

git clone https://github.com/CodePlato3721/pdf-eater.git
cd pdf-eater

2. Install dependencies

Requires uv.

cd backend
uv sync

3. Set up your API key

Create a .env file in the backend/ directory:

OPENAI_API_KEY=your_openai_api_key_here

4. Run the backend

uv run uvicorn main:app --reload

The API is served at http://127.0.0.1:8000 (interactive docs at /docs).

5. Run the frontend

cd frontend
npm install
npm run dev

The app is served at http://localhost:5173.


📁 Project Structure

pdf-eater/
├── backend/
│   ├── main.py         # FastAPI entry point (API endpoints)
│   ├── config.py       # Configuration constants
│   ├── core/
│   │   ├── chain.py        # Conversational retrieval chain
│   │   ├── embeddings.py   # Vectorstore creation
│   │   └── loader.py       # PDF loading, splitting and validation
│   ├── services/
│   │   ├── state.py        # App state container and persistence
│   │   ├── ingestion.py    # PDF ingestion pipeline
│   │   └── qa.py           # Question answering service
│   └── tests/
├── frontend/
│   ├── index.html      # Vite entry HTML
│   ├── src/
│   │   ├── main.tsx        # React entry point
│   │   ├── App.tsx         # Two-pane layout (sidebar + chat)
│   │   └── components/     # UI components
│   └── tests/
│       ├── unit/           # Vitest unit tests
│       └── e2e/            # Playwright e2e tests
├── doc/
└── README.md

📝 License

MIT

About

A conversational AI chatbot that lets you upload PDF documents and ask questions about their content. Built with LangChain, OpenAI, and Streamlit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors