AskYourDocs is a full-stack Retrieval-Augmented Generation (RAG) web application built with Next.js 15, Vercel AI SDK, PostgreSQL (pgvector), Drizzle ORM, and Better Auth.
- Multi-source Document Ingestion: Upload PDF, Word, CSV files, paste raw text, or crawl website URLs up to 5 pages.
- Fast Token Streaming: Real-time streaming AI responses powered by the Vercel AI SDK and OpenAI (
gpt-5-mini). - Vector Search RAG: Chunking and embedding stored natively in PostgreSQL using
pgvectorHNSW indexes with cosine similarity. - Better Auth Integration: Secure session management supporting email/password and GitHub OAuth.
- Rich Workspace UI: Session history, title renaming, document source citations, code copy blocks, markdown rendering, and dark-mode design system.
- Framework: Next.js 15 (App Router, Turbopack)
- AI Streaming: Vercel AI SDK (
ai&@ai-sdk/openai) - Embeddings & LLM: OpenAI (
text-embedding-3-small,gpt-5-mini) - Database: PostgreSQL with
pgvector - ORM & Migrations: Drizzle ORM
- Authentication: Better Auth (
@better-auth/drizzle-adapter) - Styling: Tailwind CSS v4, Lucide React icons, IBM Plex Sans & Mono
Create a .env file in the root directory:
DATABASE_URL="postgresql://user:password@host:5432/askyourdocs"
OPENAI_API_KEY="sk-proj-..."
BETTER_AUTH_SECRET="your-better-auth-secret-key"
BETTER_AUTH_URL="http://localhost:3000"
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"# 1. Install dependencies
npm install
# 2. Push database schema
npx drizzle-kit push
# 3. Start development server
npm run dev- Push your repository to GitHub / Git provider.
- Import the project in Vercel.
- Configure environment variables (
DATABASE_URL,OPENAI_API_KEY,BETTER_AUTH_SECRET,BETTER_AUTH_URL). - Deploy!