📖 ChatBook – Real-Time AI-Powered Book Chat

✨ Inspiration

We’ve always believed in the power of books to spark conversations, share knowledge, and change perspectives. But while platforms exist to discuss books or access summaries, none offer a unified space where readers can collaboratively chat, interact with the book directly using AI, and receive intelligent assistance — all in real time.

ChatBook was born from that gap.

We wanted to build a platform where users could:

  • Upload any book and talk to it directly using AI
  • Engage in real-time group chat about the content
  • Get instant AI-powered answers if something didn’t make sense
  • Explore knowledge collaboratively, beyond traditional static reading

With Auth0 for secure identity, MongoDB Atlas for smart storage, and Gemini + GPT-4 for intelligent understanding, we set out to redefine the way people read, learn, and discuss books together.


🛠️ What We Built

ChatBook is a full-stack AI-powered web app that enables users to:

  • 🧠 Upload PDF or TXT books
  • 🔍 Perform semantic search within the content
  • 💬 Engage in real-time group chats
  • 📚 Chat with specific books using vector-based RAG pipelines
  • 🤖 Ask general questions to Gemini AI
  • 🔐 Log in securely using Auth0
  • 📂 Upload and interact with multiple books per session

🧪 How It Works

🧬 AI Integration

  • Gemini AI (Google) powers the general-purpose assistant.
  • GPT-4 is used for vector embeddings and semantic understanding.
  • A custom Retrieval-Augmented Generation (RAG) pipeline was built using LangChain, allowing intelligent, context-aware answers from uploaded books.

📚 Book Interaction

  • When a user uploads a book, it is parsed using PyPDF and chunked into vector embeddings.
  • These are stored in MongoDB Atlas and indexed for semantic retrieval.
  • Users can select a book from a sidebar and ask context-specific questions to the AI.

💬 Real-Time Chat

  • Built with Flask-SocketIO and Gevent, the group chat allows users to communicate instantly.
  • WebSocket-based messaging is supported using Socket.IO for two-way real-time communication.
  • AI assistance is context-aware and available in both book-specific and general chat modes.

🔐 Authentication

  • We used Auth0 for secure login, route protection, and token-based session management.
  • User identity is tied to uploaded content, enhancing the personalized experience.

⚙️ Tech Stack

Backend

  • Flask (Web framework)
  • Flask-SocketIO (WebSocket support)
  • Gevent (Async I/O)
  • PyMongo (MongoDB access)
  • LangChain (RAG orchestration)
  • OpenAI API (GPT-4 Embedding)
  • Gemini API (LLM Assistant)
  • Auth0 (Authentication)
  • python-dotenv (Config management)

Frontend

  • HTML, CSS, JavaScript
  • WebSocket + Socket.IO

Database

  • MongoDB Atlas
  • Vector search for semantic content understanding

DevOps

  • Auth0 integration
  • Environment-based config
  • SSL (for secure local communication)
  • Git & venv for development

🧠 Challenges We Faced

Real-Time Communication

  • Challenge: Syncing AI responses and user chat across multiple users
  • Solution: Used event-namespacing with Socket.IO and scoped room management

Book Processing & AI Context

  • Challenge: Handling large files and ensuring meaningful context for AI
  • Solution: Implemented PDF chunking, semantic vectorization, and a LangChain-based RAG flow

Performance Bottlenecks

  • Challenge: Maintaining response time with growing vector DB
  • Solution: Optimized caching and minimized redundant calls

Secure Access

  • Challenge: Simplifying yet securing the auth workflow
  • Solution: Used Auth0’s hosted UI and rules to manage sessions and scopes

💡 What We Learned

This project was a deep dive into:

  • Real-time web systems and WebSocket architecture
  • Language model orchestration with LangChain
  • Secure file and user session handling with Auth0
  • Building RAG pipelines and working with vector embeddings
  • Designing for collaborative, intelligent user experiences

We also explored how powerful AI can become when paired with social features — like conversation, collaboration, and knowledge sharing.


🔮 What’s Next

  • ✅ Support for EPUB and DOCX formats
  • ✅ AI-powered book recommendations
  • ✅ Multi-language support
  • ✅ Exportable chat summaries
  • ✅ Collaborative reading rooms with moderation
  • ✅ Hosting for public access + demo site

🌍 Social Good Impact

ChatBook fits the Hacks for Social Good track by:

  • Making knowledge more accessible and conversational
  • Helping students and lifelong learners explore books collaboratively
  • Offering AI assistance to those with learning differences or limited access to tutors
  • Creating a platform that encourages curiosity, reading, and critical thinking

🎥 Demo

A short walkthrough video of ChatBook will be available on YouTube (link will be updated after upload).


👨‍👩‍👧‍👦 Team

  • Tirth Shah
  • Kalpit Sharma
  • Saloni Tilekar

We collaborated across all components of the project — backend, frontend, AI integration, database design, and UX — to bring ChatBook to life.


We hope ChatBook inspires new ways to interact with books, knowledge, and each other. Thank you for reading!

Built With

  • auth0
  • css
  • css-frameworks-&-libraries:-flask
  • environments
  • flask-socketio
  • gevent
  • git
  • google-generative-ai-(gemini)
  • html
  • javascript
  • langchain
  • langchain-(rag-pipeline)-frontend:-html
  • languages:-python
  • pymongo
  • pypdf
  • python
  • python-dotenv
  • socket.io-(client-side)-cloud-services-&-devops:-mongodb-atlas
  • socket.io-ai/ml-&-apis:-openai-api-(gpt-4)
  • ssl-(local)
  • virtual
Share this project:

Updates