Skip to content

feat: support stub-only indexing for assets (images etc.) — include in graph without extraction #1728

Description

@PaulTaykalo

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:

  1. Included in the corpus index as pre-built stub nodes
  2. Skipped during LLM chunking/extraction entirely
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions