Link Brain
Your personal bookmark graveyard, except things actually come back.
Quick Start
CODEBLOCK0
First Run
On first run, use quickstart instead of setup. It:
- 1. Creates the database
- Scans Chrome, Safari, and Firefox for bookmarks
- Imports everything it finds (skips duplicates)
- Generates the visual GUI console
- Returns JSON with import stats
INLINECODE2 also detects browsers and reports what it finds, but doesn't auto-import. Use quickstart when the user wants the fastest path to a working knowledge base.
What It Does
- - Saves URLs with titles, summaries, tags, and metadata
- Full-text search with natural language filters
- Auto-fetches and summarizes pages locally (no API keys)
- Spaced repetition so your saved links don't rot
- Collections for organizing reading lists
- Knowledge graph visualization
- Reading stats, streaks, and weekly digests
- Imports from Chrome, Safari, Firefox, Pocket, YouTube, Reddit
- Everything in SQLite. Everything on disk. No accounts. No telemetry.
Data lives in ~/.link-brain/. Override with LINK_BRAIN_DIR=/your/path.
Saving Links
Manual
You know the title. You know what it's about. Just tell it.
CODEBLOCK1
Auto
Point it at a URL. It fetches the page, extracts readable text, generates a summary, and suggests tags based on your existing collection. No LLM needed.
CODEBLOCK2
Or equivalently:
CODEBLOCK3
This is the only command that makes a network request. Everything else is local.
Finding Stuff
Search
SQLite FTS5 under the hood, but you can write queries like a person.
CODEBLOCK4
Tags
CODEBLOCK5
Related
Find links that share tags with a specific one.
CODEBLOCK6
Tag Suggestions
Get tag ideas for a URL based on your patterns.
CODEBLOCK7
Discovery
When you don't know what to read next.
- -
digest pulls a batch of links for review - INLINECODE7 surfaces links based on your most-used tags
- INLINECODE8 shows your highest-rated links and hidden finds
- INLINECODE9 grabs something from the backlog
CODEBLOCK8
Reading Tracking
CODEBLOCK9
INLINECODE10 tracks consecutive days you've read something. insights tells you things like your most active hours and top domains. weekly is a formatted digest you can send straight to a chat.
Collections
Reading lists that reference your saved links.
CODEBLOCK10
Review Queue
Spaced repetition for your bookmarks. Every saved link enters the queue. Intervals grow as you review: 1 day, 3 days, 7 days, and so on.
CODEBLOCK11
Auto-Save
The --auto flag on save (or the auto-save shortcut) handles fetching, summarizing, and tagging in one shot. It uses urllib to grab the page, extracts the readable content, and picks tags that match your existing vocabulary. No external services involved.
Knowledge Graph
CODEBLOCK12
Generates a standalone HTML file at ~/.link-brain/graph.html with an interactive canvas. Links are nodes. Shared tags are edges. No external JS libraries. Just open it in a browser.
GUI Console
CODEBLOCK13
Opens ~/.link-brain/console.html in your browser. Single self-contained HTML file, nothing external. Includes search, tag cloud, knowledge graph, collections, review queue, reading timeline, and dark/light mode.
Add --no-open to generate without launching.
Importing
Browsers
Pull bookmarks directly:
CODEBLOCK14
Reads from the browser's local bookmark storage. No export step needed.
Platforms
Import from exported files:
CODEBLOCK15
How to get your exports:
- - Pocket: Go to getpocket.com/export. You'll get an HTML file.
- YouTube: Use Google Takeout. Select YouTube, then pick watch history. You'll get a JSON file.
- Reddit: Go to reddit.com/prefs/data-request or old.reddit.com and export saved posts.
Syncing
Check for bookmarks that have been removed from a browser source:
CODEBLOCK16
Feedback
CODEBLOCK17
Config
All data is stored in ~/.link-brain/:
- -
brain.db (SQLite database) - INLINECODE22 (knowledge graph output)
- INLINECODE23 (GUI console)
- INLINECODE24 and
collection-*.html (exported collections)
Override the directory:
CODEBLOCK18
Tips
- -
search understands time filters like "last week" and reading states like "unread" or "best rated" - Use
--auto on every save unless you have a specific summary in mind. It's fast and surprisingly good. - INLINECODE28 tells you how many links are overdue. Check it weekly.
- INLINECODE29 is great for rediscovering old links you forgot you loved
- Export a collection as HTML to share a reading list with someone
- The graph gets more interesting after about 50 links. Before that, it's a bit lonely.
- INLINECODE30 is the "I'm bored" button
- Combine
scan with sync to keep browser bookmarks in check
链接大脑
你的个人书签坟场,只不过东西真的会回来。
快速开始
bash
python3 scripts/brain.py quickstart # 自动导入浏览器书签 + 打开图形界面
python3 scripts/brain.py save https://example.com --auto
python3 scripts/brain.py search 那篇关于sqlite的文章
首次运行
首次运行时,使用 quickstart 而非 setup。它会:
- 1. 创建数据库
- 扫描 Chrome、Safari 和 Firefox 的书签
- 导入找到的所有内容(跳过重复项)
- 生成可视化图形界面控制台
- 返回包含导入统计信息的 JSON
setup 也会检测浏览器并报告找到的内容,但不会自动导入。当用户希望以最快路径获得可用的知识库时,请使用 quickstart。
功能说明
- - 保存带有标题、摘要、标签和元数据的 URL
- 支持自然语言过滤器的全文搜索
- 自动获取并本地总结页面(无需 API 密钥)
- 间隔重复,让你的保存链接不会腐烂
- 用于组织阅读列表的集合
- 知识图谱可视化
- 阅读统计、连续记录和每周摘要
- 从 Chrome、Safari、Firefox、Pocket、YouTube、Reddit 导入
- 所有数据存储在 SQLite 中。所有数据在本地磁盘上。无需账户。无遥测。
数据存储在 ~/.link-brain/ 中。可通过 LINKBRAINDIR=/your/path 覆盖。
保存链接
手动保存
你知道标题。你知道内容。直接告诉它。
bash
python3 scripts/brain.py save https://docs.python.org \
--title Python 文档 \
--summary 标准库参考。 \
--tags python, 文档
自动保存
指向一个 URL。它会获取页面,提取可读文本,生成摘要,并根据你现有的收藏建议标签。无需 LLM。
bash
python3 scripts/brain.py auto-save https://example.com
或者等效地:
bash
python3 scripts/brain.py save https://example.com --auto
这是唯一会发起网络请求的命令。其他所有操作都是本地的。
查找内容
搜索
底层使用 SQLite FTS5,但你可以像普通人一样编写查询。
bash
python3 scripts/brain.py search 上周来自github的未读内容
python3 scripts/brain.py search 评分最高的rust
python3 scripts/brain.py search 来自youtube的未评分视频
python3 scripts/brain.py search 最早的未读内容 --limit 10
标签
bash
python3 scripts/brain.py tags # 列出所有标签
python3 scripts/brain.py tags python # 标记为python的链接
相关链接
查找与特定链接共享标签的链接。
bash
python3 scripts/brain.py related 42
标签建议
根据你的模式为 URL 获取标签建议。
bash
python3 scripts/brain.py suggest-tags https://example.com
发现
当你不知道接下来该读什么时。
- - digest 拉取一批链接供审查
- recommend 根据你最常用的标签推荐链接
- gems 显示你评分最高的链接和隐藏的发现
- random 从积压中抓取一些内容
bash
python3 scripts/brain.py digest
python3 scripts/brain.py recommend
python3 scripts/brain.py gems
python3 scripts/brain.py random
阅读追踪
bash
python3 scripts/brain.py read 42 # 标记为已读
python3 scripts/brain.py unread # 显示未读链接
python3 scripts/brain.py rate 42 5 # 评分 1-5
python3 scripts/brain.py streak # 当前连续记录和活动
python3 scripts/brain.py insights # 阅读个性、分析
python3 scripts/brain.py weekly # 每周摘要,可直接发送到 WhatsApp
streak 追踪你连续阅读的天数。insights 告诉你最活跃的时段和热门域名等信息。weekly 是格式化的摘要,可以直接发送到聊天中。
集合
引用你保存的链接的阅读列表。
bash
python3 scripts/brain.py collection create Rust --description 系统相关
python3 scripts/brain.py collection add Rust 42
python3 scripts/brain.py collection show Rust
python3 scripts/brain.py collection list
python3 scripts/brain.py collection remove Rust 42
python3 scripts/brain.py collection export Rust # markdown
python3 scripts/brain.py collection export Rust --html # 独立 HTML
复习队列
书签的间隔重复。每个保存的链接都会进入队列。随着你的复习,间隔会增长:1天、3天、7天,以此类推。
bash
python3 scripts/brain.py review # 下一个到期的项目
python3 scripts/brain.py review done 42 # 已复习,推进间隔
python3 scripts/brain.py review skip 42 # 现在不看
python3 scripts/brain.py review reset 42 # 重置为1天间隔
python3 scripts/brain.py review stats # 队列概览
自动保存
save 命令的 --auto 标志(或 auto-save 快捷方式)一次性完成获取、总结和标签化。它使用 urllib 抓取页面,提取可读内容,并选择与你现有词汇匹配的标签。不涉及外部服务。
知识图谱
bash
python3 scripts/brain.py graph --open
在 ~/.link-brain/graph.html 生成一个带有交互式画布的独立 HTML 文件。链接是节点。共享标签是边。无需外部 JS 库。直接在浏览器中打开即可。
图形界面控制台
bash
python3 scripts/brain.py gui
在浏览器中打开 ~/.link-brain/console.html。单个自包含的 HTML 文件,无需外部依赖。包括搜索、标签云、知识图谱、集合、复习队列、阅读时间线以及暗色/亮色模式。
添加 --no-open 可仅生成而不启动浏览器。
导入
浏览器
直接拉取书签:
bash
python3 scripts/brain.py scan chrome
python3 scripts/brain.py scan safari
python3 scripts/brain.py scan firefox
从浏览器的本地书签存储中读取。无需导出步骤。
平台
从导出的文件导入:
bash
python3 scripts/brain.py import pocket_export.html
python3 scripts/brain.py import youtube_history.json
python3 scripts/brain.py import reddit_saved.csv
如何获取导出文件:
- - Pocket:访问 getpocket.com/export。你会得到一个 HTML 文件。
- YouTube:使用 Google Takeout。选择 YouTube,然后选择观看历史。你会得到一个 JSON 文件。
- Reddit:访问 reddit.com/prefs/data-request 或 old.reddit.com 并导出已保存的帖子。
同步
检查已从浏览器源中删除的书签:
bash
python3 scripts/brain.py sync chrome
python3 scripts/brain.py sources # 查看已连接的源和同步状态
反馈
bash
python3 scripts/brain.py feedback 你的消息
python3 scripts/brain.py feedback --bug 有些东西坏了
python3 scripts/brain.py feedback --idea 如果...会不会很酷
python3 scripts/brain.py debug # 用于错误报告的系统信息
配置
所有数据存储在 ~/.link-brain/ 中:
- - brain.db(SQLite 数据库)
- graph.html(知识图谱输出)
- console.html(图形界面控制台)
- collection-.md 和 collection-.html(导出的集合)
覆盖目录:
bash
LINKBRAINDIR=/tmp/test-brain python3 scripts/brain.py setup
提示
- - search 理解时间过滤器如上周和阅读状态如未读或评分最高
- 除非你有特定的摘要想法,否则每次保存都使用 --auto。它速度快且出奇地好
- review stats 告诉你有多少链接已过期。每周检查一次
- gems 非常适合重新发现你忘记曾经喜爱的旧链接
- 将集合导出为 HTML 以与他人分享阅读列表
- 知识图谱在大约 50 个链接后变得更有趣。在此之前,它有点孤单
- random 是我无聊了按钮
- 结合使用 scan 和 sync 来保持浏览器书签的同步