Second Brain
April 7, 2026 Β· View on GitHub
Your personal knowledge base, maintained by AI. Just say what you want to save β AI handles the rest.
π¨π³ δΈζθ―΄ζ Β· Twitter: @zhiwehu
One-Command Install
In OpenClaw or Claude Code, just say:
Please install Second Brain from https://github.com/zhiwehu/second-brain
AI will automatically: clone β setup β inject β done.
Features at a Glance
| What to Say | What Happens |
|---|---|
Save this to my second brain: [content] | Stores and classifies the content |
Save this link: [URL] | Fetches, summarizes, saves |
Search my second brain for [topic] | Semantic search across all your knowledge |
Save this screenshot | Extracts text, saves image + metadata |
Save this voice memo | Transcribes, summarizes, stores |
Save this meeting notes | Extracts decisions, action items,εζ‘£ |
Run health check | Checks wiki health, fixes issues |
Compile schema | Builds knowledge graph from your wiki |
7 content types: Tweets Β· Articles Β· Images Β· Voice Β· Files Β· Chats Β· Tasks
How It Works
You say "save this" β AI processes β Stored in your knowledge base
β
Raw file saved (images, audio, documents)
β
AI extracts key information
β
Classified into PARA (Projects/Areas/Resources/Archives)
β
Written to wiki + cross-linked + logged
PARA Classification: AI automatically decides where content belongs:
- Projects β Active goals with deadlines
- Areas β Ongoing responsibilities
- Resources β Topics you're interested in
- Archives β Completed or abandoned items
Three-Layer Architecture
Layer 1: raw/ β Original files (images, audio, tweets)
Layer 2: wiki/ β Processed knowledge (summaries, links)
Layer 3: wiki/schema/ β Concepts & relationships (weekly compile)
How to Use
After installation, just talk to AI:
Save this to my second brain: [content]
Save this link to second brain: [URL]
Search my second brain for AI related content
Save that screenshot to second brain
Save today's meeting notes to second brain
Supported Content Types
| Type | Examples |
|---|---|
| Tweets | Twitter posts, Weibo, short thoughts |
| Articles | Blog posts, news, web pages |
| Images | Screenshots, photos (EXIF extracted) |
| Voice | Audio recordings (transcribed) |
| Files | PDF, Word, Excel, text documents |
| Chat | Meeting notes, chat logs |
| Tasks | Schedules, TODOs with deadlines |
Upgrade
Please upgrade my second brain
Health Check
Run the second brain health check
Or manually:
./tools/doctor.sh
./tools/doctor.sh --fix # auto-fix issues
Scheduled Reminders
Set up automatic reminders using OpenClaw cron:
# Daily todo reminder (9 AM)
openclaw cron add \
--name "Second Brain - Daily Review" \
--cron "0 9 * * *" \
--tz "Asia/Shanghai" \
--session isolated \
--message "Read wiki/log.md and list all pending tasks for today" \
--announce --channel <your-channel> --to "<target>"
# Weekly health check (Sunday 8 PM)
openclaw cron add \
--name "Second Brain - Weekly Check" \
--cron "0 20 * * 0" \
--tz "Asia/Shanghai" \
--session isolated \
--message "Run ./tools/doctor.sh and report the results" \
--announce --channel <your-channel> --to "<target>"
Schema Compilation
Layer 3 of the architecture β extract concepts and relationships from your wiki:
Compile my second brain schema
This extracts:
- Concepts (people, products, methods, technologies)
- Relations (influences, supports, uses, part_of)
- Properties (domain, type, first_seen)
Run manually when your wiki accumulates content:
./tools/compile_schema.sh --status # check status
./tools/compile_schema.sh --incremental # compile new content only
./tools/compile_schema.sh --full # full recompile
Directory Structure
Second Brain uses a dual-directory architecture:
second-brain-source/ # Source code directory (cloned from GitHub)
βββ tools/ # Utility scripts
βββ process/ # AI processing templates
βββ setup.sh # Installation script
βββ upgrade.sh # Upgrade script
βββ CLAUDE.md # AI config
~/second-brain/ # Data directory (your second brain)
βββ .git/ # Independent git repo (manage with git)
βββ wiki/ # Your knowledge base
β βββ projects/ # Active projects
β βββ areas/ # Ongoing responsibilities
β βββ resources/ # Interesting topics
β βββ archives/ # Completed/archived
β βββ schema/ # Concepts & relationships
βββ raw/ # Raw materials (images/audio/files)
βββ ... # Copied code files
Key Points:
second-brain-source/is clean source code, manage with git for your fork~/second-brain/is your data, with independent git for your knowledge base- Run
setup.shand it automatically creates your data directory
Git Management:
# Manage your data
cd ~/second-brain
git status
git add .
git commit -m 'Added new content'
git push # Push to your private GitHub/Gitee
# Upgrade source code
cd second-brain-source
git fetch upstream
./upgrade.sh
Obsidian Integration
Use Obsidian to visually browse your wiki:
- Open Obsidian
- Click "Open Vault" β select
~/second-brain/(your data directory) - Obsidian will display all
.mdfiles inwiki/ - Non-markdown files (
.sh, images inraw/, etc.) are automatically hidden
Recommended Obsidian plugins:
- Dataview β Query wiki data with dynamic tables
- Templater β Automated templates
- Obsidian Git β Auto-backup to Git (push to your private repo)
Tip: Both OpenClaw/Claude Code and Obsidian work in your data directory (~/second-brain/). OpenClaw manages AI processing, Obsidian provides the visual graph view.
Optional Tools
Install these for full functionality:
| Tool | Function | Install |
|---|---|---|
| Whisper | Speech-to-text | pip3 install whisper |
| exiftool | Image metadata | brew install exiftool |
| yt-dlp | YouTube/Bilibili subtitles | brew install yt-dlp |
| agent-reach | Twitter/Xiaohongshu/WeChat | see below |
| qmd | Semantic search (recommended) | npm install -g @tobilu/qmd |
agent-reach install:
Please install agent-reach: https://raw.githubusercontent.com/Panniantong/agent-reach/main/docs/install.md
qmd setup:
npm install -g @tobilu/qmd
qmd collection add $(pwd)/wiki --name second-brain
qmd embed
Recommended Browser Extensions
Obsidian Web Clipper
Convert web articles to markdown with one click:
- Install Obsidian Web Clipper extension
- Configure to save to
second-brain/raw/articles/ - Clip articles while browsing β they go directly to raw/
This makes ingestion much faster β clip first, process later.
Image Download Hotkey
After clipping an article with images:
- In Obsidian Settings β Files and links β set "Attachment folder path" to
raw/assets/ - Bind hotkey: Search "Download" β "Download attachments for current file"
- After clipping, press the hotkey β all images download locally
This ensures LLMs can view images directly from local files.
Generate Slides from Wiki
Use Marp to create presentations from wiki content:
- Install Marp plugin in Obsidian
- Write markdown with Marp syntax
- Export to PPT/PDF
Example:
---
marp: true
theme: default
---
# My Presentation
- Point 1
- Point 2
This lets you generate slide decks directly from your accumulated knowledge.
FAQ
Q: Where is my data stored?
A: In ~/second-brain/wiki/ and ~/second-brain/raw/. Your data is managed with an independent git repository, pushable to your private GitHub/Gitee.
Q: Why separate source code and data?
A: This way you can upgrade code without affecting your data. Source code in second-brain-source/, your data in ~/second-brain/.
Q: Do I need to maintain it manually?
A: No. AI automatically updates index and log. Just regularly git push to backup your data.
Q: How is this different from regular notes? A: Second Brain automatically classifies using PARA, remembers relationships between content, and runs regular health checks.
Q: How do I upgrade?
A: Download the latest source to second-brain-source/, then run ./upgrade.sh. Your wiki/ and raw/ data will not be lost.
Q: What is Schema and when should I compile it?
A: Schema is Layer 3 β it extracts concepts and relationships from your wiki content. Compile when your wiki has accumulated significant content (weekly recommended). Use @compile command or run ./tools/compile_schema.sh --incremental.
Fork & Contribute
Want to stay updated with the latest changes?
If you fork this repo, you can receive updates from the original:
Step 1: Fork on GitHub
Click the "Fork" button on github.com/zhiwehu/second-brain
Step 2: Clone your fork to source directory
git clone https://github.com/YOUR_USERNAME/second-brain.git second-brain-source
cd second-brain-source
Step 3: Run setup script
./setup.sh
This will:
- Create your data directory (
~/second-brain/) - Initialize git repo to manage your data
- Optional: push to your private GitHub
Step 4: Add upstream remote
git remote add upstream https://github.com/zhiwehu/second-brain.git
Step 5: Upgrade
When updates are available, run:
cd second-brain-source
./upgrade.sh
This fetches latest code from original repo and overlays to your data directory. Your wiki/ and raw/ data stays safe.
Step 6: Contribute (optional)
If you fix a bug or add a feature, submit a Pull Request on GitHub!
Theoretical References
For Developers
For manual installation or contributing, see README_DEV.md.
For Chinese version, see README_ZH.md / README_DEV_ZH.md.