AI chatbot agent for PDF document Q&A using LangChain & LangGraph
Top 3.1% on sourcepulse
This project provides a customizable template for an AI PDF chatbot agent, built with LangChain and LangGraph. It allows users to ingest PDF documents, store their embeddings in a vector database (Supabase), and query them using an LLM like OpenAI. The target audience includes developers and researchers looking to build document-aware AI applications.
How It Works
The system utilizes a two-graph architecture orchestrated by LangGraph. The Ingestion Graph parses PDFs, generates vector embeddings, and stores them in Supabase. The Retrieval Graph handles user queries, retrieves relevant document chunks from Supabase based on semantic similarity, and generates responses using an LLM, providing citations. This state-machine approach enables clear workflow visualization and debugging.
Quick Start & Requirements
yarn install
from the root.documents
table and match_documents
function), OpenAI API Key, optional LangChain API Key..env
files for backend and frontend with API keys and Supabase details.cd backend && yarn langgraph:dev
, start frontend with cd frontend && yarn dev
.Highlighted Details
Maintenance & Community
The project is associated with the O'Reilly book "Learning LangChain". Contributions are welcome via pull requests.
Licensing & Compatibility
The repository does not explicitly state a license in the README. This requires clarification for commercial use or closed-source linking.
Limitations & Caveats
The default file upload limit is 5 files, each under 10MB, configurable in the ingest route. Chat history is not persistent across sessions in the provided UI. The license is not specified, which may impact commercial adoption.
5 months ago
1 day