Skip to content

save_semantic_cache reports "Cached 0 files" — chunk JSONs use absolute source_file paths, preventing cache hits on subsequent --update runs #826

Closed

Description

@Julianbnz

Graphify version: 0.7.13 (pipx install on Windows 11, Python 3.14.3, May 2026)

Platform: Windows 11, PowerShell 5.1, vault on OneDrive-synced local path.

Corpus: Markdown-only Obsidian vault (~485 ingested files, 307,306 words, 1,250 nodes / 2,575 edges after build).

Symptom

On a second --update run against the same vault path, save_semantic_cache reported "Cached 0 files" despite the cache directory containing chunk JSONs from the prior run.

Re-extraction occurred on all files as if the cache were empty. Expected behaviour was that pages unchanged since the previous extraction (verified by mtime + content hash) would hit the semantic cache and skip the LLM-extractor pass.

Root cause (suspected)

Inspection of the chunk JSON files in graphify-out/cache/ shows the source_file field uses absolute paths like:

"source_file": "C:\\Users\\julia\\OneDrive - Kauri Advisors\\Documents\\Padel-Vault\\wiki\\concepts\\PGNZ-pricing-methodology.md"

On the second --update run, the chunk-extractor uses relative paths (relative to the vault root) when looking up cache entries — e.g. it searches for wiki/concepts/PGNZ-pricing-methodology.md — which doesn't match the absolute-path keys stored in the cache. Result: every file is treated as a cache miss; every file is re-extracted.

Impact

  • --update re-runs cost the same as first-run on the same content (no incremental savings)
  • For prose corpora that change file paths or move between machines, the cache is effectively unusable
  • Particularly impactful for projects using OneDrive / Dropbox / Box where absolute paths look the same on the host but resolve differently in the extracted JSON

Suggested fix

Normalise source_file to be relative to the vault root (the path passed as the positional argument to graphify <path>). Two options:

  1. Store as relative when chunk JSONs are written (during the extraction step in save_semantic_cache)
  2. Normalise to relative at cache-lookup time in the chunk-extractor

Option 1 is cleaner and matches what users would expect from a portable cache.

Repro steps

  1. pipx install graphifyy (v0.7.13)
  2. graphify install to register the Claude Code skill
  3. Create a small markdown vault (say 5-10 files); run /graphify <vault-path> for a first extraction
  4. Verify graphify-out/cache/ contains chunk JSONs; inspect source_file fields and observe absolute paths
  5. Make no changes to any files
  6. Run /graphify <vault-path> --update and observe: every file re-extracted; save_semantic_cache reports Cached 0 files at completion

Workaround for now

None known on the user side. The bug means --update re-runs always pay full extraction cost. Users with large vaults should be aware this is the current behaviour.

Additional context

The token economy claim (advertised ~71.5x reduction; observed 46.7% on a prose corpus) still holds for query cost reduction (BFS over the built graph is cheaper than naive corpus read). The bug is specifically about build / re-build caching, not query-time efficiency. The marketing claim isn't affected; the operational claim of "incremental updates are cheap" is.

Thanks for a great tool — happy to help test a fix if useful.

Activity

  1. added a commit that references this issue on May 12, 2026
  2. safishamsi commented on May 12, 2026

    @safishamsi
    Member

    Fixed in v0.7.16 — file_hash normalises path keys via .as_posix().lower() so Windows junction/case variants hash identically. check_semantic_cache now applies the same absolute-path normalization as save_semantic_cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions