You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second Brain is a full-stack AI-powered personal knowledge management system. It acts as your external memory — save YouTube videos, tweets, PDFs, links and notes in one place, then ask your AI assistant questions about everything you have saved.
Feature Overview
Category
Feature
Description
Content
Save YouTube
Transcript is auto-fetched and embedded
Content
Save Tweets
Store with notes and tags
Content
Upload PDF
Text extracted via pdf-parse, indexed for search
Content
Save Links
Webpage is scraped and embedded
Content
Write Posts
Plain text notes saved and indexed
AI
Semantic Search
Find content by meaning, not just keywords
AI
RAG Chat
Ask questions, get answers from your own content
AI
Auto Embedding
Every save is embedded in the background
AI
Re-index
Manually re-embed failed content
Sharing
Share Brain
Generate a public read-only link
Sharing
Shared View
Visitors can filter and search your brain
Sharing
Enable/Disable
Author can enable and disable the share Link
Auth
Cookie Auth
HTTP-only JWT cookies, secure in production
UX
Responsive
Mobile, tablet, and desktop layouts
UX
Skeleton Loading
Smooth loading states
UX
Error Boundary
App never fully crashes
Tech Stack
Frontend
Technology
Version
Purpose
React
18
UI framework
Vite
5
Build tool and dev server
TypeScript
5
Type safety
Tailwind CSS
3
Utility-first styling
React Router
v6
Client-side routing
Axios
latest
HTTP client with interceptors
Backend
Technology
Version
Purpose
Node.js
18+
Runtime
Express
4
REST API framework
TypeScript
5
Type safety
Mongoose
8
MongoDB ODM
JWT + bcrypt
latest
Authentication and password hashing
Multer
latest
Multipart file upload handling
Zod
3
Request body validation
pdf-parse
1.1.1
PDF text extraction
Cheerio + Axios
latest
Web scraping for links
youtube-transcript
latest
Auto-fetch YouTube transcripts
AI and Storage
Service
Model / Plan
Purpose
Jina AI
jina-embeddings-v3 (1024 dims)
Convert text to vectors
MongoDB Atlas
$vectorSearch
Cosine similarity vector search
Groq
llama-3.1-8b-instant
LLM for RAG chat responses
Supabase Storage
Free tier
PDF and file storage
Infrastructure
Service
Platform
Purpose
Frontend
Vercel
Static hosting with CDN
Backend
Render
Node.js web service
Database
MongoDB Atlas
Cloud database with vector index
Storage
Supabase
Object storage for files
Architecture
+----------------------------------------------------------+
| USER BROWSER |
| React + Vite (Vercel) |
+-----------------------------+----------------------------+
|
HTTPS + Cookie Auth
|
v
+----------------------------------------------------------+
| EXPRESS REST API |
| (Render) |
| |
| /auth /content /search /chat /brain |
+------+----------+----------+--------+--------------------+
| | | |
v v v v
+----------+ +--------+ +-------+ +------------------+
| MongoDB | |Supabase| | Jina | | Groq LLaMA3 |
| Atlas | |Storage | | AI | | RAG Engine |
| Database | | Files | | Embed | | Chat Answers |
+----------+ +--------+ +-------+ +------------------+
RAG Pipeline — How AI Chat Works
Step
Action
Detail
1
User sends question
"What do I know about system design?"
2
Embed the question
Jina AI converts query to 1024-dim vector
3
Vector search
MongoDB Atlas finds top 5 semantically similar docs
4
Build prompt
Inject matching documents as context into LLM prompt
5
LLM generates answer
Groq LLaMA3 answers using only user's saved content
6
Return response
{ answer, sources[] } sent back to frontend
Embedding Pipeline — How Content Gets Indexed
Content Type
Fetch Method
Embedding Input
YouTube
youtube-transcript API
Full transcript text
Link
Cheerio webpage scraper
Article body text
Document
pdf-parse on Supabase file
Extracted PDF text
Tweet
Not fetched
Title + user notes
Post
Not fetched
User notes directly
All types: title + notes + extractedText → Jina AI → 1024 numbers → saved to MongoDB
Index name: vector_index | Database: test | Collection: contents
Deployment
Backend — Render
Setting
Value
Root Directory
backend
Build Command
npm install --include=dev && npm run build
Start Command
node dist/server.js
Instance Type
Free
Add the same environment variables from .env in the Render dashboard under Environment tab. Set NODE_ENV=production and CLIENT_URL=https://your-vercel-url.vercel.app.