AskPDF-AI is an advanced Generative AI-powered application designed to process PDF documents and provide accurate answers to questions based on the content within the PDFs. The backend is built using FastAPI and serves as the core processing unit for handling PDF uploads, text extraction, vector embeddings, and response generation.
This application is containerized using Docker and deployed using AWS Fargate with a fully automated CI/CD pipeline.
The LangChain-based backend follows these steps to provide responses to your questions:
- PDF Loading: The app reads multiple PDF documents and extracts their text content.
- Text Chunking: The extracted text is divided into smaller, manageable chunks.
- Vector Embeddings: The application generates vector representations (embeddings) for the text chunks.
- Similarity Matching: When you ask a question, the app compares it with the text chunks and identifies the most semantically similar ones.
- Response Generation: The relevant text chunks are passed to a language model to generate an accurate response.
The backend of AskPDF-AI is built with:
- FastAPI → A modern, high-performance web framework for Python.
- LangChain → Framework for building applications powered by large language models (LLMs).
- FAISS → A vector database for efficient similarity searches.
- OpenAI API → Used for embedding generation and language modeling.
- PostgreSQL → Database for storing user and document data.
- Redis → Caching system to optimize performance.
Below is a preview of the AskPDF-AI user interface:
git clone https://github.com/sushilrajeeva/AskPDF-AI_Backend.git
cd AskPDF-AI_Backendpython -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory and add:
OPENAI_API_KEY=your_openai_api_key
DATABASE_URL=your_postgresql_url
REDIS_URL=your_redis_url
Create a .env file in the root directory and add:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
The backend will be available at: http://localhost:8000 API documentation can be accessed at: http://localhost:8000/docs
This project is containerized using Docker for easy deployment.
docker pull sushilrajeev/ask-pdf-backend:latest docker run -p 8000:8000 --env-file .env sushilrajeev/ask-pdf-backend:latest
The backend will be accessible at: http://localhost:8000
I have implemented a fully automated CI/CD pipeline using GitHub Actions, DockerHub, and AWS Fargate
- On each push to main, the frontend image is built and pushed to DockerHub.
- The previous image is deleted to save space.
- Once the image is uploaded, the deployment process is triggered.
- The latest Docker image is pulled and a new task is deployed on AWS Fargate.
- This ensures zero-downtime and automated scaling.
For the frontend setup, please refer to the repository: 👉 AskPDF-AI Backend Repository (https://github.com/sushilrajeeva/askpdf-frontend) This repository contains instructions on how to:
The AskPDF-AI Chat App is released under the MIT License.


