← All templates

RAG Knowledge Base

AI-first · React + Node (Express) · 19 @molecule/* packages

Upload documents, semantic search, and AI-powered Q&A — with built-in Stripe-backed subscription tiers

Open in Molecule

What is inside

  • auth
  • document-upload
  • semantic-search
  • ai-qa
  • rag
  • subscriptions

Screens (17)

  • Landing /
  • Login /login
  • Signup /signup
  • ForgotPassword /forgot-password
  • ResetPassword /reset-password
  • Ask /ask (signed in)
  • Documents /documents (signed in)
  • DocumentDetail /documents/:id (signed in)
  • Sources /sources (signed in)
  • Analytics /analytics (signed in)
  • Settings /settings (signed in)
  • SourceDetail /sources/:id (signed in)
  • History /history (signed in)
  • KnowledgeGraph /graph (signed in)
  • Members /members (signed in)
  • Notifications /notifications (signed in)
  • Billing /billing (signed in)

Data model (12 tables)

  • collections — id, user_id, name, description, document_count, created_at, updatedAt
  • sources — id, user_id, collection_id, kind, label, config_json, credentials_encrypted, last_sync_at, …
  • documents — id, user_id, collection_id, source_id, title, slug, body_md, source_url, …
  • qa_conversations — id, user_id, collection_id, title, started_at, last_message_at, created_at, updatedAt
  • qa_entries — id, user_id, conversation_id, collection_id, question, answer_md, citations_json, confidence, …
  • qa_messages — id, user_id, conversation_id, entry_id, role, text, citations_json, created_at, …
  • graph_edges — id, user_id, from_doc_id, to_doc_id, weight, kind, created_at, updatedAt
  • org_members — id, user_id, member_user_id, invitee_email, role, invited_at, joined_at, created_at, …
  • notifications — id, user_id, kind, title, body, link, read_at, created_at, …
  • api_tokens — id, user_id, label, hashed_token, last_used_at, created_at, updatedAt
  • document_chunks — id, document_id, user_id, chunk_index, body_text, page_number, heading, token_count, …
  • devices — id, createdAt, updatedAt, userId, name, pushPlatform, pushSubscription, hasPushSubscription

API (9 handlers)

  • api-tokens api/src/handlers/api-tokens.ts
  • collections api/src/handlers/collections.ts
  • documents api/src/handlers/documents.ts
  • graph api/src/handlers/graph.ts
  • members api/src/handlers/members.ts
  • notifications api/src/handlers/notifications.ts
  • qa api/src/handlers/qa.ts
  • reports api/src/handlers/reports.ts
  • sources api/src/handlers/sources.ts

Subscription tiers

free / pro / team — gated by: maxDocuments, maxQa, advancedFeatures, canExport, retentionDays

Built from 19 @molecule/* packages

Browse all @molecule/* packages →

Required secrets

  • DATABASE_URL PostgreSQL connection string
  • ANTHROPIC_API_KEY Anthropic API key for Claude
  • OPENAI_API_KEY OpenAI API key for embeddings
  • MEILISEARCH_API_KEY Meilisearch API key
  • AWS_ACCESS_KEY_ID AWS access key for S3
  • AWS_SECRET_ACCESS_KEY AWS secret key for S3
  • S3_BUCKET S3 bucket for document storage

The @molecule/* packages are Apache-2.0. The app you build from this template is yours to export and self-host. Licensing