Skip to content

manavsiddharthgupta/0Notes

Repository files navigation

0notes

An AI-powered note-taking and study assistant. Create, organize, and enhance your notes with the help of multiple AI models — generate flashcards, practice problems, and quizzes, chat with your documents, and search your knowledge base semantically.

Features

  • Rich Text Editor — TipTap-based editor with markdown, math (KaTeX), code highlighting, tables, and media embedding
  • AI Chat — Two modes: Agent (delegates to specialized sub-agents for notes, web, and code) and Ask (direct Q&A)
  • Study Tools — Auto-generate flashcards, practice problems, and quizzes from your notes
  • Source Attachments — Upload and view PDFs, images, DOCX, CSV/Excel, audio, and video with built-in viewers
  • RAG & Vector Search — Semantic search over notes and sources using pgvector embeddings
  • Multi-Model Support — Use models from OpenAI, Anthropic, Google, xAI, DeepSeek, Qwen, Llama, and more via OpenRouter
  • Code Execution — Run code snippets in a sandboxed environment (Vercel Sandbox)
  • Projects & Tags — Organize notes into projects for easy navigation
  • Responsive UI — Mobile and desktop layouts with resizable panels

Tech Stack

Layer Technologies
Frontend Next.js 16, React 19, TypeScript, Tailwind CSS 4, Radix UI, TipTap
Backend Next.js API Routes, tRPC 11
Database PostgreSQL (Supabase) with pgvector, Drizzle ORM
AI Vercel AI SDK
Auth Supabase Auth with Google OAuth
Storage Vercel Blob
Analytics PostHog

Getting Started

Prerequisites

  • Node.js 18+
  • A Supabase project with the pgvector extension enabled
  • API keys for the AI providers you want to use

1. Clone the repo

git clone https://github.com/manavsiddharthgupta/0notes.git
cd 0notes

2. Install dependencies

npm install

3. Set up environment variables

Copy the example env file and fill in your own keys:

cp .env.example .env.local

See Environment Variables for details on each variable.

4. Set up the database

Make sure the pgvector extension is enabled in your Supabase project, then run migrations:

npx drizzle-kit generate
npx drizzle-kit migrate

5. Run the dev server

npm run dev

Open http://localhost:3000 in your browser.

Environment Variables

Variable Description
DATABASE_URL PostgreSQL connection string (Supabase)
BLOB_READ_WRITE_TOKEN Vercel Blob storage token
NEXT_PUBLIC_SUPABASE_URL Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase anonymous/public key
NEXT_PUBLIC_GOOGLE_CLIENT_ID Google OAuth client ID
NEXT_PUBLIC_GOOGLE_CLIENT_SECRET Google OAuth client secret
NEXT_PUBLIC_AUTH_APP_URL Your app's public URL (e.g. http://localhost:3000)
OPENROUTER_API_KEY OpenRouter API key for multi-model access
GOOGLE_GENERATIVE_AI_API_KEY Google Generative AI (Gemini) API key
ANANNAS_API_KEY Anannas API key (OpenAI-compatible proxy)
VERCEL_OIDC_TOKEN Vercel token for sandboxed code execution (optional)

Project Structure

app/
  (auth)/              # Auth routes (login, callback)
  api/                 # API endpoints (chat, upload, tRPC)
  chat/                # Chat page
  notes/               # Note editor/viewer
  settings/            # User settings
components/            # React components
lib/
  ai/
    agents/            # AI agents (main, note, web, code, ask)
    tools/             # Agent tools (note ops, source ops, web)
    rag/               # Chunking, embedding, vector search
    providers.ts       # Model provider configs
  db/                  # Database config & schema
  trpc/routers/        # tRPC API routers
  auth/                # Auth helpers
hooks/                 # Custom React hooks
utils/                 # Types, constants, helpers
drizzle/               # Database migrations
extensions/            # TipTap editor extensions

Scripts

Command Description
npm run dev Start development server
npm run build Production build
npm run start Start production server
npm run lint Run ESLint
npm run format Format code with Prettier

Deployment

The app is designed to deploy on Vercel. Connect your repo and set the environment variables in the Vercel dashboard.

For the database, create a Supabase project and enable the pgvector extension via the SQL editor:

CREATE EXTENSION IF NOT EXISTS vector;

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

MIT

About

Open-source AI agent for study with rich notes, document chat, semantic search and more

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages