From d5770f152ca526e265bfeae31b3945cd7389c020 Mon Sep 17 00:00:00 2001 From: Maedah Batool Date: Wed, 14 Feb 2024 17:19:39 -0800 Subject: [PATCH] Updates changes to embeddings with 5.3 (#94) * Updates changes to embeddings with 5.3 * Add FAQs * Rmv embeddings content * VSCode embedding details --- docs/cody/core-concepts/embeddings.mdx | 24 ++++ docs/cody/embeddings/configure-embeddings.mdx | 85 ------------ docs/cody/embeddings/embedding-index.mdx | 67 ---------- docs/cody/embeddings/index.mdx | 122 ------------------ docs/cody/embeddings/manage-embeddings.mdx | 93 ------------- docs/cody/embeddings/usage-and-limits.mdx | 34 ----- docs/cody/faq.mdx | 39 ++---- docs/cody/troubleshooting.mdx | 16 --- docs/cody/usage-and-pricing.mdx | 113 ---------------- src/data/navigation.ts | 10 +- 10 files changed, 39 insertions(+), 564 deletions(-) create mode 100644 docs/cody/core-concepts/embeddings.mdx delete mode 100644 docs/cody/embeddings/configure-embeddings.mdx delete mode 100644 docs/cody/embeddings/embedding-index.mdx delete mode 100644 docs/cody/embeddings/index.mdx delete mode 100644 docs/cody/embeddings/manage-embeddings.mdx delete mode 100644 docs/cody/embeddings/usage-and-limits.mdx delete mode 100644 docs/cody/usage-and-pricing.mdx diff --git a/docs/cody/core-concepts/embeddings.mdx b/docs/cody/core-concepts/embeddings.mdx new file mode 100644 index 000000000..17b448e1d --- /dev/null +++ b/docs/cody/core-concepts/embeddings.mdx @@ -0,0 +1,24 @@ +# 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](/cody/core-concepts/context#context-fetching-mechanism). diff --git a/docs/cody/embeddings/configure-embeddings.mdx b/docs/cody/embeddings/configure-embeddings.mdx deleted file mode 100644 index 89821b164..000000000 --- a/docs/cody/embeddings/configure-embeddings.mdx +++ /dev/null @@ -1,85 +0,0 @@ -# Configure Embeddings - -

Learn how you can configure embeddings with Cody for better code context.

- -Embeddings will not be configured for any repository unless an admin takes an action. There are two ways to configure an embedding: - -1. Embeddings policies -2. Schedule embeddings jobs - -## Policies - -The recommended way to configure embeddings is by using policies. Embeddings policies define which repositories are automatically scheduled for embedding. These policies are configured through your admin dashboard and will be automatically updated based on the update interval. - -### Create an embeddings policy - -Admins can create embeddings policies from the website's admin page. Navigate to your site admin. Then go to **Cody > Embedding Policies** from the left navigation menu. - -![Embedding policies page](https://storage.googleapis.com/sourcegraph-assets/docs/images/embeddings/embedding-policies.png) - -Here, you'll see a list of all existing embedding policies. Click the **Create new global policy** button to create a new policy and enter a policy name and click **Add repository pattern** to define a pattern. - -Create new global policy - -The pattern should match exactly, unless you use an asterisk `*`, which matches any sequence of zero or more characters. Finally, click on **Create policy**. The new policy will be shown in the list of policies. - -policy-saved - -Once a policy is created, it is active. To deactivate a policy, you can delete it. All embeddings jobs are listed under **Cody > Embeddings Jobs**. - -### How pattern matching works? - -Let's walk through some examples to see how the pattern works. - -#### Example 1 - -- Original: `github.com/sourcegraph/sourcegraph` -- Pattern: `github.com/sourcegraph/*` -- Result: The pattern matches the original and all other repositories under the `github.com/sourcegraph/` organization. - -#### Example 2 - -- Original: `github.com/sourcegraph/sourcegraph` -- Pattern: `github.com/sourcegraph/sourcegraph` -- Result: The pattern matches only the original repository link. - -#### Example 3 - -- Original: `github.com/sourcegraph/sourcegraph` -- Pattern: `*sourcegraph*` -- Result: The pattern matches the original and any repository, from any code host, with the word `sourcegraph` in it. - -In all the above examples, the defined policy will be applied to all repositories that match the pattern. -If you choose not to define a pattern, the policy will be applied to up to [embeddings.policyRepositoryMatchLimit](/cody/embeddings/usage-and-limits#configure-global-policy-match-limit) repositories. - -It's recommended embedding repositories that are only being actively developed, -as embedding all repositories without discrimination can consume significant resources without necessarily providing better context for Cody. - -### Lifecycle of an embeddings policy - -A worker process periodically checks the embeddings policies and resolves them into a list of repositories to index. - -Another worker then creates a new index job for each repository and queues it for processing. -A repository cannot be queued for processing if: - -- It is already queued or being processed -- A job for the same repository and the same revision already completed successfully -- If another job for the same repository has been queued for processing within the [embeddings.MinimumInterval](/cody/embeddings#minimum-time-interval-between-automatically-scheduled-embeddings) time window - -![policy-saved](https://storage.googleapis.com/sourcegraph-assets/docs/images/embeddings/embeddings-jobs.png) - -## Schedule embeddings jobs - -Admins can manually schedule one-off embeddings jobs for specific repositories from the website admin. These embeddings will not be automatically updated. - -- Go to **Cody > Embeddings Jobs** from the left navigation menu of your site's admin -- Type your repository name in the search bar you want to index. You can select multiple repositories -- Finally, click the **Schedule Embedding** button - -The new jobs will be shown in the list of jobs below. The initial status of the jobs will be `QUEUED` and will change to `COMPLETED` once the job is ready. - -![schedule one-off embeddings jobs](https://storage.googleapis.com/sourcegraph-assets/docs/images/embeddings/schedule-one-off-jobs.png) - -Whether created manually or through a policy, embeddings will be generated incrementally if [incremental updates](/cody/embeddings#incremental-embeddings) are enabled. - -> NOTE: Generating embeddings sends code snippets to a third-party language party provider. By enabling Cody, you agree to the [Cody Notice and Usage Policy](https://about.sourcegraph.com/terms/cody-notice). diff --git a/docs/cody/embeddings/embedding-index.mdx b/docs/cody/embeddings/embedding-index.mdx deleted file mode 100644 index e50b638e0..000000000 --- a/docs/cody/embeddings/embedding-index.mdx +++ /dev/null @@ -1,67 +0,0 @@ -# Generate an Embeddings Index - -

This guide will explain how to generate an embeddings index that enables codebase-aware answers for Cody.

- -Codebase-aware answers utilize Code Graph Context to empower Cody with a deeper understanding of the code within selected codebases. - -By following the steps outlined in this guide, you can configure the necessary prerequisites, enabling Cody to provide more precise and contextually relevant answers to your coding queries, all tailored to the specific codebase you are currently working in. - -## Generate embeddings index - -Embedding your codebase is recommended to enhance Cody's understanding of existing code. The process varies and depends on whether you are using a Sourcegraph Enterprise or Sourcegraph.com instance: - -### Sourcegraph Enterprise - -To embed your codebase and enable codebase-aware answers for Cody, you need to perform the following steps: - -- [Enable Cody](/cody/clients/enable-cody-enterprise#step-1-enable-cody-on-your-sourcegraph-instance) for your Sourcegraph Enterprise instance -- Set up the [Code Graph Context](/cody/core-concepts/code-graph) from your **Site admin** -- Embed your codebase by either [scheduling a one-off embeddings job](/cody/embeddings/configure-embeddings#schedule-embeddings-jobs) or [creating an embeddings policy](/cody/embeddings/configure-embeddings#policies) to keep your index up-to-date automatically - -### Sourcegraph.com - -For Sourcegraph.com users, view the current [list of repositories with code graph context available](/cody/embedded-repos). If you'd like to add more repositories to this list, reach out to a Sourcegraph team member in the [Sourcegraph Discord](https://discord.gg/8wJF5EdAyA) in the `#cody-embeddings` channel. - -Sourcegraph.com does not support connections to private repositories - -## Enable codebase-aware answers - -When connected to the correct codebase, Cody provides accurate and relevant answers to your coding questions, taking into account the context of the codebase you are currently working in. - -Cody attempts to connect to the appropriate codebase automatically using Git, eliminating the need to manually configure the `Cody: Codebase` (`cody.codebase`) option. - -You only need to configure the `Cody: Codebase` (`cody.codebase`) setting if you see `NOT INDEXED` below the chat window. - -## Cody VS Code extension settings - -Cody tries to connect to the correct codebase using Git at start-up, so the manual configuration of `cody.codebase` is not required. - -To enable Cody to set the codebase config using `git remote get-url origin`, ensure that the `Cody: Codebase` (`cody.codebase`) configuration field is unset in your VS Code User and Workspace settings, and remote workspace and folder-level settings if applicable. - -If this attempt fails and you see `Embeddings Not Found` below your Cody chatbox, you can manually specify the correct codebase for Cody using the `Cody: Codebase` (`cody.codebase`) configuration option. - -### Manual Configuration - -To manually configure the `codebase` setting for Cody VS Code extension via the [extension settings](https://code.visualstudio.com/docs/getstarted/settings#_extension-settings), follow these steps: - -- Open the VS Code workspace settings by clicking: `Code` > `Settings` > `Settings` (for macOS) or `File` > `Preferences (Settings)` ( for Windows and Linux) -- Switch to the Workspace settings tab -- Type `Cody: Codebase` in the search bar -- Next, enter the repository name as listed in your Sourcegraph instance in the `Cody: Codebase` field - -For example, the name for the [Sourcegraph repository on Sourcegraph.com](https://sourcegraph.com/github.com/sourcegraph/sourcegraph) is `github.com/sourcegraph/sourcegraph`, so enter it into the setting field without the https protocol as follows: - -``` -github.com/sourcegraph/sourcegraph -``` - -### `settings.json` - -Alternatively, you can configure the `codebase` manually via [`settings.json`](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson) file using the `cody.codebase` configuration contribution point: - -```json -{ - "cody.serverEndpoint": "https://sourcegraph.com", - "cody.codebase": "github.com/sourcegraph/sourcegraph" -} -``` diff --git a/docs/cody/embeddings/index.mdx b/docs/cody/embeddings/index.mdx deleted file mode 100644 index 7bf69f1f7..000000000 --- a/docs/cody/embeddings/index.mdx +++ /dev/null @@ -1,122 +0,0 @@ -# Embeddings - -

Learn how you can use embeddings with Cody for better code understanding.

- -## What are embeddings? - -Embeddings are a semantic representation of text that allow 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 a managed object storage service. - -## Enable embeddings - -By default, no embeddings are created. Embeddings are automatically enabled and configured when Cody is enabled. Admins must choose which code is sent to the third-party language model (LLM) for embedding (currently OpenAI). Once Sourcegraph provides first-party embeddings, they will be enabled for all repositories by default. - -## Incremental embeddings - -Incremental embeddings allow you to update the embeddings for a repository without re-embedding the entire repository. With incremental embeddings, outdated embeddings of deleted and modified files are removed, and new embeddings of modified and added files are added to the repository's embeddings. This speeds up updates, reduces data sent to the embedding provider, and saves costs. - -Incremental embeddings are enabled by default, but you can disable them if needed by setting -the `incremental` property in the embeddings configuration to `false`. - -```json -{ - // [...] - "embeddings": { - // [...] - "incremental": false - } -} -``` - -## Minimum time interval between automatically scheduled embeddings - -You can adjust the minimum time between automatically scheduled embeddings. If you've configured a repository for automated embeddings, the repository will be scheduled for embedding with every new -commit. - -By default, there is a 24-hour time interval that must pass between two embeddings. For example, if a repository is scheduled for embedding at 10:00 AM and a new commit happens at 11:00 AM, the next embedding will be scheduled earliest for 10:00 AM the next day. - -You can configure the minimum time interval by setting the `minimumInterval` property in the embeddings configuration. - -Supported time units are h (hours), m ( minutes), and s (seconds). - -```json -{ - // [...] - "embeddings": { - // [...] - "minimumInterval": "24h" - } -} -``` - -## Third-party embeddings provider - -Instead of [Sourcegraph Cody Gateway](/cody/core-concepts/cody-gateway), admins can also use a third-party embeddings provider like: - -- OpenAI -- Azure OpenAI (Experimental) - -### OpenAI - -To use embeddings with OpenAI: - -- First, create your own key with OpenAI [here](https://beta.openai.com/account/api-keys) -- Next, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance -- Finally set the following configuration: - -```json -{ - // [...] - "cody.enabled": true, - "embeddings": { - "provider": "openai", - "accessToken": "", - "excludedFilePathPatterns": [] - } -} -``` - -### Azure OpenAI - - -Azure OpenAI support is in the experimental stage. - - -To use embeddings with Azure OpenAI: - -- First, create a project in the Azure OpenAI portal -- Then, from the project overview, go to **Keys and Endpoint** -- From here get **one of the keys** and the **endpoint** -- Next, under **Model deployments** click **manage deployments** -- Make sure you deploy the models you want to use. For example, `text-embedding-ada-002`. Also, take note of the **deployment name** -- Finally, go to **Site admin > Site configuration** (`/site-admin/configuration`) on your instance and set: - -```json -{ - "cody.enabled": true, - "embeddings": { - "provider": "azure-openai", - "model": "", - "endpoint": "", - "accessToken": "", - "dimensions": 1536, - "excludedFilePathPatterns": [] - } -} -``` - -For the access token, you can either: - -- As of 5.2.4 the access token can be left empty and it will rely on Environmental, Workload Identity or Managed Identity credentials configured for the `frontend` service -- Set it to `` if directly configuring the credentials using the API key specified in the Azure portal - -Azure OpenAI is in experimental stage. It's not recommended to use in a production setting. - -### Disable embeddings - -Embeddings can be disabled, even with Cody enabled, by using the following site configuration: - -```json -{ - "embeddings": { "enabled": false } -} -``` diff --git a/docs/cody/embeddings/manage-embeddings.mdx b/docs/cody/embeddings/manage-embeddings.mdx deleted file mode 100644 index e4096d8b4..000000000 --- a/docs/cody/embeddings/manage-embeddings.mdx +++ /dev/null @@ -1,93 +0,0 @@ -# Manage Embeddings - -

Learn how you can manage embeddings via filtering and storing embedding indexes.

- -## Filter files from embeddings - -The `fileFilters` setting in the Sourcegraph embeddings configuration allows you to filter file paths meeting certain conditions from being used in generating embeddings. You can exclude files that have low information value, such as test fixtures, mocks, auto-generated files, and other irrelevant files paths by specifying glob patterns in `excludedFilePathPatterns` and `includedFilePathPatterns`. - -To use `fileFilters`, add it to your embeddings site configuration. For example, to exclude all files under `node_modules`, include only `.go` files, and limit the maximum file size to 300KB, you would add the following setting to your configuration file. - -```json -{ - // [...] - "embeddings": { - // [...] - "fileFilters": { - "excludedFilePathPatterns": [ - "node_modules/" - ], - "includedFilePathPatterns": [ - "*.go" - ], - "maxFileSizeBytes": 300000 //300 KB - } - } -} -``` - -By default, the following patterns are excluded from embeddings: - -- *ignore" // Files like .gitignore, .eslintignore -- .gitattributes -- .mailmap -- *.csv -- *.svg -- *.xml -- \_\_fixtures\_\_/ -- node_modules/ -- testdata/ -- mocks/ -- vendor/ - -The `excludedFilePathPatterns` setting is only available in Sourcegraph version `5.0.1` and later. - -## Store embedding indexes - -To store embedding indexes, you'll need to set environment variables for configuration and authentication to the target service. The settings vary depending on the service you choose. - -- If you are running a `sourcegraph/server` deployment, set the environment variables on the server container -- Otherwise, if you are running via Docker-compose or Kubernetes, set the environment variables on the `frontend`, `embeddings`, and `worker` containers - -Here are the storing embedding instructions for S3 and GCS: - -### Using S3 - -To target an S3 bucket you've already provisioned, set the following environment variables. Authentication can be done through an [access and secret key pair](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys) (and optional session token), or via the EC2 metadata API. - -Make sure that you never commit your AWS access keys in Git. Instead, consider using a secret handling service offered by your cloud provider. - -- `EMBEDDINGS_UPLOAD_BACKEND=S3` -- `EMBEDDINGS_UPLOAD_BUCKET=` -- `EMBEDDINGS_UPLOAD_AWS_ENDPOINT=https://s3.us-east-1.amazonaws.com` -- `EMBEDDINGS_UPLOAD_AWS_ACCESS_KEY_ID=` -- `EMBEDDINGS_UPLOAD_AWS_SECRET_ACCESS_KEY=` -- `EMBEDDINGS_UPLOAD_AWS_SESSION_TOKEN=` (optional) -- `EMBEDDINGS_UPLOAD_AWS_USE_EC2_ROLE_CREDENTIALS=true` (optional — set to use EC2 metadata API over static credentials) -- `EMBEDDINGS_UPLOAD_AWS_REGION=us-east-1` (default) - -If a non-default region is supplied, ensure that the subdomain of the endpoint URL (the `AWS_ENDPOINT` value) matches the target region. - -You don't need to set the `EMBEDDINGS_UPLOAD_AWS_ACCESS_KEY_ID` environment variable when using `EMBEDDINGS_UPLOAD_AWS_USE_EC2_ROLE_CREDENTIALS=true` because role credentials will be automatically resolved. - -### Using GCS - -To target a GCS bucket you've already provisioned, set the following environment variables. Authentication is done through a service account key, supplied as either a path to a volume-mounted file, or the contents read in as an environment variable payload. - -- `EMBEDDINGS_UPLOAD_BACKEND=GCS` -- `EMBEDDINGS_UPLOAD_BUCKET=` -- `EMBEDDINGS_UPLOAD_GCP_PROJECT_ID=` -- `EMBEDDINGS_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE=` -- `EMBEDDINGS_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE_CONTENT=<{"my": "content"}>` - -### Provisioning buckets - -If you would like to allow your Sourcegraph instance to control the creation and lifecycle configuration management of the target buckets, set the following environment variables: - -``` -EMBEDDINGS_UPLOAD_MANAGE_BUCKET=true -``` - -### Environment variables for the `embeddings` service - -`EMBEDDINGS_CACHE_SIZE` defines the maximum size of the in-memory cache that holds the embeddings for commonly-searched repos. If embeddings for a repo are larger than this size, the repo will not be held in the cache and must be re-fetched for each embeddings search. The default acceptable size is `6GiB`. diff --git a/docs/cody/embeddings/usage-and-limits.mdx b/docs/cody/embeddings/usage-and-limits.mdx deleted file mode 100644 index d2d9034c2..000000000 --- a/docs/cody/embeddings/usage-and-limits.mdx +++ /dev/null @@ -1,34 +0,0 @@ -# Usage and Limits - -

Learn about all the usage polices and limits that apply while using embeddings.

- -## Configure global policy match limit - -A global policy refers to an embeddings policy without a pattern. By default, it is applied to up to 5000 repositories. The repositories matching the policy are first sorted by star count (descending) and id (descending) and then the first 5000 repositories are selected. - -You can configure the limit by setting the `policyRepositoryMatchLimit` property in the embeddings configuration. A negative value disables the limit and all repositories are selected. - -```json -{ - // [...] - "embeddings": { - // [...] - "policyRepositoryMatchLimit": 5000 - } -} -``` - -## Limit the number of embeddings that can be generated - -The number of embeddings that can be generated per repo is limited to `embeddings.maxCodeEmbeddingsPerRepo` for code embeddings (default 3.072.000) or `embeddings.maxTextEmbeddingsPerRepo` (default 512.000) for text embeddings. - -Use the following site configuration to update the limits: - -```json -{ - "embeddings": { - "maxCodeEmbeddingsPerRepo": 3072000, - "maxTextEmbeddingsPerRepo": 512000 - } -} -``` diff --git a/docs/cody/faq.mdx b/docs/cody/faq.mdx index b5196338a..0e67b946b 100644 --- a/docs/cody/faq.mdx +++ b/docs/cody/faq.mdx @@ -54,40 +54,29 @@ Embeddings help Sourcegraph retrieve relevant code to feed the Large Language Mo While embeddings excel in semantic matching — determining "what is this code about" and "what does it do" — they may not capture syntax and other specific matching details as effectively. Sourcegraph's approach involves getting the best results from various sources to deliver the most accurate and comprehensive answers possible. -### Do embeddings enforce permissions? Does Cody receive code that users don't have access to? +### Why were embeddings removed once my instance was upgraded to v5.3? -When using embeddings, permissions are enforced to ensure Cody does not receive code the user cannot access. Currently, Sourcegraph uses embeddings search for a single repository, with a prior check to confirm user access. +Cody now leverages **Sourcegraph Search** as a primary context provider, which comes with the following benefits: -In the future, the process will involve the following steps: +- **More secure**: No code being sent to a third-party embedding API +- **Easier to manage**: Less tech debt for embeddings setup and need for refreshes +- **More repos**: Sourcegraph Search scales to larger repos and a greater number. Users on Enterprise instances will now be able to select multiple repos as context sources from within the IDE +- **Equal, or better, quality**: Sourcegraph Search provides high-quality retrieval, as tested over the last ten years. When a customer sees degradation, we will be ready to respond quickly. -- Determine which repositories the user has access to -- Query embeddings for each of these repositories -- Select the most relevant results and provide them to the user +Embeddings are just one mechanism for retrieval. We leverage multiple retrieval mechanisms to give Cody the right context and will be constantly iterating to improve Cody's quality. The most important aspect is getting the files from the codebase, not the specific algorithm used to find those files. -This approach safeguards data privacy and ensures that Cody's responses are based on code accessible to the user. +### Why are embeddings no longer supported on Cody Enterprise? -### Why isn't my scheduled embedding job listed? +There are two driving factors: -There can be several reasons why your scheduled one-off embedding job isn't appearing in the job list: +- The need for a retrieval system that can scale across repos and to repos of greater size +- A system that is secure and requires low maintenance on the part of users -- The repository is already in the queue or currently being processed -- The system has successfully completed a job for the same repository and revision -- Another job for the same repository is in the queue, scheduled within the [`embeddings.MinimumInterval`](/cody/embeddings#minimum-time-interval-between-automatically-scheduled-embeddings) time window +Leveraging Sourcegraph Search allowed us to deliver these enhancements. Early evidence suggests that this context fetching works as well as embeddings and is sometimes better. -### How do I stop a running embeddings job? +### Why are embeddings only supported for Cody Free and Cody Pro users in VS Code and not for JetBrains? -A running embeddings job with the state `QUEUED` or `PROCESSING` can be stopped by admins from the **Cody > Embeddings Jobs** page. To do so: - -- Click on the "Cancel" button associated with the job you wish to terminate -- The job will then be tagged for cancellation. Please note that the time required for the job to be fully canceled may vary depending on its current state, ranging from a few seconds to a few minutes - -### Why are files skipped? - -Files may be skipped for the following reasons: - -- The file size exceeds 1 MB -- The file path matches an [exclusion pattern](/cody/embeddings/manage-embeddings#filter-files-from-embeddings) -- The repository has already reached the maximum limit for generated embeddings, as specified by [`embeddings.maxCodeEmbeddingsPerRepo`](/cody/embeddings/usage-and-limits#limit-the-number-of-embeddings-that-can-be-generated) or [`embeddings.maxTextEmbeddingsPerRepo`](/cody/embeddings/usage-and-limits#limit-the-number-of-embeddings-that-can-be-generated) +Only users on VSCode will have continued access to local embeddings and only as a backup source to our local search index. The rationale here is that we want a place to continue to test embeddings to empirically measure their value and see if there are areas where we should consider returning them. This aligns with our strategy to use PLG as a test bed for features before they come to enterprise customers. ## Third party dependencies diff --git a/docs/cody/troubleshooting.mdx b/docs/cody/troubleshooting.mdx index 73b6f6aab..52b43b812 100644 --- a/docs/cody/troubleshooting.mdx +++ b/docs/cody/troubleshooting.mdx @@ -33,22 +33,6 @@ Follow these steps to resolve the issue: ![Opening up Keychain Access](https://storage.googleapis.com/sourcegraph-assets/blog/cody-docs-troubleshooting-keychain-access.png) -### Codebase is `Not Indexed` - -If you are logged into Sourcegraph.com, only public open source repositories listed [here](/cody/embedded-repos) are indexed. To have your open source repository added to the public index, join the [Sourcegraph Discord](https://discord.gg/8wJF5EdAyA) and ask in the `#embeddings-indexing` channel. - -If you’re connected to a Sourcegraph Enterprise instance, ask your site admin to [Configure Code Graph Context](/cody/core-concepts/code-graph) for your Sourcegraph instance. Then, [enable Cody](/cody/clients/enable-cody-enterprise) for your account. - -If you're connected to the Cody app: - -- Trigger indexing for a repository by adding it to your app under **Settings > Local repositories** -- Navigate to **Settings > Advanced settings > Embeddings jobs** in the app and schedule embedding -- If your repo lacks a `git remote` or still shows as `Not Indexed`, set `Cody: Codebase` to the repository name under **Settings > Local** repositories in the Cody App - -If you've completed the above and are still getting the `NOT INDEXED` error, try updating the `Cody: Codebase` (`cody.codebase`) setting in VS Code to the repository name listed on your Sourcegraph instance. - -For more information, see [Generate Index to Enable Codebase-Aware Answers](/cody/embeddings/embedding-index). - ### Signin fails on each VS Code restart If you find yourself being automatically signed out of Cody every time you restart VS Code, and suspect it's due to keychain authentication issues, you can address this by following the steps provided in the official VS Code documentation on [troubleshooting keychain issues](https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues). These guidelines should help you troubleshoot and resolve any keychain-related authentication issues, ensuring a seamless experience with Cody on VS Code. diff --git a/docs/cody/usage-and-pricing.mdx b/docs/cody/usage-and-pricing.mdx deleted file mode 100644 index b2bbb53a6..000000000 --- a/docs/cody/usage-and-pricing.mdx +++ /dev/null @@ -1,113 +0,0 @@ -# Cody Pricing - -

Learn about the different plans available for Cody.

- -Cody provides three subscription plans: **Free**, **Pro**, and **Enterprise**. Each plan is aimed to cater to a diverse range of users, from individual projects to large-scale enterprises. Cody Free includes basic features, while the Pro and Enterprise plans offer additional advanced features and resources to meet varying user requirements. - -## Free - -The free plan is designed for individuals to get started with Cody. It comes with a set of features to enhance your coding experience. It includes **500 autocompletion suggestions** per month, covering both whole and multi-line suggestions. You also get **20 chats/commands** per month with access to creating Custom Commands. - -The free plan provides access to local context with keyword search and embeddings on open-source code via Sourcegraph.com. You get **200 MB** of embeddings over your lifetime and can manage these from the user settings in VS Code, with JetBrains IDE support coming soon. If you embed 150 MB of code, you can only embed another 50 MB of code. If you delete that 150 MB of code embedding, the original 200 MB of code embeddings will be available again. - -The free plan ensures local context utilization and allows you to seamlessly integrate Cody into your preferred client, whether it's VSCode, JetBrains, or Neovim. Finally, you'll have default support with Anthropic and StarCoder as the officially supported LLMs. - -### Billing cycle - -There is no billing cycle for Cody Free, as it is free to use. If you complete your monthly autocompletions or chat/commands limit, you'll be prompted to upgrade to the Pro plan. Otherwise, you'll have to wait approximately 30 days for the limits to reset. - -The reset date is based on your sign-up date. For example, if you sign up on December 15th, your limit will reset on January 15th. - -### Upgrading from Free to Pro - -![upgrade-cody-pro](https://storage.googleapis.com/sourcegraph-assets/Docs/upgrade-cody-pro.png) - -To upgrade from Cody Free to Pro: - -- Log in to your [Cody dashboard](https://sourcegraph.com/cody/manage) -- Click the **Upgrade** button in the top right corner -- It takes you to the [Subscription plans](https://sourcegraph.com/cody/subscription) page -- Under the Pro tier, click **Get Pro** -- Enter your card details for billing -- Click confirm and upgrade to Cody Pro for **$9 per month** - -Once your Pro subscription is confirmed, click **My subscription** to manage and view your activation details, or click **Dashboard** for the overall view. - -## Pro - -Cody Pro, designed for individuals or small teams at **$9 per user per month**, offers an enhanced coding experience beyond the free plan. It provides unlimited autocompletion suggestions, allowing users to streamline their coding process without restrictions. Chat and commands executions are also unlimited, allowing users to create custom workflows. - -The plan includes the ability to create an unlimited number of Custom Commands for personalized workflows. In addition to using the local context of your code to improve responses, you can embed up to **1 GB** of your private code for even better Cody responses that reflect a deep understanding of your code in VS Code, with JetBrains IDE support coming soon. - -Support for Cody Pro is available through Discord, ensuring prompt assistance and guidance. Finally, you'll have default support with Anthropic and StarCoder as the officially supported LLMs. Moreover, Pro accounts using VS Code IDE will get an LLM selection for chat only. These LLMs are Claude Instant 1.2, Claude 2, ChatGPT 3.5 Turbo, ChatGPT 4 Turbo Preview, and Mixtral. - -There will be high daily limits to catch bad actors and prevent abuse, but under most normal usage, Pro users won't experience these limits. - -### Downgrading from Pro to Free - -To revert back to Cody Free from Pro: - -- Go to your Sourcegraph dashboard **Cody > Manage** -- Next, **Manage subscription** that takes you to **Cody > Subscription** -- Clicks **Cancel** on the Pro tier to cancel your Pro subscription -- This automatically downgrades you to Cody Free once after your billing cycle ends - -### Upgrading from Pro to Enterprise - -To upgrade from Cody Pro to Cody Enterprise, you should [Contact Sales](https://sourcegraph.com/contact/request-info) and connect with one of our account teams. They will help you set up your account and start with Cody Enterprise. - -## Billing FAQs for Cody Pro - -### What is Cody's pricing plan? - -You can get this info from our [pricing page](https://sourcegraph.com/pricing?product=cody). - -### When are payments taken? - -We charge payments at the beginning of each billing cycle, and they get automatically renewed once you've added your credit card details. - -### What is a billing cycle? - -The billing cycle refers to the start date you start your Cody Pro plan. Your Cody Pro plan will automatically renew at each billing date. You can view your current and previous billing cycles from the **My subscription** tab. - -### What payment methods are available? - -We currently only support payments through a credit card. - -### What happens when I cannot pay or don't want to renew the Pro plan? - -If you do not want to renew Cody Pro, you can cancel your Cody Pro subscription at any time by going to the [accounts page](https://accounts.sourcegraph.com/cody/subscriptions). If you cancel the Pro plan, your Cody Pro will continue until the end of the billing cycle. Once the billing cycle ends, your plan will not renew, and your card will not be charged. This automatically downgrades your plan from Cody Pro to Cody Free. - -If you change your mind after canceling your plan and you have a credit card on file, you can click **Resume subscription** from the [accounts page](https://accounts.sourcegraph.com/cody/subscriptions) to re-upgrade to Cody Pro. - -### Are there any refunds for the Pro subscription? - -We don't offer refunds, but if you have any queries regarding the Cody Pro plan, please write to support@sourcegraph.com, and we'll help resolve the issue. - -## Enterprise - -Cody Enterprise is designed for enterprises prioritizing security and administrative controls. We offer either seat-based or token based pricing models, depending on what makes most sense for your organization. You get additional capabilities like BYOLLM (Bring Your Own LLM), supporting Single-Tenant and Self Hosted setups for flexible coding environments. - -Security features include SAML/SSO for enhanced authentication and guardrails to enforce coding standards. Cody Enterprise supports advanced Code Graph context and multi-code host context for a deeper understanding of codebases, especially in complex projects. With 24/5 enhanced support, Cody Enterprise ensures timely assistance. - -## Plans Comparison - -The following table shows a high-level comparison of the three plans available on Cody. - -| **Features** | **Free** | **Pro** | **Enterprise** | -| --------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------- | -| **Autocompletion suggestions** | 500 per month (whole + multi-line) | Unlimited | Unlimited | -| **Chat/Command Executions** | 20 per month | Unlimited | Unlimited | -| **Custom Commands** | Supported | Supported | Supported | -| **Embeddings (public code)** | Supported | Supported | Supported | -| **Keyword Context (local code)** | Supported | Supported | Supported | -| **Developer Limitations** | 1 developer | Up to 50 devs | Scalable, consumption-based pricing | -| **LLM Support** | Anthropic + Starcoder for Chat, Commands, and Autocomplete | Choice of LLMs for Chat (VS Code only), Anthropic + Starcoder for Commands and Autocomplete | Bring Your Own LLM Key (experimental) | -| **Code Editor Support** | VS Code, JetBrains IDEs, and Neovim | VS Code, JetBrains IDEs, and Neovim | VS Code, JetBrains IDEs, and Neovim | -| **Single-Tenant and Self Hosted** | N/A | N/A | Yes | -| **SAML/SSO** | N/A | N/A | Yes | -| **Guardrails** | N/A | N/A | Yes | -| **Advanced Code Graph Context** | N/A | N/A | Included | -| **Multi-Code Host Context** | N/A | N/A | Included | -| **Discord Support** | No | Yes | Yes | -| **24/5 Enhanced Support** | N/A | N/A | Yes | diff --git a/src/data/navigation.ts b/src/data/navigation.ts index 89935a1ac..eb599204b 100644 --- a/src/data/navigation.ts +++ b/src/data/navigation.ts @@ -55,20 +55,12 @@ export const navigation: NavigationItem[] = [ title: "Core Concepts", href: "/cody/core-concepts/context", subsections: [ { title: "Context", href: "/cody/core-concepts/context", }, + { title: "Embeddings", href: "/cody/core-concepts/embeddings", }, { title: "Keyword Search", href: "/cody/core-concepts/keyword-search", }, { title: "Code Graph", href: "/cody/core-concepts/code-graph", }, { title: "Cody Gateway", href: "/cody/core-concepts/cody-gateway", }, ] }, - { - title: "Embeddings", href: "/cody/embeddings", - subsections: [ - { title: "Generate Embeddings Index", href: "/cody/embeddings/embedding-index", }, - { title: "Configure Embeddings", href: "/cody/embeddings/configure-embeddings", }, - { title: "Manage Embeddings", href: "/cody/embeddings/manage-embeddings", }, - { title: "Usage and Limits", href: "/cody/embeddings/usage-and-limits", }, - ] - }, { title: "Use Cases", href: "/cody/use-cases/generate-unit-tests", subsections: [