Summary
When a codebase contains image assets (.png, .svg, etc.), the current options are:
- Include them → triggers vision LLM processing for every image
- Ignore them via
.graphifyignore → removes them from the graph entirely, so any edges pointing to them become dangling
There's no middle ground: index the file as a node with basic metadata, but skip all content extraction/LLM processing.
Use case
In a typical iOS/macOS project (e.g. Swift + Xcode), there are hundreds of .png and .svg asset files. Code files reference these assets by name. We'd like those asset files to show up in the graph so that "uses this image" edges resolve correctly — but there's nothing meaningful to extract from a PNG beyond its filename and path. Running vision extraction on every icon is wasteful and adds noise.
The desired behavior:
- Asset files appear as nodes in the graph with basic metadata (
id, label, file_type, source_file)
- No LLM/vision processing is triggered for them
- Edges from code files that reference these assets resolve correctly against the stub nodes
Proposed solution
A new .graphifyshallow config file (gitignore syntax, consistent with .graphifyignore / .graphifyinclude):
# .graphifyshallow
*.png
*.svg
Files matching these patterns would be:
- Included in the corpus index as pre-built stub nodes
- Skipped during LLM chunking/extraction entirely
- Still valid edge targets so references from code resolve
Alternatively, a --shallow=<pattern> CLI flag would work for one-off runs.
Implementation sketch
detect.py: add _load_graphifyshallow() + _is_shallow() (mirrors existing ignore/include loaders), route matched files into a shallow_files list instead of the per-FileType lists
build.py: inject minimal stub nodes for shallow files before the LLM pass
llm.py: no changes needed — shallow files never reach the chunking pipeline
The trickiest part is ensuring stub node IDs are generated consistently with how build.py expects them, so cross-file edges resolve correctly.
Related
Summary
When a codebase contains image assets (
.png,.svg, etc.), the current options are:.graphifyignore→ removes them from the graph entirely, so any edges pointing to them become danglingThere's no middle ground: index the file as a node with basic metadata, but skip all content extraction/LLM processing.
Use case
In a typical iOS/macOS project (e.g. Swift + Xcode), there are hundreds of
.pngand.svgasset files. Code files reference these assets by name. We'd like those asset files to show up in the graph so that "uses this image" edges resolve correctly — but there's nothing meaningful to extract from a PNG beyond its filename and path. Running vision extraction on every icon is wasteful and adds noise.The desired behavior:
id,label,file_type,source_file)Proposed solution
A new
.graphifyshallowconfig file (gitignore syntax, consistent with.graphifyignore/.graphifyinclude):Files matching these patterns would be:
Alternatively, a
--shallow=<pattern>CLI flag would work for one-off runs.Implementation sketch
detect.py: add_load_graphifyshallow()+_is_shallow()(mirrors existing ignore/include loaders), route matched files into ashallow_fileslist instead of the per-FileTypelistsbuild.py: inject minimal stub nodes for shallow files before the LLM passllm.py: no changes needed — shallow files never reach the chunking pipelineThe trickiest part is ensuring stub node IDs are generated consistently with how
build.pyexpects them, so cross-file edges resolve correctly.Related
.graphifyignoredoes not allow selecting single file type #1043 —.graphifyignoreglob to skip semantic extraction entirely (broader ask; this is a narrower, additive request)