PagePal: Talk to a Book
Inspiration
PagePal was inspired by the theme "Tech for Good" and a desire to make books more interactive and accessible. Many people find it difficult to engage with the deep content of books, whether due to personal struggles or time constraints. We wanted to create a platform where people could have a personalized conversation with books, exploring ideas and learning from them in an engaging and dynamic way. Whether it's helping those in need of self-help guidance, those wanting to recall specific details from sci-fi novels, or people wanting a religious or motivational boost, PagePal aims to provide valuable knowledge in a more humanized and approachable manner.
What We Learned
- AI-Powered Conversations: We deepened our understanding of how AI, specifically the **RAG model and ChatGPT API, can be used to create conversational interfaces that are engaging and contextually relevant.
- Backend Integration: We learned how to integrate **Flask with MongoDB Atlas for seamless data storage and retrieval, ensuring that our application can scale and handle large datasets effectively.
- Prompt Engineering: One of the biggest takeaways was the importance of crafting personalized prompts for each genre of books. We had to ensure that the responses felt authentic, as if the book itself was speaking to the user.
- Project Management: Through effective **communication and planning, we ensured that the roles were well-distributed across the team to utilize everyone's strengths, which helped us stay on track and make decisions swiftly.
How We Built It
- Frontend: We built the frontend using **React, **TypeScript, and **Vite. The user interface allows users to log in, select genres, browse books, and chat with them.
- Backend: The backend was built with **Flask. We implemented the **RAG model with the ChatGPT API to handle dynamic user interactions. Book data is stored and indexed in MongoDB Atlas with vector search to quickly retrieve relevant information.
- Ingestion: We used **Python scripts for data ingestion. We ingested book content, chunked it into meaningful sections, and indexed it for efficient retrieval.
- Custom Prompts: Each book genre, like **Self-Help, **Biography, **Cookbooks, etc., was given its own tailored prompts to make the responses feel humanized and personalized.
Challenges Faced
- Effective Retrieval: Ensuring that the RAG pipeline retrieves relevant and accurate excerpts from the book was challenging, as the AI had to distinguish between the various nuances within a book’s content.
- Persona Consistency: Maintaining consistency in the "book persona" was difficult, as the model had to speak from the book's perspective while staying within the book's context.
- Data Ingestion & Indexing: Efficiently processing the book data and creating an index for fast retrieval was essential, especially since we needed to handle large amounts of text content.
- AI-Driven Responses: The real challenge was ensuring that the AI responded correctly based on the content of the book and not from any outside knowledge, maintaining a strict focus on the material at hand.
Conclusion
Building PagePal was a rewarding journey. We learned how to integrate AI with traditional backend technologies and bring a book to life with interactive conversations. While we faced challenges, our commitment to using software engineering best practices ensured that we built a solid, scalable solution. We’re excited to see where this project can go and how it can help people engage with knowledge in new and innovative ways.
Future Scope:
User Personalization & Recommendation Engine
Goal: Introduce personalized book recommendations based on user preferences and previous interactions, allowing for a more customized browsing experience.
Challenges: Building a recommendation engine based on user history and interaction would require advanced data analytics and was a complex feature to implement.
Integration with Audio
Goal: Implement audio-based interactions, allowing users to speak with books instead of typing. This could provide a more natural and immersive conversational experience.
Challenges: Integrating speech-to-text and text-to-speech capabilities into the existing system was outside the scope of our current hackathon timeline but is something we plan to explore.
Multiple Book Selection & Chat Simultaneously:
Goal: Allow users to select and interact with multiple books at once, enabling a multi-book conversation. For example, a user could ask two books, like a biography and a self-help book, the same question and compare their perspectives.
Challenges: This would require a more complex conversation management system that can track multiple book contexts simultaneously, which wasn't fully implemented in this hackathon due to time constraints.
Blockchain Integration (Phase 2)
Goal: Incorporate blockchain technology to ensure decentralized ownership of books and Verifiable Credentials (VCs) for users, showing that they’ve successfully learned specific concepts or insights from books.
Challenges: The integration of blockchain with our current database structure is a complex task and was not feasible within the time frame of this hackathon.
Log in or sign up for Devpost to join the conversation.