This project lets users upload a PDF and ask questions about its content using OpenAI's GPT models via LangChain.
- Upload a PDF document via HTTP POST
- Process PDF and extract text
- Create vector embeddings with OpenAI
- Store embeddings in FAISS for fast retrieval
- Ask questions about the content
- Python 3.10+
- OpenAI API Key
git clone https://github.com/zeynallow/pdf-qa-agent.git
cd pdf-qa-agent
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txtCreate a .env file:
OPENAI_API_KEY=your-api-key-hereuvicorn main:app --reload- Upload a PDF file
- Ask a question about the uploaded PDF
curl -X POST -F 'file=@example.pdf' http://localhost:8000/upload
curl "http://localhost:8000/ask?q=What is this document about?"