Files
nexus/wiki/concepts/Incremental-Indexing.md
2026-04-27 20:02:52 +08:00

28 lines
828 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "IncrementalIndexing"
type: concept
tags: []
---
## Definition
增量索引,只处理新增或变化的内容,避免重新处理未变化的数据。
## Key Mechanism
使用内容哈希(如 SHA-256标识每个文档块
1. 首次索引:计算哈希,存储 (哈希, 内容, 向量)
2. 后续索引:重新计算哈希,仅对不匹配的块进行嵌入
3. 未变化的块:跳过,零 API 调用
## Benefits
- **节省成本**:只嵌入新增/变化内容
- **提升速度**:跳过已索引内容
- **一致性保证**:相同内容始终生成相同向量
## Application
- [[memsearch]] 使用 SHA-256 内容哈希实现增量索引
- 文档原文始终是真相,索引是派生缓存
## Related Concepts
- [[memsearch]] — 实现增量索引的工具
- [[RAG]] — 检索增强生成