Skip to content

A simple chatbot that answers questions based on a PDF book. It extracts text, stores structured knowledge using Neo4j, and retrieves relevant information using a large language model (LLM).

Notifications You must be signed in to change notification settings

rimadjamaa/BookAIChat

Repository files navigation

📖 PDFChatbot - AI Chatbot from a Book

🚀 Overview

PDFChatbot is a simple AI-powered chatbot that answers user queries based on the content of a PDF book. It extracts and structures the text into a Knowledge Graph (KG) with Neo4j, enhances retrieval with FAISS embeddings, and generates responses using an LLM.


🔹 Features

✅ Extracts text from a PDF book
✅ Converts content into a Neo4j knowledge graph
✅ Uses FAISS for fast document retrieval
✅ Integrates an LLM to generate responses
✅ Simple chatbot interface using Chainlit


🛠 Installation

1️⃣ Clone the Repository

git clone https://github.com/yourusername/PDFChatbot.git
cd PDFChatbot

2️⃣ Set Up a Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

4️⃣ Start the Chatbot

chainlit run app.py

🏗 How It Works

1️⃣ Extract Text → Parses the PDF book and processes the text.
2️⃣ Build Knowledge Graph → Stores structured information in Neo4j.
3️⃣ Embed & Retrieve → Uses FAISS to search relevant text.
4️⃣ Generate Answer → Uses an LLM to provide responses.
5️⃣ Chat Interface → Chatbot interacts with users via Chainlit.


❓ Example Usage

User: "What is Chapter 3 about?"
Chatbot: "Chapter 3 discusses the fundamentals of knowledge graphs, including how they structure data using nodes and relationships."


🤝 Contributions

Feel free to open an issue or submit a pull request!

📌 Author: Rima
📌 License: MIT
📌 Disclaimer: This chatbot does not guarantee accuracy and should not be used for professional decision-making.


🔗 Hashtags

#AI #Chatbot #PDFChatbot #Neo4j #KnowledgeGraph #LLM #LangChain #FAISS  
#MachineLearning #NLP #TextProcessing #GraphDatabase #Python #OpenSource  
#ArtificialIntelligence #LLMChatbot #DocumentRetrieval

About

A simple chatbot that answers questions based on a PDF book. It extracts text, stores structured knowledge using Neo4j, and retrieves relevant information using a large language model (LLM).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages