Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AskYourDocs — Intelligent Document RAG Assistant

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.

Features

  • 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 pgvector HNSW 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.

Stack & Architecture

  • 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

Environment Setup

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"

Getting Started

# 1. Install dependencies
npm install

# 2. Push database schema
npx drizzle-kit push

# 3. Start development server
npm run dev

Deployment on Vercel

  1. Push your repository to GitHub / Git provider.
  2. Import the project in Vercel.
  3. Configure environment variables (DATABASE_URL, OPENAI_API_KEY, BETTER_AUTH_SECRET, BETTER_AUTH_URL).
  4. Deploy!

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages