Markdown Converter
Agent skill for markdown-converter
> This file contains essential context for Claude to understand the project when starting new chat sessions.
Sign in to like and favorite skills
This file contains essential context for Claude to understand the project when starting new chat sessions.
2nd Brain is an AI-powered knowledge transfer system for enterprises/organizations. It preserves organizational knowledge by ingesting emails, documents, and messages, making them searchable via AI, and identifying knowledge gaps.
When employees leave or knowledge is siloed, organizations lose critical information. 2nd Brain captures everything, makes it searchable, identifies what's missing, and helps transfer knowledge to new team members.
Frontend (Next.js 14) Backend (Flask) ├── Chat Interface → ├── Auth API (JWT + bcrypt) ├── Documents Page → ├── Integration API (Gmail/Slack/Box) ├── Knowledge Gaps → ├── Document API (Classification) ├── Projects View → ├── Knowledge API (Gaps + Whisper) ├── Integrations → ├── Video API (Generation) └── Training Guides → └── RAG Engine Port 3000/3006 (frontend) Port 5003 (backend)
/Users/rishitjain/Downloads/2nd-brain/ ├── frontend/ # Next.js 14 app │ ├── app/ # Pages │ ├── components/ # React components │ └── lib/ # Utilities, auth context ├── backend/ │ ├── app_v2.py # NEW: Main Flask app (V2 with all features) │ ├── app_universal.py # Legacy Flask app │ ├── api/ # NEW: API blueprints │ │ ├── auth_routes.py # Authentication endpoints │ │ ├── integration_routes.py # OAuth & sync endpoints │ │ ├── document_routes.py # Classification endpoints │ │ ├── knowledge_routes.py # Gaps & transcription │ │ └── video_routes.py # Video generation │ ├── database/ # NEW: Database layer │ │ ├── config.py # DB configuration │ │ └── models.py # SQLAlchemy models │ ├── services/ # NEW: Business logic │ │ ├── auth_service.py # JWT, bcrypt, sessions │ │ ├── classification_service.py # AI classification │ │ ├── knowledge_service.py # Gaps, Whisper, embeddings │ │ └── video_service.py # Video generation │ ├── connectors/ # Integration connectors │ │ ├── gmail_connector.py # Gmail OAuth │ │ ├── slack_connector.py # Slack OAuth │ │ └── box_connector.py # NEW: Box OAuth │ ├── rag/ # RAG engine │ │ └── enhanced_rag_v2.py # Primary RAG │ ├── club_data/ # BEAT Club dataset │ ├── data/ # Enron dataset │ └── tenant_data/ # NEW: Per-tenant data directories
New User Signs Up (no data) → POST /api/auth/signup ↓ Connect Slack + Box + Gmail → GET /api/integrations/{type}/auth ↓ Ingest & Parse all data → POST /api/integrations/{type}/sync ↓ Classify Work vs Personal (AI) → POST /api/documents/classify ↓ User Reviews/Confirms → POST /api/documents/{id}/confirm ↓ Build Knowledge Base → POST /api/knowledge/rebuild-index ↓ Identify Knowledge Gaps → POST /api/knowledge/analyze ↓ RAG Search + Video Generation → POST /api/search, POST /api/videos
| Feature | Status | Completeness |
|---|---|---|
| User Signup/Login | 🟢 COMPLETE | 100% |
| Gmail Integration | 🟢 COMPLETE | 100% |
| Slack Integration | 🟢 COMPLETE | 100% |
| Box Integration | 🟢 COMPLETE | 100% |
| Document Classification | 🟢 COMPLETE | 100% |
| User Review/Confirm | 🟢 COMPLETE | 100% |
| Knowledge Gaps | 🟢 COMPLETE | 100% |
| Answer Persistence | 🟢 COMPLETE | 100% |
| Whisper Transcription | 🟢 COMPLETE | 100% |
| Index Rebuild | 🟢 COMPLETE | 100% |
| RAG Search | 🟢 COMPLETE | 100% |
| Video Generation | 🟢 COMPLETE | 100% |
| Multi-Tenant | 🟢 COMPLETE | 100% |
| Model | Purpose |
|---|---|
| Organization/company (multi-tenant isolation) |
| User accounts with bcrypt passwords |
| JWT refresh tokens, session management |
| Integration configs (Gmail/Slack/Box) |
| Ingested content with classification |
| Embedding chunks for RAG |
| Topic clusters |
| Identified gaps with questions |
| User answers (text or voice) |
| Generated training videos |
| Action audit trail |
| Endpoint | Method | Description |
|---|---|---|
| POST | Register new user + organization |
| POST | Login with email/password |
| POST | Logout current session |
| POST | Refresh access token |
| GET | Get current user info |
| Endpoint | Method | Description |
|---|---|---|
| GET | List all integrations |
| GET | Start OAuth flow |
| GET | OAuth callback |
| POST | Trigger sync |
| POST | Disconnect |
| Endpoint | Method | Description |
|---|---|---|
| GET | List documents with filters |
| POST | Classify pending documents |
| POST | Confirm classification |
| POST | Reject as personal |
| POST | Bulk confirm |
| GET | Classification statistics |
| Endpoint | Method | Description |
|---|---|---|
| POST | Analyze docs for gaps |
| GET | List knowledge gaps |
| POST | Submit answer |
| POST | Whisper transcription |
| POST | Voice answer |
| POST | Rebuild embeddings |
| Endpoint | Method | Description |
|---|---|---|
| POST | Create video |
| GET | List videos |
| GET | Get video details |
| GET | Get generation progress |
| GET | Download video file |
| Endpoint | Method | Description |
|---|---|---|
| POST | RAG search with AI answer |
| GET | Health check |
# Terminal 1 - Backend (V2) cd /Users/rishitjain/Downloads/2nd-brain/backend export AZURE_OPENAI_API_KEY="your-key-here" ./venv_new/bin/python app_v2.py # Runs on http://localhost:5003 # Terminal 2 - Frontend cd /Users/rishitjain/Downloads/2nd-brain/frontend npm run dev -- -p 3006 # Runs on http://localhost:3006
# Required AZURE_OPENAI_API_KEY=your-key # Optional (for integrations) GOOGLE_CLIENT_ID=... GOOGLE_CLIENT_SECRET=... SLACK_CLIENT_ID=... SLACK_CLIENT_SECRET=... BOX_CLIENT_ID=... BOX_CLIENT_SECRET=... # Optional (for Azure TTS) AZURE_TTS_KEY=... AZURE_TTS_REGION=eastus2
| File | Purpose |
|---|---|
| Main Flask app with all blueprints |
| SQLAlchemy ORM models |
| JWT + bcrypt authentication |
| GPT-4 work/personal classifier |
| Gaps, Whisper, embeddings |
| Video generation pipeline |
| Box OAuth + file sync |
| REST API blueprints |
AZURE_OPENAI_ENDPOINT = "https://rishi-mihfdoty-eastus2.cognitiveservices.azure.com" AZURE_API_VERSION = "2024-12-01-preview" AZURE_CHAT_DEPLOYMENT = "gpt-5-chat" AZURE_EMBEDDING_DEPLOYMENT = "text-embedding-3-large" AZURE_WHISPER_DEPLOYMENT = "whisper"
Use
dimensions=1536 to match existing index:
response = self.client.embeddings.create( model="text-embedding-3-large", input=query, dimensions=1536 )
Built complete enterprise features:
https://github.com/rishitjain2205/2nd-brain
Last updated: December 5, 2024