From c47c5e5c4f735763f9e38e97ec35962b8be72a3d Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 20 Feb 2026 07:32:06 -0500 Subject: [PATCH] Fix path metadata consistency in incremental vector store updates Prepend "./" to file paths passed to SimpleDirectoryReader during incremental updates so source document metadata matches full rebuilds. Also add API_key_temp to .gitignore. --- .gitignore | 1 + build_exp_claude.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3955e76..2188ace 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ data # Secrets .env +API_key_temp # Query log query.log diff --git a/build_exp_claude.py b/build_exp_claude.py index 0f33cc3..891507b 100644 --- a/build_exp_claude.py +++ b/build_exp_claude.py @@ -145,7 +145,10 @@ def update(): files_to_add = new_files + [fpath for fpath, _ in modified_files] if files_to_add: print(f"\nIndexing {len(files_to_add)} file(s)...") - docs = SimpleDirectoryReader(input_files=[str(f) for f in files_to_add]).load_data() + # Use "./" prefix to match paths from full build (pathlib strips it) + docs = SimpleDirectoryReader( + input_files=[f"./{f}" for f in files_to_add] + ).load_data() for doc in docs: index.insert(doc)