Skip to content
OwnlyPlans

CLAUDE.md

Project root. Cursor: save as AGENTS.md.

Part of AI Chatbot for Your Docs (RAG) by Admin

Download Open the item

CLAUDE.md — Docs chatbot (RAG)

Stack

  • Next.js (App Router, TypeScript)
  • AI SDK (ai package) for streaming chat and embeddings
  • Supabase Postgres + pgvector (supabase/schema.sql)
  • OpenAI text-embedding-3-small (1536 dimensions) for embeddings

Rules

  • The AI SDK changes often. Before writing AI SDK code, use the Context7 MCP to read the current docs ("use context7").
  • Secrets live in .env.local only: OPENAI_API_KEY, NEXT_PUBLIC_SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY. The service role key is server-only; never import it into client components.
  • Ingestion is a script (scripts/ingest.ts), not an API route.
  • Chunks: about 800 tokens with 100 tokens overlap, split on headings first.
  • Answers must come from retrieved chunks. If nothing relevant is found, say so. Always list the sources used.
  • After each step run npm run build and fix all errors.
Source, 15 lines
# CLAUDE.md — Docs chatbot (RAG)

## Stack
- Next.js (App Router, TypeScript)
- AI SDK (`ai` package) for streaming chat and embeddings
- Supabase Postgres + pgvector (`supabase/schema.sql`)
- OpenAI `text-embedding-3-small` (1536 dimensions) for embeddings

## Rules
- The AI SDK changes often. Before writing AI SDK code, use the Context7 MCP to read the current docs ("use context7").
- Secrets live in `.env.local` only: `OPENAI_API_KEY`, `NEXT_PUBLIC_SUPABASE_URL`, `SUPABASE_SERVICE_ROLE_KEY`. The service role key is server-only; never import it into client components.
- Ingestion is a script (`scripts/ingest.ts`), not an API route.
- Chunks: about 800 tokens with 100 tokens overlap, split on headings first.
- Answers must come from retrieved chunks. If nothing relevant is found, say so. Always list the sources used.
- After each step run `npm run build` and fix all errors.

Your AI tool
Starter prompt

		

Download the plan