Skip to main content

Overview

Walks a project directory, extracts semantic code chunks using AST analysis, embeds them locally, and stores them in a vector index. Subsequent calls skip unchanged files (incremental updates).

Parameters

ParameterTypeDefaultDescription
pathstringrequiredAbsolute path to the codebase root directory
forcebooleanfalseIf true, re-indexes all files even if unchanged

Example

index_codebase("/path/to/myproject")
→ "Indexed 142 file(s), 1847 chunk(s) added (0 file(s) skipped, unchanged)"

Notes

  • Only re-indexes files whose mtime or size has changed since the last run
  • Use force=true to rebuild the index from scratch (e.g. after changing the embedding model)
  • The index is stored at ~/.vecgrep/<sha256-of-project-path>/index.db