TalkLeaf is an AI-powered reading companion that turns books and PDFs into interactive voice conversations. Instead of only reading through pages, users can talk with their uploaded books, ask questions, explore difficult ideas, request summaries, and review what they learned through transcripts and AI-generated flashcards.
The goal of TalkLeaf is simple: make reading more interactive, conversational, and easier to understand.
TalkLeaf allows users to build a personal digital library from PDF books and interact with those books using voice. Once a book is uploaded and processed, its content can be used as the context for AI-powered conversations.
🔗 Live Site: https://talkleaf.vercel.app/
-
⭐ PDF Upload and Processing : Users can upload PDF books directly into their library. TalkLeaf processes the document, extracts its text, divides the content into manageable segments, and prepares it for AI-powered retrieval and conversation.
-
⭐ Real-Time Voice Conversations : The core experience of TalkLeaf is voice. Users can start a conversation with a book and speak naturally instead of relying entirely on text input. The voice interaction is designed to feel like discussing a book with a knowledgeable reading companion.
-
⭐ AI Voice Personas : TalkLeaf supports multiple voice personas so users can choose a conversational style they prefer. Voice generation and previews are powered by ElevenLabs, while Vapi handles the real-time conversational voice experience.
-
⭐ Live Transcripts : Every conversation can be displayed as a transcript, making it easier to follow the discussion and revisit useful explanations or insights later.
-
⭐ Book Summaries and Insights : TalkLeaf can help users quickly understand long-form content by providing summaries and explanations. This is useful when revising a chapter, understanding a difficult concept, or getting the main idea before going deeper into the material.
-
⭐ AI-Generated Flashcards : Users can generate flashcards from a book to support active recall. The AI creates question-and-answer pairs that can be used to quickly revise important concepts and check understanding.
-
⭐ Authentication and Subscriptions : Clerk provides authentication and user management, while the application's subscription system controls access to plan-based features and usage limits.
-
⭐ Personal Library : Users have their own book library where they can browse, search, open, and manage uploaded books. Books that are no longer needed can also be deleted from the library.
-
Next.js is the main application framework. It provides the React-based frontend along with server-side functionality, routing, API endpoints, and production-ready application infrastructure.
-
TypeScript is used throughout the project to provide static typing, improve developer experience, catch errors earlier, and make the codebase easier to maintain.
-
MongoDB is used as the primary database for storing application data such as users, books, metadata, processed content, and conversation-related information.
-
Mongoose provides schema-based interaction with MongoDB and helps organize database models and queries.
-
Clerk handles authentication and user management, including sign-in, sign-up, sessions, and protected application areas.
-
Vapi powers the real-time voice conversation layer. It enables TalkLeaf to create low-latency, two-way voice interactions between the user and the AI book companion.
-
ElevenLabs provides natural-sounding AI voices and voice generation capabilities used for voice personas and previews.
-
Google Gemini is used for AI-powered features such as generating flashcards and producing useful question-and-answer content from book material.
Before running TalkLeaf locally, make sure you have:
-
Node.js installed.
-
A MongoDB database.
-
A Clerk application.
-
A Vapi account and configuration.
-
An ElevenLabs account if voice generation features are enabled.
-
A Google Gemini API key for AI flashcard generation.
The main TalkLeaf workflow can be summarized as:
-
A user creates an account or signs in.
-
The user uploads a PDF book.
-
TalkLeaf extracts the text from the PDF.
-
The extracted content is divided into smaller segments for efficient processing.
-
The book is stored in the user's library along with its metadata.
-
The user opens a book and starts a voice session.
-
Vapi manages the real-time voice interaction.
-
The AI uses the book's content as conversational context.
-
The conversation is displayed through a live transcript.
-
The user can revisit the book, generate summaries, or create flashcards for revision.
To run this project, you will need to add the following environment variables to your .env file. Add the required environment variables. The exact variable names depend on the current application configuration. Typical configuration includes credentials for:
-
Clerk publishable and secret keys.
-
MongoDB connection string.
-
Vapi credentials.
-
ElevenLabs credentials or configuration.
-
Google Gemini API key.
Note - Please use your own API keys. API keys are sensitive information and should not be exposed to the frontend or in public repositories. Never commit API keys, database credentials, or private secrets to the repository.
Always store them in the .env.local file and use environment variables to keep them secure.
We welcome contributions! If you would like to improve, feel free to fork the repository, create a feature branch, and submit a pull request.
-
Fork the repository
-
Create a new branch (git checkout -b feature-branch)
-
Make your changes
-
Commit your changes (git commit -am 'Add new feature')
-
Push to the branch (git push origin feature-branch)
-
Create a pull request
-
Multi-language Conversations
-
Advanced AI Book Understanding
-
Personalized AI Reading Companion
-
Advanced Flashcard and Quiz System
-
Book-to-Book Comparison
-
Book Recommendations
-
Conversation History
Deployed on Vercel.