Add conditional RAG reindex after session summarization
When summarize-transcript.py extracts items to memory files, it now triggers index_personal.py to update the RAG search index. Only runs when items were actually added (total_added > 0) to avoid unnecessary reindexing on trivial sessions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -378,6 +378,29 @@ def main():
|
|||||||
|
|
||||||
log(f"Summarization complete: {total_added} total items added")
|
log(f"Summarization complete: {total_added} total items added")
|
||||||
|
|
||||||
|
# Reindex RAG if we added items
|
||||||
|
if total_added > 0:
|
||||||
|
log("Triggering RAG reindex...")
|
||||||
|
try:
|
||||||
|
reindex_result = subprocess.run(
|
||||||
|
[
|
||||||
|
str(Path.home() / ".claude/skills/rag-search/venv/bin/python"),
|
||||||
|
str(Path.home() / ".claude/skills/rag-search/scripts/index_personal.py"),
|
||||||
|
"--quiet"
|
||||||
|
],
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
timeout=120
|
||||||
|
)
|
||||||
|
if reindex_result.returncode == 0:
|
||||||
|
log("RAG reindex completed successfully")
|
||||||
|
else:
|
||||||
|
log(f"RAG reindex failed: {reindex_result.stderr[:200]}")
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
log("RAG reindex timed out after 120s")
|
||||||
|
except Exception as e:
|
||||||
|
log(f"RAG reindex error: {e}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user