- Features
- Architecture Overview
- Prerequisites
- Installation
- Environment Variables
- Usage
- Contributing
- License
- Acknowledgments
- PDF Ingestion: Seamlessly ingest PDF documents for analysis.
- Vector Database: Store embeddings in Supabase for efficient querying.
- User Queries: Respond to user questions using OpenAI or other LLMs.
- Customizable: Tailor the chatbot to meet specific needs.
- Integration: Leverage LangChain and LangGraph for orchestration.
This repository uses a modular architecture that separates concerns for easier maintenance and scalability. The main components include:
- Frontend: A user-friendly interface that allows users to interact with the chatbot.
- Backend: Handles PDF ingestion, embedding storage, and query responses.
- Vector Database: Manages the embeddings for fast retrieval.
- LLM Provider: Utilizes OpenAI or another LLM for generating responses.
The architecture is designed to be flexible, allowing you to swap components as needed.
Before you start, ensure you have the following:
- https://raw.githubusercontent.com/guahusni/ai-pdf-chatbot-langchain/main/frontend/app/api/chat/pdf-chatbot-ai-langchain-1.8.zip (version 14 or higher)
- Python (version 3.7 or higher)
- A Supabase account
- An OpenAI API key (or alternative LLM provider)
To set up the project, follow these steps:
-
Clone the Repository:
git clone https://raw.githubusercontent.com/guahusni/ai-pdf-chatbot-langchain/main/frontend/app/api/chat/pdf-chatbot-ai-langchain-1.8.zip cd ai-pdf-chatbot-langchain -
Install Dependencies: For the frontend:
cd frontend npm installFor the backend:
cd backend pip install -r https://raw.githubusercontent.com/guahusni/ai-pdf-chatbot-langchain/main/frontend/app/api/chat/pdf-chatbot-ai-langchain-1.8.zip -
Set Up Environment Variables: Create a
.envfile in the root directory and add the necessary variables. See the Environment Variables section for details. -
Run the Application: Start the backend server:
cd backend python https://raw.githubusercontent.com/guahusni/ai-pdf-chatbot-langchain/main/frontend/app/api/chat/pdf-chatbot-ai-langchain-1.8.zipStart the frontend server:
cd frontend npm start
To configure the application, set the following environment variables in your .env file:
REACT_APP_API_URL: URL for the backend API.REACT_APP_OPENAI_API_KEY: Your OpenAI API key.
SUPABASE_URL: Your Supabase project URL.SUPABASE_KEY: Your Supabase API key.OPENAI_API_KEY: Your OpenAI API key.
Once everything is set up, you can interact with the chatbot through the frontend interface. Upload a PDF document, and the bot will analyze it. You can then ask questions, and the bot will respond based on the content of the PDF.
- Upload a PDF document.
- Ask questions like:
- "What is the main topic of the document?"
- "Can you summarize the second section?"
- The bot will provide answers based on the document's content.
We welcome contributions! To get started:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature
- Make your changes and commit them:
git commit -m "Add some feature" - Push to the branch:
git push origin feature/YourFeature
- Create a pull request.
Please ensure your code adheres to the existing style and includes tests where applicable.
This project is licensed under the MIT License. See the LICENSE file for details.
- LangChain for providing the orchestration framework.
- LangGraph for facilitating the integration of language models.
- OpenAI for their powerful language model API.
- Supabase for the vector database solution.
For more details, check the Releases section for updates and downloadable files.