Link Library — Personal Content Knowledge Base
Save web content with full original text, generate summaries and tags, retrieve semantically.
Core Rules
- 1. Always save original full text — summaries are for retrieval, originals are for re-reading
- Detect interest, don't demand commands — if user engages with a link, offer to save
- Twitter/X is first-class — tweets, threads, and articles are fully supported
Interest Detection
When user shares a link, evaluate interest signals:
Auto-save (no confirmation needed):
- - User explicitly says save/bookmark/记一下/放进知识库
- User asks "帮我总结一下" (summarize implies save-worthy)
Offer to save (ask once):
- - User shares link + positive commentary ("这篇不错", "有意思", "学到了")
- User asks follow-up questions about link content
- User discusses link content substantively
Don't save:
- - User shares link just for quick reference in conversation
- User says "不用保存" or similar
Data Location
All entries in ~/.openclaw/workspace-main/library/:
CODEBLOCK0
Content Types & Fetch Methods
| Type | URL Patterns | Fetch Method | Template |
|---|
| article | Generic web, blog, /post/ | INLINECODE1 or INLINECODE2 | INLINECODE3 |
| wechat |
mp.weixin.qq.com |
cd ~/.agent-reach/tools/wechat-article-for-ai && python3 main.py "URL" |
article.md |
| tweet | x.com, twitter.com /status/ |
xreach tweet URL --json |
tweet.md |
| thread | x.com, twitter.com (thread) |
xreach thread URL --json |
tweet.md |
| video | youtube.com, youtu.be |
yt-dlp --dump-json "URL" + subtitle extraction |
video.md |
| bilibili | bilibili.com |
yt-dlp --dump-json "URL" + subtitle extraction |
video.md |
| paper | arxiv.org, .pdf links |
web_fetch or browser |
paper.md |
| podcast | Podcast platforms |
web_fetch metadata |
podcast.md |
| image | Image URLs | Download + describe |
image.md |
Twitter/X Fetch Details
CODEBLOCK1
Extract from JSON: full_text, user.screen_name, created_at, entities, media URLs.
For threads: concatenate all tweets in order as full content.
Video Subtitle Extraction
CODEBLOCK2
Entry Structure
Every entry has two parts:
1. YAML Frontmatter (structured metadata)
CODEBLOCK3
2. Markdown Body (content)
CODEBLOCK4
⚠️ MANDATORY: Always save original full text in "Original Content" section.
Summaries and key points are for quick retrieval. The original text is for accurate re-reading and quoting. Never skip saving the full content.
Filename Convention
INLINECODE23
Examples:
- - INLINECODE24
- INLINECODE25
- INLINECODE26
Save Workflow
- 1. Detect URL — Parse link from user message
- Identify type — Match URL pattern to content type
- Check dedup —
memory_search("URL or title") to avoid duplicates - Fetch content — Use appropriate method from table above
- Generate metadata — Title, summary, key points, tags (3-7)
- Write entry — Use template, fill frontmatter + full original text
- Confirm — Tell user: title, tags, and where it's saved
Search & Retrieval
CODEBLOCK5
When returning search results, show:
- - Title + source + date
- Summary (2 lines max)
- Tags
- Offer to show full original text
Writing Reference Mode
When user asks to write something using saved content:
- 1. Search library for relevant entries
- Read full original text of top matches
- Synthesize insights, cite sources inline
- Format citations as INLINECODE28
Templates
Located in templates/:
- -
article.md — Web articles, blog posts, newsletters - INLINECODE31 — Twitter/X posts and threads
- INLINECODE32 — Videos with transcript
- INLINECODE33 — Podcast episodes
- INLINECODE34 — Academic papers
- INLINECODE35 — Visual content
Best Practices
- - Save originals religiously — summaries lose nuance
- Tag consistently — reuse existing tags, keep vocabulary tight
- Link related entries — build a knowledge graph over time
- Don't over-ask — if interest is clear, just save and confirm
链接库 — 个人内容知识库
保存包含完整原文的网页内容,生成摘要和标签,支持语义检索。
核心规则
- 1. 始终保存原始全文 — 摘要用于检索,原文用于重读
- 检测兴趣,而非等待指令 — 若用户与链接互动,主动询问是否保存
- Twitter/X 为一级内容 — 全面支持推文、串文和文章
兴趣检测
当用户分享链接时,评估兴趣信号:
自动保存(无需确认):
- - 用户明确说保存/收藏/记一下/放进知识库
- 用户要求帮我总结一下(总结意味着值得保存)
询问是否保存(仅问一次):
- - 用户分享链接 + 正面评价(这篇不错、有意思、学到了)
- 用户就链接内容提出后续问题
- 用户实质性讨论链接内容
不保存:
- - 用户仅为了对话中快速参考而分享链接
- 用户说不用保存或类似表述
数据存储位置
所有条目保存在 ~/.openclaw/workspace-main/library/:
library/
├── articles/ # 网页文章、博客文章、微信公众号、知乎
├── tweets/ # Twitter/X 帖子和串文
├── videos/ # YouTube、Bilibili
├── podcasts/ # 播客节目
├── papers/ # 学术论文、PDF
├── images/ # 信息图、视觉内容
└── misc/ # 其他所有内容
内容类型与获取方法
| 类型 | URL 模式 | 获取方法 | 模板 |
|---|
| article | 通用网页、博客、/post/ | web_fetch 或 curl -s https://r.jina.ai/URL | article.md |
| wechat |
mp.weixin.qq.com | cd ~/.agent-reach/tools/wechat-article-for-ai && python3 main.py URL | article.md |
| tweet | x.com、twitter.com /status/ | xreach tweet URL --json | tweet.md |
| thread | x.com、twitter.com(串文) | xreach thread URL --json | tweet.md |
| video | youtube.com、youtu.be | yt-dlp --dump-json URL + 字幕提取 | video.md |
| bilibili | bilibili.com | yt-dlp --dump-json URL + 字幕提取 | video.md |
| paper | arxiv.org、.pdf 链接 | web_fetch 或浏览器 | paper.md |
| podcast | 播客平台 | web_fetch 元数据 | podcast.md |
| image | 图片 URL | 下载 + 描述 | image.md |
Twitter/X 获取详情
bash
单条推文
xreach tweet URL
ORID --json
完整串文
xreach thread URL
ORID --json
用户时间线(用于上下文)
xreach tweets @username -n 20 --json
从 JSON 中提取:fulltext、user.screenname、created_at、entities、媒体 URL。
对于串文:按顺序拼接所有推文作为完整内容。
视频字幕提取
bash
下载字幕
yt-dlp --write-sub --write-auto-sub --sub-lang zh-Hans,zh,en \
--convert-subs vtt --skip-download -o /tmp/%(id)s URL
然后读取 .vtt 文件作为转录文本
条目结构
每个条目包含两部分:
1. YAML 前置元数据(结构化元数据)
yaml
title: ...
source: ... # 平台/域名
url: ... # 原始 URL
author: ... # 作者或 @用户名
date_published: ... # 内容创建时间
date_saved: ... # 保存时间
last_updated: ... # 最后修改时间
type: article|tweet|video|podcast|paper|image
tags: [tag1, tag2, ...]
status: unread|read|reviewed
priority: low|normal|high
related: [] # 相关条目路径
2. Markdown 正文(内容)
markdown
{标题}
摘要
2-3 句话的摘要。
要点
原始内容
完整的原文 — 不截断,不总结。
这是重读和引用的权威来源。
引用
值得标注的重要引用
笔记
个人观察、关联、行动项。
相关
- - [[library/tweets/related-tweet]]
- [[library/articles/related-article]]
⚠️ 强制要求:始终在原始内容部分保存完整的原文。
摘要和要点用于快速检索。原文用于准确的重读和引用。切勿跳过保存完整内容。
文件命名规范
<短横线化标题>-.md
示例:
- - library/articles/yc-why-not-work-and-startup-2026-03-12.md
- library/tweets/garry-tan-on-yc-advice-2026-03-13.md
- library/videos/how-to-build-agents-2026-03-13.md
保存工作流
- 1. 检测 URL — 从用户消息中解析链接
- 识别类型 — 将 URL 模式匹配到内容类型
- 检查去重 — memory_search(URL 或标题) 避免重复
- 获取内容 — 使用上表中对应的方法
- 生成元数据 — 标题、摘要、要点、标签(3-7 个)
- 写入条目 — 使用模板,填充前置元数据 + 完整原文
- 确认 — 告知用户:标题、标签和保存位置
搜索与检索
python
语义搜索
memory_search(创业方法论)
memory_search(Garry Tan 的推文)
memory_search(AI agent 视频教程)
读取特定条目
memory_get(library/tweets/garry-tan-on-yc-2026-03-13.md)
返回搜索结果时,显示:
- - 标题 + 来源 + 日期
- 摘要(最多 2 行)
- 标签
- 询问是否查看完整原文
写作参考模式
当用户要求使用已保存内容进行写作时:
- 1. 在知识库中搜索相关条目
- 阅读最佳匹配条目的完整原文
- 综合见解,内联引用来源
- 引用格式为 [[library/type/entry-name]]
模板
位于 templates/ 目录:
- - article.md — 网页文章、博客文章、新闻通讯
- tweet.md — Twitter/X 帖子和串文
- video.md — 带转录文本的视频
- podcast.md — 播客节目
- paper.md — 学术论文
- image.md — 视觉内容
最佳实践
- - 虔诚地保存原文 — 摘要会丢失细微之处
- 一致地使用标签 — 复用现有标签,保持词汇精简
- 链接相关条目 — 逐步构建知识图谱
- 不过度询问 — 若兴趣明确,直接保存并确认