Skip to content

build_index.py

作用

扫描 memory_bench/data/source/raw/ 章节文件,关联 norm/,生成 memory_bench/data/source/index.json

调用示例

bash
uv run memory_bench/scripts/build_index.py
uv run memory_bench/scripts/build_index.py --force
uv run memory_bench/scripts/build_index.py --limit 5          # 仅前 5 章
uv run memory_bench/scripts/build_index.py --tail 3           # 仅最后 3 章
uv run memory_bench/scripts/build_index.py --offset 2 --limit 3  # 跳过前 2 章取 3 章

参数

参数说明
--force即使 index 已存在也强制重建
--limit N仅索引前 N 章(按章节号排序)
--tail N仅索引后 N 章
--offset N跳过前 N 章后再 limit/tail

输入 / 输出

  • 输入memory_bench/data/source/raw/*.md + norm/*.norm.md(可选)
  • 输出memory_bench/data/source/index.json

魔女の实验室