Index a codebase
The indexer makes a source tree searchable. Dimple stores a memory for each supported file and extracts definitions such as functions and classes into separate memories.
Before you start
Section titled “Before you start”Run dimple init in the project directory, or pass an existing dimple.jsonc file with --config.
Index a directory
Section titled “Index a directory”To index the src directory of the current project, run:
dimple index ./srcThe command reports the files it read, the memories it wrote, the unchanged memories it skipped, and any failures. The parser supports JavaScript and TypeScript files.
Search the indexed code
Section titled “Search the indexed code”To ask about the project, run:
dimple query "Where is the deployment configured?" --content-type text/x-typescriptTo return only code results, filter by a file or definition content type. Run --help to see the supported options in your installed version.
Re-index after changes
Section titled “Re-index after changes”Run the same command after you change the source tree. Dimple skips unchanged units, replaces changed units, and marks the units of deleted files as removed. Removed units stop appearing in retrieval.
Indexing does not run your code. It reads and parses supported files, then stores their text for retrieval.
Choose when to create embeddings
Section titled “Choose when to create embeddings”The default command creates embeddings before it finishes. For a large codebase, pass --defer-embed to store the units first and let the worker create embeddings in the background:
dimple index ./src --defer-embedKeyword search can use the units first. Semantic search can use them after the embedding jobs finish. To learn how background jobs recover, see Durable jobs.