forked from fangtianchen/algonotes_rag
1.3 KiB
1.3 KiB
📝 metadata 工具
功能
更新笔记元数据(title/tags/author/type),不修改笔记内容。
参数
| 参数 | 类型 | 说明 | 默认值 |
|---|---|---|---|
filename |
string | 笔记文件名 | 必填 |
title |
string | 新标题 | 不修改 |
tags |
string | 新标签(逗号分隔) | 不修改 |
author |
string | 新作者 | 不修改 |
type |
string | 笔记类型(note/solution/template) | 不修改 |
使用示例
{
"filename": "fenwick.md",
"author": "fangtianchen",
"type": "template",
"tags": "树状数组,BIT,模板"
}
返回格式
{
"filename": "fenwick.md",
"success": true,
"fields_updated": ["author", "type", "tags"]
}
错误处理
{
"success": false,
"error": "Note not found: fenwick.md"
}
依赖模块
| 模块 | 职责 |
|---|---|
scripts/update.py |
update_metadata() 函数 |
src/store/sql_store.py |
SQL 元数据更新 |
src/store/vector_store.py |
Vector metadata 原地更新 |
注意事项
- 轻量更新:只修改 metadata,不重新处理文件内容
- 不重算 hash:content_hash 保持不变
- vector 同步:tags 会同步到向量库,author 和 type 只存在 SQL