Skip to main content

Code Indexing

Overview

Code indexing in Artemis allows you to create a comprehensive understanding of your codebase beyond just the specific code snippets you've targeted for optimization. This broader context helps Artemis provide more intelligent and contextual suggestions when using Code Search or chatting with the agent.

Why Index Your Code?

When you index your code, Artemis:

  • Creates embeddings of your entire codebase
  • Understands relationships between different parts of your code
  • Provides more accurate and contextual responses in Code Search
  • Offers more intelligent suggestions during agent chat interactions

How to Index Your Code

You can index your code directly from the Code Snippets page by clicking the Index Code button.

The indexing process will run in the background, and you'll be notified when it's complete.

Using Indexed Code

Once your code is indexed, you can:

  • Extract additional code snippets related to one snippet, such as unit tests, implementation of an interface or similar code (e.g. find duplication)
  • Use the "Code Search" option when generating new snippet versions, this is more powerful than simple Ask LLM, and will use the full index as context.
  • Chat with the agent about your code with improved context

Best Practices

  • Index your code after making significant changes to ensure the embeddings are up to date
  • Consider indexing before starting a new optimization task to get the most context-aware suggestions
  • Use indexing in conjunction with code extraction to get the most value from Artemis's features