--- title: Second Brain emoji: 🧠 colorFrom: indigo colorTo: purple sdk: gradio sdk_version: 6.6.0 python_version: '3.10' app_file: app.py pinned: false --- # 🧠 Second Brain An intelligent personal productivity app that learns how you work and schedules your day accordingly. ## Features - **Task Capture** — type or speak tasks; AI classifies them across 4 dimensions automatically - **Life Areas** — every task belongs to one of your personal life areas (Work, Health, etc.) - **Smart Scheduling** — AI builds a time-blocked daily plan based on your tasks, context, and learned patterns - **Habit Tracking** — mark tasks as habits with a recurrence interval; they auto-spawn each day - **Goals** — define big-picture goals; AI factors them in when prioritizing - **Journaling** — end-of-day reflection that updates the AI's knowledge of how you work best ## Project Structure ``` second_brain/ ├── app.py ← Main Gradio app, all UI + event wiring ├── requirements.txt ├── core/ │ ├── __init__.py │ ├── database.py ← SQLite: users, tasks, life areas, goals, AI context │ ├── ai_engine.py ← All Groq API calls (task parsing, scheduling, journaling) │ └── styles.py ← CSS └── ui/ └── __init__.py ``` --- ## Deploying to HuggingFace Spaces #### Add your Groq API key as a Secret In your Space on HuggingFace: 1. Go to **Settings** → **Repository secrets** 2. Click **New secret** 3. Name: `GROQ_API_KEY` 4. Value: your Groq key (starts with `gsk_`) 5. Click **Add secret** > ⚠️ Never paste your API key directly into any file — use secrets only. --- ## Notes - **Database**: SQLite file `second_brain.db` is created automatically on first run in the app's working directory - **Voice transcription**: Uses OpenAI Whisper `small` model (~250MB), downloaded on first voice task - **AI model**: Groq `llama-3.3-70b-versatile` (free tier, ~0.3s response time) - **Persistence on HF Spaces**: HuggingFace Spaces have ephemeral storage — the SQLite DB resets on each restart. For permanent storage, upgrade to a paid Space with persistent storage, or swap `database.py` to use an external DB (Supabase, PlanetScale, etc.)