Embeddings
Learn how you can use embeddings with Cody for better code understanding.
What are embeddings?
Embeddings are a semantic representation of text that allows you to create a search index over your codebase. Cody splits your codebase into searchable chunks and sends them to an external service specified in your site's configuration for embedding. The resulting embedding index is stored in your local hard drive.
Embeddings in VS Code
As of Sourcegraph version 5.3, embeddings are only available to Cody Free and Cody Pro users on the VS Code extension.
Cody Free and Pro users can leverage local embeddings for context fetching. Local embeddings are indexed from the Enhanced Context panel. Once indexed, Cody will use these embeddings to provide context to your search queries.
Enable embeddings
To enable embeddings in VS Code IDE:
- Open a repository in your workspace
- Next, create a new Cody chat
- Inside the chat window, open the Enhanced Context Selector window and select Enable Embeddings
- This uploads the repository's context to OpenAI's Embeddings API and gets stored locally
Embeddings are no longer supported for Cody Enterprise and JetBrains IDE extension. You can learn more about Cody's context fetching mechanism.