Spaces:
Runtime error
Runtime error
| 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.) |