Skip to content
OV111Public

About

Upload a PDF and chat with it via text or voice — RAG-powered book conversations built with Next.js, Clerk, MongoDB Atlas vector search, and Vapi AI.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

BookTalk

Turn any PDF into an interactive AI conversation. Upload a book, and BookTalk indexes its content so you can discuss it by text or voice — the AI answers grounded in what the book actually says.

Features

  • PDF upload & processing — extracts text, chunks it, and generates embeddings for retrieval
  • Text chat (RAG) — ask questions about a book; answers are retrieved from the book's own content via vector search
  • Voice chat — talk to a book out loud via Vapi AI
  • Personal library — track your books, search/filter, and pick up where you left off
  • Subscription plans — Free / Standard / Pro tiers with book-count limits, billed via Stripe

Stack

Getting started

Install dependencies:

npm install

Create a .env.local file with the variables listed in Environment variables below, then run the dev server:

npm run dev

Open http://localhost:3000.

Environment variables

Variable Purpose
BETTER_AUTH_SECRET / BETTER_AUTH_URL Better Auth authentication
MONGODB_URI MongoDB Atlas connection string
BLOB_READ_WRITE_TOKEN Vercel Blob storage
HUGGINGFACE_API_KEY Embeddings for RAG search
NEXT_PUBLIC_VAPI_API_KEY / NEXT_PUBLIC_VAPI_ASSISTANT_ID Voice chat
ELEVENLABS_API_KEY Voice synthesis (configured in the Vapi dashboard, not read directly by the app)
STRIPE_SECRET_KEY Stripe API access
STRIPE_WEBHOOK_SECRET Verifies incoming Stripe webhook events
STRIPE_PRICE_ID_STANDARD / STRIPE_PRICE_ID_PRO Stripe Price IDs for paid plans
NEXT_PUBLIC_APP_URL Base URL used for Stripe redirect/callback URLs

For local Stripe webhook testing, run the Stripe CLI:

stripe listen --forward-to localhost:3000/api/stripe/webhook

Testing

npm run test

Deployment

Deployed on Vercel. Remember to register a production Stripe webhook endpoint and set all environment variables (including live-mode Stripe keys, when ready) in the Vercel project settings.

About

Upload a PDF and chat with it via text or voice — RAG-powered book conversations built with Next.js, Clerk, MongoDB Atlas vector search, and Vapi AI.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages