Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
68ebc97
Docs for Omnibox
MaedahBatool Jan 20, 2025
57c3d55
Add documentation for error lookups workflow in omnibox
jdorfman Jan 20, 2025
e40d96a
Add documentation for file search workflow in omnibox/chat
jdorfman Jan 21, 2025
badbeb0
Add documentation for symbol search workflow in chat
jdorfman Jan 21, 2025
c4c1bb5
Add documentation for string literal search workflow in Chat
jdorfman Jan 22, 2025
b0290fa
Merge branch 'main' into omnibox-docs
MaedahBatool Jan 23, 2025
2bb8654
new nav structure
MaedahBatool Jan 23, 2025
7b85aa4
Update formatting and structure of chat query types documentation
jdorfman Jan 23, 2025
2cad1e1
Update Chat (main overview page) documentation with new features and …
jdorfman Jan 23, 2025
72bab86
Add documentation for intent detection, smart search integration, and…
jdorfman Jan 24, 2025
d5f901d
Update intent detection feature documentation with new screenshots
jdorfman Jan 24, 2025
fbead65
Add smart search integration and context-aware responses
jdorfman Jan 24, 2025
1df444a
Update query types documentation with new demos and content
jdorfman Jan 24, 2025
d8ea0bc
Merge branch 'main' into omnibox-docs
MaedahBatool Jan 27, 2025
9d04201
Add tabs layout
MaedahBatool Jan 27, 2025
3c716fa
Add edits to index.mdx
MaedahBatool Jan 27, 2025
93656dd
Redo key features as bullets
MaedahBatool Jan 27, 2025
3a984ee
more structure
MaedahBatool Jan 27, 2025
2d9a9e4
revert to old nav
MaedahBatool Jan 27, 2025
66cb14d
Restructure query types docs
MaedahBatool Jan 27, 2025
09617ba
Update image URLs in install-vscode.mdx (Lunch break commit)
jdorfman Jan 27, 2025
4b543b3
Stashing pnpm-lock
jdorfman Jan 27, 2025
a2605d6
Update image URLs in install-vscode.mdx
jdorfman Jan 27, 2025
b28d269
Update image URLs in install-jetbrains.mdx (commit 1/2)
jdorfman Jan 27, 2025
1e9a552
Update image URLs in install-jetbrains.mdx (commit 2/2)
jdorfman Jan 28, 2025
d3efe38
Update screenshots in cody-with-sourcegraph.mdx
jdorfman Jan 28, 2025
c7edfa3
Update image URL in cody-enterprise-features.mdx
jdorfman Jan 28, 2025
6c5ac06
Update image URLs in docs/cody/capabilities/chat.mdx
jdorfman Jan 28, 2025
f1d49c0
Update images and URLs in prompts.mdx
jdorfman Jan 28, 2025
6c8e25b
Update images & URLs in docs/code-search/working/saved_searches.mdx
jdorfman Jan 28, 2025
5cd18c1
Merge branch 'main' into omnibox-docs
MaedahBatool Jan 28, 2025
26a48c8
Update docs/cody/capabilities/chat.mdx
jdorfman Jan 28, 2025
0a6b219
Update pricing and extension links [alex suggestion]
jdorfman Jan 28, 2025
8f9e318
Add note about experimental terminal command execution [Alex suggestion]
jdorfman Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/code-search/working/saved_searches.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Saved Searches lets you reuse and share search queries. You can create a saved s

Saved Searches functionality is available to both Free and Enterprise Code Search users. To access or create new Saved Searches in the Sourcegraph web app, click the **Tools > Saved Searches** in the top navigation bar.

![saved-searhces](https://storage.googleapis.com/sourcegraph-assets/Docs/saved-searches-0824.png)
![saved-searhces](https://storage.googleapis.com/sourcegraph-assets/Docs/saved-searches-2025.png)

## Creating saved searches

Expand All @@ -18,7 +18,7 @@ To create a new saved search:

A `patternType:` filter is required in the query for all saved searches. `patternType` can be `keyword`, `standard`, `literal`, or `regexp`. You cannot create a saved search without defining the `patternType:` field.

![create-new-saved-search](https://storage.googleapis.com/sourcegraph-assets/Docs/create-new-saved-search-0824.png)
![create-new-saved-search](https://storage.googleapis.com/sourcegraph-assets/Docs/create-new-saved-search-2025.png)

Enable the checkbox for **Draft** if you don't want other users to use your saved search. This is useful for testing the query before sharing it with others. Once done, click the **Create saved search** button to be redirected to the Saved Searches page.

Expand All @@ -32,7 +32,7 @@ In addition, you can also search within your saved searches and sort your saved

To transfer ownership of a saved search, click the **Edit** button next to it, click the **Transfer ownership** button, and select the organization to which you want to transfer the saved search.

![transfer-ownership](https://storage.googleapis.com/sourcegraph-assets/Docs/transfer-ownership-saved-search-0824.png)
![transfer-ownership](https://storage.googleapis.com/sourcegraph-assets/Docs/transfer-ownership-saved-search-2025.png)

## Example saved searches

Expand Down
112 changes: 102 additions & 10 deletions docs/cody/capabilities/chat.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Chat

<p className="subtitle">Use Cody's chat to get contextually-aware answers to your questions.</p>
<p className="subtitle">Chat with the AI assistant in your code editor or via the Sourcegraph web app to get intelligent suggestions, code autocompletions, and contextually aware answers.</p>

You can **chat** with Cody to ask questions about your code, generate code, and edit code. By default, Cody has the context of your open file and entire repository, and you can use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts.
<Tabs>
<Tab title="Free/Pro">
You can **chat** with Cody to ask questions about your code, generate code, and edit code. By default, Cody has the context of your open file and entire repository, and you can use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts.

You can do it from the **chat** panel of the supported editor extensions ([VS Code](/cody/clients/install-vscode), [JetBrains](/cody/clients/install-jetbrains), [Visual Studio](/cody/clients/install-visual-studio), [Eclispe](/cody/clients/install-eclipse)) or in the [web](/cody/clients/cody-with-sourcegraph) app.

## Prerequisites

To use Cody's chat, you'll need the following:

- A Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account
- A supported editor extension (VS Code, JetBrains, Visual Studio) installed
- [Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing)
- A supported editor extension [VS Code](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai), [JetBrains](https://plugins.jetbrains.com/plugin/9682-cody-ai-coding-assistant-with-autocomplete--chat) installed or use via Web app

## How does chat work?

Expand All @@ -31,7 +33,7 @@ There are several features that you can use to make your chat experience better.

When you start a new Cody chat, the input window opens with a default `@-mention` context chips for the opened file and the current repository.

![context-retrieval](https://storage.googleapis.com/sourcegraph-assets/Docs/context-retrieval-102024.png)
![context-retrieval](https://storage.googleapis.com/sourcegraph-assets/Docs/context-retrieval-repo-file-2025.png)

At any point in time, you can edit these context chips or remove them entirely if you do not want to use these as context. Any chat without a context chip will instruct Cody to use no codebase context. However, you can always provide an alternate `@-mention` file or symbols to let Cody use it as a new context source.

Expand All @@ -43,7 +45,7 @@ You can add new custom context by adding `@-mention` context chips to the chat.

## OpenCtx context providers

<Callout type="info">OpenCtx context providers are in the Experimental stage for all Cody VS Code users. Enterprise users can also use this, but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/c/openctx/10).</Callout>
<Callout type="info">OpenCtx context providers are in the Experimental stage for all Cody VS Code users. Enterprise users can also use this but with limited support. If you have feedback or questions, please visit our [support forum](https://community.sourcegraph.com/c/openctx/10).</Callout>

[OpenCtx](https://openctx.org/) is an open standard for bringing contextual info about code into your dev tools. Cody Free and Pro users can use OpenCtx providers to fetch and use context from the following sources:

Expand All @@ -68,19 +70,19 @@ You can still switch to your Sourcegraph account whenever you want to use Claude

## LLM selection

Cody allows you to select the LLM you want to use for your chat, optimized for speed versus accuracy. Cody Free and Pro users can select multiple models. Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model.
Cody allows you to select the LLM you want to use for your chat, which is optimized for speed versus accuracy. Cody Free and Pro users can select multiple models. Enterprise users with the new [model configuration](/cody/clients/model-configuration) can use the LLM selection dropdown to choose a chat model.

You can read about these supported LLM models [here](/cody/capabilities/supported-models#chat-and-commands).

![LLM-models-for-cody-free](https://storage.googleapis.com/sourcegraph-assets/Docs/llm-dropdown-options-102024.png)
![LLM-models-for-cody-free](https://storage.googleapis.com/sourcegraph-assets/Docs/llm-dropdown-options-free-pro-2025.png)

## Smart Apply and Execute code suggestions

Cody lets you dynamically insert code from chat into your files with **Smart Apply**. Whenever Cody provides a code suggestion, you can click the **Apply** button. Cody will then analyze your open code file, find where that relevant code should live, and add a diff. For chat messages where Cody provides multiple code suggestions, you can apply each in sequence to go from chat suggestions to written code.

Smart Apply also supports the executing of commands in the terminal. When you ask Cody a question related to terminal commands, you can now execute the suggestion in your terminal by clicking the `Execute` button in the chat window.

![smart-apply](https://storage.googleapis.com/sourcegraph-assets/Docs/smart-apply-102024.png)
![smart-apply](https://storage.googleapis.com/sourcegraph-assets/Docs/smart-apply-2025.png)

## Chat history

Expand All @@ -103,5 +105,95 @@ You are provided with code suggestions in the chat window and the following opti
If Cody's answer isn't helpful, you can try asking again with a different context:

- **Public knowledge only**: Cody will not use your own code files as context; it’ll only use knowledge trained into the base model.
- **Current file only**: Re-run the prompt again using just the current file as context.
- **Current file only**: Re-run the prompt again using the current file as context.
- **Add context**: Provides @-mention context options to improve the response by explicitly including files, symbols, remote repositories, or even web pages (by URL).
</Tab>
<Tab title="Enterprise Starter/Enterprise">

The enhanced chat experience input can be accessed from the chat panel of the supported editor extensions (VS Code and JetBrains) and the web app. It combines light code search, AI-powered chat, and agentic capabilities into a unified developer interface. It's designed to accelerate the entire developer workflow by providing a more intuitive and powerful way to interact with code.

## Prerequisites

To use Cody's chat, you'll need the following:

- [Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing)
- A supported editor extension [VS Code](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai), [JetBrains](https://plugins.jetbrains.com/plugin/9682-cody-ai-coding-assistant-with-autocomplete--chat) installed or use via Web app

## Key features

The enhanced chat experience includes everything in the Free plan, plus the following:

## Intent detection

Intent detection automatically analyzes user queries and determines whether to provide an AI chat or code search response. This functionality helps simplify developer workflows by providing the most appropriate type of response without requiring explicit mode switching.

### How it works

When a user submits a query in the chat panel, the intent detection component:

- Analyzes the query content and structure
- Determines the most appropriate response type (search or chat)
- Returns results in the optimal format
- Provides the ability to toggle between response types manually

Let's look at an example of how this might work:

#### Search-based response

![Intent detection code search response](https://storage.googleapis.com/sourcegraph-assets/Docs/intent-detection-code-search-response-01242025.jpg)

#### Chat-based response

![Intent detection chat response](https://storage.googleapis.com/sourcegraph-assets/Docs/intent-detection-chat-response-01242025.jpg)

## Smart search integration

The smart search integration enhances Sourcegraph's chat experience by providing lightweight code search capabilities directly within the chat interface. This feature simplifies developer workflows by offering quick access to code search without leaving the chat environment.

The integration delivers personalized search results ranked by your contribution history, with frequently accessed repositories appearing higher in results. Users can view code snippets with relevant context and open files directly in their editor.

Search results automatically become available as context for follow-up queries, with flexible controls for selecting which results to include. While optimized for keyword-style queries and searching across a few repositories, this integration complements rather than replaces the full [Code Search](/code-search) product, which remains the recommended tool for comprehensive enterprise-wide code search.

## Context-aware responses

Search results generated through smart search integration can be automatically used as context for follow-up queries. Here's what happens with each scenario:

### Search responses

* Search results can be used directly as context for follow-up queries
* Users can select which search results to include as context using checkboxes
* By default, all search results are added as context
* A context chip shows the number of search results being used (e.g., "10 code search results")
* Users can remove the context chip if they don't want to use it for follow-ups

### Chat responses

<Callout type="info">Executing terminal commands for additional context is an experimental feature.</Callout>

* Performs background searches for context
* Retrieves full context from files, symbols, remote repos, and web pages
* Can execute terminal commands (with permission) for additional context
* Creates personal notes usable across chat sessions
* Pulls in [OpenCtx](/cody/capabilities/openctx) providers for additional context

## How does chat work?

The following is a general walkthrough of the chat experience:

1. The user enters a query in the chat interface
2. The system analyzes the query through intent detection
3. If it's a search query:
- Displays ranked results with code snippets
- Shows personalized repository ordering
- Provides checkboxes to select context for follow-ups
4. If it's a chat query:
- Delivers AI-powered responses
- Can incorporate previous search results as context
5. Users can:
- Switch between search and chat modes
- Click on results to open files in their editor
- Ask follow-up questions using selected context
- Use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts

</Tab>
</Tabs>
14 changes: 8 additions & 6 deletions docs/cody/capabilities/prompts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Go to **Tools > Prompt Library** from the top navigation bar in the Sourcegraph.

Here, you can view all prompts (shared with you in an organization or created by you) and some core (built-in) prompts to help you get started.

![prompt-library-overview](https://storage.googleapis.com/sourcegraph-assets/Docs/prompt-library-overview-1124.png)
![prompt-library-overview](https://storage.googleapis.com/sourcegraph-assets/Docs/prompt-library-overview-2025.png)

### Core (built-in) prompts

Expand Down Expand Up @@ -45,7 +45,7 @@ Click the **New prompt** button from the **Prompt Library** page.

There are also a few advanced options that you can configure.

![create-prompt](https://storage.googleapis.com/sourcegraph-assets/Docs/create-prompt-1124-2.png)
![create-prompt](https://storage.googleapis.com/sourcegraph-assets/Docs/create-prompt-2025-01.png)

### Draft prompts

Expand All @@ -61,7 +61,7 @@ Once the prompt is visible, it's ready to be used by:
- **All members of the organization** if the prompt's owner is an organization
- **Everyone** if the prompt is marked **Public** (which only site admins can do)

![prompts-in-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/prompts-in-vscode-1124.png)
![prompts-in-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/prompt-in-vscode-2025.jpg)

## Edit prompts

Expand All @@ -78,15 +78,15 @@ Site admins can categorize prompts and create **tags**. This helps you keep your
- All the new and existing tags are listed here. You can also search for a specific tag by typing its name in the search box
- Click **New tag**, type the **Tag name** and hit the **Create** button

![prompt-tags](https://storage.googleapis.com/sourcegraph-assets/Docs/prompts-tags.png)
![prompt-tags](https://storage.googleapis.com/sourcegraph-assets/Docs/prompts-tags-2025.png)

Once created, it will appear in the **Tags** list and in the sidebar of the Prompt Library. To manage your prompt tags, you can **edit**, **delete**, or **copy link to prompts with this tag**.

### Assigning tags to prompts

Once site admins create tags, other users in your organization can assign tags to their prompts. While creating or editing a prompt, there is a drop-down selector **Add prompt to...** to assign tags to the prompt.

![assign-prompt-tags](https://storage.googleapis.com/sourcegraph-assets/Docs/assign-prompt-tags.png)
![assign-prompt-tags](https://storage.googleapis.com/sourcegraph-assets/Docs/assign-prompt-tags-2025.png)

You can assign multiple tags to a prompt and group them based on their functionality, category, or any other criteria for your organization. In addition, with tags assigned to prompts, you can filter prompts by tags in the Prompt Library.

Expand All @@ -99,13 +99,15 @@ You can run prompts via:

However, prompts marked with the **Edit code** mode can only run from the IDE editor. You cannot run these prompts from the Prompt Library in the web UI. For example, the **document-code** built-in prompt can only run the IDE editor.

![run-prompt-web](https://storage.googleapis.com/sourcegraph-assets/Docs/run-prompt-web-2025.png)

## Promoted prompts

<Callout type="note">Promoted prompts are supported in VS Code and Cody Web.</Callout>

**Site admins** can promote a prompt by enabling the **Promote prompt** checkbox. This setting allows admins to highlight prompts they want users to use. Promoted prompts are marked with an icon next to their name and appear at the top of the prompt list in the Cody chat.

![icon-recommended-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/recommended-prompts-icon-1124.png)
![icon-recommended-prompts](https://storage.googleapis.com/sourcegraph-assets/Docs/recommended-prompts-icon-2025.png)

<Accordion title="Migrate custom commands to Prompts Library">

Expand Down
Loading