{"slug": "brain-a-local-first-second-brain-that-turns-videos-and-podcasts-into-notes", "title": "Brain – a local-first second brain that turns videos and podcasts into notes", "summary": "Brain, a local-first knowledge base tool that turns YouTube talks, podcasts, arXiv papers, and other content into searchable Markdown notes, has been released as an open-source project on GitHub. The tool runs entirely on the user's machine, uses the Claude API only for text analysis, and offers a Telegram bot interface for mobile access, with features including ingestion, scouting, semantic search, and daily digests.", "body_md": "Brain turns the things you watch and read — YouTube talks, podcasts, arXiv papers, Hacker News threads, engineering blogs — into a searchable knowledge base of Markdown notes, then works on top of it: a morning digest, ideas tied to *your* projects, a weekly reflection, a daily plan, and post drafts. It runs entirely on your machine: notes are plain files, the search index is local, and only the text you choose to analyze goes to the Claude API.\n\nThe second interface is a Telegram bot — the same commands from your phone, with voice messages in and out.\n\n**Ingests**— paste a link, get a structured note: summary, key theses, strong quotes with timestamps, and ideas that connect the material to your own projects. YouTube subtitles when available, local Whisper transcription when not.**Scouts**— checks your channel subscriptions, searches YouTube by your topics, and pulls arXiv, Hacker News, RSS blogs, Reddit, and podcasts. Every candidate is scored 1–10 against your profile in a single batch call; 8+ is added automatically, 6–7 goes to a suggestions file, the rest is dropped.**Answers**— semantic search over every note (local embeddings, Russian + English) plus a Claude answer that cites which material it came from.`ask`\n\nfor one-off questions,`chat`\n\nfor a conversation.**Thinks**— a morning digest with ideas of the day, a weekly reflection across the whole base, a \"dream\" pass that proposes updates to your interest profile, a radar of topics worth commenting on, and a daily plan that pushes back when you skip fundamentals.**Stays private**— your notes, profile, and state never leave the machine. Everything personal is gitignored; the code itself carries no personal data (see[Personalization](#personalization)).\n\n```\ngit clone https://github.com/mstick3/brain.git ~/brain && cd ~/brain\npython3.12 -m venv .venv\n.venv/bin/pip install -e .\n\ncp .env.example .env              # add your ANTHROPIC_API_KEY\ncp profile.example.md profile.md  # fill it in — output quality depends on it\n\n.venv/bin/brain add \"https://www.youtube.com/watch?v=...\"\n.venv/bin/brain ask \"what did they say about agent memory?\"\n```\n\nTo call `brain`\n\nfrom anywhere:\n\n```\nln -sf ~/brain/.venv/bin/brain /opt/homebrew/bin/brain\n# knowledge base\nbrain add <url> [<url>...]        # add a video/podcast (--file urls.txt, --whisper)\nbrain ask \"question\"              # semantic search + a cited answer\nbrain chat                        # conversation with your base (--en for English practice)\nbrain list                        # everything in the base\nbrain reindex                     # rebuild the index after editing notes by hand\n\n# collecting\nbrain follow <channel-url>        # subscribe to a YouTube channel\nbrain follows / unfollow <query>\nbrain topics add \"ai agents\"      # search topics for the scout\nbrain discover                    # run the scout now\nbrain sources                     # arXiv / HN / blogs / Reddit: list, add, remove, run\nbrain podcast add <rss-url>       # podcast episodes, transcribed locally\n\n# thinking\nbrain daily                       # morning digest (--force, --resend)\nbrain ideas                       # ideas from the last 30 days (--all for everything)\nbrain reflect                     # weekly reflection over the whole base\nbrain dream                       # proposed profile updates (--apply to accept)\nbrain radar                       # topics worth commenting on today\nbrain post [\"topic\"]              # a post draft in your voice\n\n# secretary\nbrain day                         # today's plan: one main result + 2-3 tasks\nbrain task \"text\" / brain tasks   # add / show tasks\nbrain draft \"what you need\"       # draft an email, message, or document outline\n\n# housekeeping\nbrain model                       # model split and API spend per day\nbrain lang ru|en                  # output language\nbrain youtube connect [browser]   # use your YouTube cookies for gated videos\nbrain telegram test|listen|status\n```\n\n- macOS (the digest uses macOS notifications; the rest is portable) and Python 3.11+\n- An\n[Anthropic API key](https://console.anthropic.com/) `ffmpeg`\n\nfor the Whisper path:`brew install ffmpeg`\n\n- Optional: a Telegram bot, if you want the digest and the assistant on your phone\n\nModels are split in two tiers, configured in `brain/config.py`\n\n: a fast one for bulk work (scoring candidates, turning transcripts into notes) and a stronger one for thinking (digest, ideas, reflection, chat, posts). `brain model`\n\nshows the split, the prices, and what you have spent per day.\n\nThe first Whisper run downloads a ~1.5 GB model, and the first search downloads a small local embedding model. Both are cached afterwards.\n\nData lives in `~/brain`\n\nby default. Point it elsewhere with `BRAIN_HOME`\n\n:\n\n```\nexport BRAIN_HOME=\"$HOME/Documents/brain-data\"\n```\n\n`.env`\n\nholds the secrets:\n\n```\nANTHROPIC_API_KEY=sk-ant-...\nTELEGRAM_BOT_TOKEN=\nTELEGRAM_CHAT_ID=\n```\n\nBrain was built Russian-first: the system prompts are written in Russian and the default output language is Russian, while transcripts and quotes are always kept in the original language of the source. `brain lang en`\n\nswitches everything Brain writes for you — summaries, theses, ideas, answers, digests — to English. The two optional profile sections the code reads still use their Russian headings (`## Мой угол`\n\n, `## Приоритет сейчас`\n\n); translating the prompt layer is a welcome pull request.\n\n`profile.md`\n\nis where *you* live: who you are, your projects, your goals, your blind spots, what you want out of ideas. It is attached to every request, and the quality of everything Brain produces depends on how honestly it is written. Start from `profile.example.md`\n\n.\n\nTwo optional sections are read directly by the code — `## Мой угол`\n\n(your angle, used by the radar) and `## Приоритет сейчас`\n\n(your current priority, used by the daily plan). Leave them out and those prompts stay generic, deriving what they need from the rest of the profile. No personal detail is hardcoded in the source.\n\n- Create a bot with\n[@BotFather](https://t.me/BotFather)and put the token in`.env`\n\nas`TELEGRAM_BOT_TOKEN`\n\n. - Press\n**Start** in your new bot, then run`python scripts/tg_get_chat_id.py`\n\n— it waits for your message and writes`TELEGRAM_CHAT_ID`\n\ninto`.env`\n\n. - Check it:\n`brain telegram test`\n\n. - Run the listener:\n`brain telegram listen`\n\n(or install the launchd job below to keep it alive).\n\nThe bot answers **only** the owner (`TELEGRAM_CHAT_ID`\n\n); anyone else gets a polite refusal. It gives you menu buttons (digest, ideas, ask, post, dream, day), adds any video link you send, transcribes voice messages locally and can answer with voice, closes tasks (`сделано 2`\n\n), and records 👍/👎 on ideas and posts so future suggestions drift toward what you actually like.\n\nTemplates for all six jobs are in [ launchd/](/mstick3/brain/blob/main/launchd) — digest, scout, reflection, dream, weekly post draft, and the bot. Install them all:\n\n```\nfor f in launchd/*.plist; do\n  name=$(basename \"$f\")\n  sed \"s|__BRAIN_HOME__|$HOME/brain|g\" \"$f\" > \"$HOME/Library/LaunchAgents/$name\"\n  launchctl bootstrap gui/$(id -u) \"$HOME/Library/LaunchAgents/$name\"\ndone\n```\n\n| Job | When | What |\n|---|---|---|\n`com.brain.daily` |\ndaily 06:30 | subscriptions, sources, digest |\n`com.brain.discover` |\ndaily 12:00 | scout by topics |\n`com.brain.reflect` |\nSun 07:00 | weekly reflection |\n`com.brain.dream` |\nSun 07:30 | proposed profile updates |\n`com.brain.post` |\nFri 07:00 | weekly post draft |\n`com.brain.telegram` |\nalways | the bot (KeepAlive) |\n\n```\nlink / feed → transcript or article text → Claude (analysis) → Markdown note in vault/\n                                                                      ↓\n                                        chunks + local embeddings → index.db (SQLite)\n                                                                      ↓\n                                  ask · chat · digest · ideas · reflect · dream · radar · day\n```\n\n**Notes** are plain Markdown with YAML frontmatter — the vault opens as an[Obsidian](https://obsidian.md)vault, and nothing locks your data in.**Search** is cosine similarity over locally computed multilingual embeddings; no vector service, no data leaving the machine for retrieval.**Budget**— subscriptions, the scout, and sources add at most 8 items per day (`MAX_ADDS_PER_DAY`\n\n), so a busy news week cannot run up your bill.**Fetching is guarded**(`brain/net.py`\n\n): links coming from third-party feeds are restricted to`http(s)`\n\n, refused for local and private-network addresses, redirect-checked, and size-capped — feed content ends up in prompts and notes, so it is filtered on the way in.**State is written atomically**(`brain/storage.py`\n\n): a crash mid-write leaves the previous version intact rather than a truncated file.\n\n```\n~/brain/\n├── brain/           # source\n├── tests/           # pytest suite\n├── launchd/         # scheduling templates\n├── vault/           # your notes (gitignored)\n├── digest/ dreams/  # generated output (gitignored)\n├── index.db         # search index (gitignored)\n├── profile.md       # who you are (gitignored)\n└── .env             # secrets (gitignored)\n.venv/bin/pip install -e \".[dev]\"\n.venv/bin/python -m pytest\n```\n\n115 tests, no network and no API calls. `tests/conftest.py`\n\nswaps `BRAIN_HOME`\n\nfor a temporary directory before the package is imported, so the suite never touches a real knowledge base.\n\nIssues and pull requests are welcome. Two house rules: no personal data in the code — anything about a specific user belongs in `profile.md`\n\n— and new logic comes with a test that does not need the network.\n\n[MIT](/mstick3/brain/blob/main/LICENSE) © Tygran Nushykian", "url": "https://wpnews.pro/news/brain-a-local-first-second-brain-that-turns-videos-and-podcasts-into-notes", "canonical_source": "https://github.com/mstick3/brain", "published_at": "2026-07-28 17:30:42+00:00", "updated_at": "2026-07-28 17:52:29.881559+00:00", "lang": "en", "topics": ["ai-tools", "artificial-intelligence", "large-language-models"], "entities": ["Brain", "Claude API", "GitHub", "Telegram", "Whisper", "YouTube", "arXiv", "Hacker News"], "alternates": {"html": "https://wpnews.pro/news/brain-a-local-first-second-brain-that-turns-videos-and-podcasts-into-notes", "markdown": "https://wpnews.pro/news/brain-a-local-first-second-brain-that-turns-videos-and-podcasts-into-notes.md", "text": "https://wpnews.pro/news/brain-a-local-first-second-brain-that-turns-videos-and-podcasts-into-notes.txt", "jsonld": "https://wpnews.pro/news/brain-a-local-first-second-brain-that-turns-videos-and-podcasts-into-notes.jsonld"}}