algonotes_rag/docs/mcp/metadata.md

1.3 KiB
Raw Permalink Blame History

📝 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 原地更新

注意事项

  1. 轻量更新:只修改 metadata不重新处理文件内容
  2. 不重算 hashcontent_hash 保持不变
  3. vector 同步tags 会同步到向量库author 和 type 只存在 SQL