Skip to content

Commit 7fe596a

Browse files
committed
Add chat and query types docs
1 parent ba84935 commit 7fe596a

File tree

11 files changed

+247
-90
lines changed

11 files changed

+247
-90
lines changed

docs/code-search/code-navigation/search_based_code_navigation.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Search-based Code Navigation
22

33
<TierCallout>
4-
Supported on [Enterprise Starter](/pricing/enterprise-starter) and [Enterprise](/pricing/enterprise) plans.
4+
Supported on [Enterprise](/pricing/enterprise) plans.
55
<user>
66
Available via VS Code and JetBrains editor extensions and the Web.
77
</user>
@@ -49,5 +49,5 @@ The default values for these environment variables come from [`config.go`](https
4949
## More resources
5050

5151
<LinkCards>
52-
<LinkCard href="/code-search/code-navigation/rockskip" imgSrc="https://sourcegraph.com/.assets/img/sourcegraph-mark.svg" imgAlt="Rockskip" title="Rockskip: Symbol sidebar and search navigation" description="Enhances symbol sidebar and search-based code navigation experience in large monorepos." />
52+
<LinkCard href="/code-search/code-navigation/rockskip" imgSrc="https://storage.googleapis.com/sourcegraph-assets/Docs/sg-new-logo.svg" imgAlt="Rockskip" title="Rockskip: Symbol sidebar and search navigation" description="Enhances symbol sidebar and search-based code navigation experience in large monorepos." />
5353
</LinkCards>

docs/code-search/working/saved_searches.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Saved Searches lets you reuse and share search queries. You can create a saved s
66

77
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.
88

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

1111
## Creating saved searches
1212

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

1919
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.
2020

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

2323
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.
2424

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

3333
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.
3434

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

3737
## Example saved searches
3838

docs/cody/capabilities/chat.mdx

Lines changed: 102 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# Chat
22

3-
<p className="subtitle">Use Cody's chat to get contextually-aware answers to your questions.</p>
3+
<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>
44

5-
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.
5+
<Tabs>
6+
<Tab title="Free/Pro">
7+
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.
68

79
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.
810

911
## Prerequisites
1012

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

13-
- A Free or Pro account via Sourcegraph.com or a Sourcegraph Enterprise account
14-
- A supported editor extension (VS Code, JetBrains, Visual Studio) installed
15+
- [Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing)
16+
- 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
1517

1618
## How does chat work?
1719

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

3234
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.
3335

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

3638
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.
3739

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

4446
## OpenCtx context providers
4547

46-
<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>
48+
<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>
4749

4850
[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:
4951

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

6971
## LLM selection
7072

71-
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.
73+
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.
7274

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

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

7779
## Smart Apply and Execute code suggestions
7880

7981
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.
8082

8183
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.
8284

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

8587
## Chat history
8688

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

105107
- **Public knowledge only**: Cody will not use your own code files as context; it’ll only use knowledge trained into the base model.
106-
- **Current file only**: Re-run the prompt again using just the current file as context.
108+
- **Current file only**: Re-run the prompt again using the current file as context.
107109
- **Add context**: Provides @-mention context options to improve the response by explicitly including files, symbols, remote repositories, or even web pages (by URL).
110+
</Tab>
111+
<Tab title="Enterprise Starter/Enterprise">
112+
113+
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.
114+
115+
## Prerequisites
116+
117+
To use Cody's chat, you'll need the following:
118+
119+
- [Sourcegraph Enterprise Starter](https://sourcegraph.com/pricing) or [Enterprise account](https://sourcegraph.com/pricing)
120+
- 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
121+
122+
## Key features
123+
124+
The enhanced chat experience includes everything in the Free plan, plus the following:
125+
126+
## Intent detection
127+
128+
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.
129+
130+
### How it works
131+
132+
When a user submits a query in the chat panel, the intent detection component:
133+
134+
- Analyzes the query content and structure
135+
- Determines the most appropriate response type (search or chat)
136+
- Returns results in the optimal format
137+
- Provides the ability to toggle between response types manually
138+
139+
Let's look at an example of how this might work:
140+
141+
#### Search-based response
142+
143+
![Intent detection code search response](https://storage.googleapis.com/sourcegraph-assets/Docs/intent-detection-code-search-response-01242025.jpg)
144+
145+
#### Chat-based response
146+
147+
![Intent detection chat response](https://storage.googleapis.com/sourcegraph-assets/Docs/intent-detection-chat-response-01242025.jpg)
148+
149+
## Smart search integration
150+
151+
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.
152+
153+
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.
154+
155+
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.
156+
157+
## Context-aware responses
158+
159+
Search results generated through smart search integration can be automatically used as context for follow-up queries. Here's what happens with each scenario:
160+
161+
### Search responses
162+
163+
* Search results can be used directly as context for follow-up queries
164+
* Users can select which search results to include as context using checkboxes
165+
* By default, all search results are added as context
166+
* A context chip shows the number of search results being used (e.g., "10 code search results")
167+
* Users can remove the context chip if they don't want to use it for follow-ups
168+
169+
### Chat responses
170+
171+
<Callout type="info">Executing terminal commands for additional context is an experimental feature.</Callout>
172+
173+
* Performs background searches for context
174+
* Retrieves full context from files, symbols, remote repos, and web pages
175+
* Can execute terminal commands (with permission) for additional context
176+
* Creates personal notes usable across chat sessions
177+
* Pulls in [OpenCtx](/cody/capabilities/openctx) providers for additional context
178+
179+
## How does chat work?
180+
181+
The following is a general walkthrough of the chat experience:
182+
183+
1. The user enters a query in the chat interface
184+
2. The system analyzes the query through intent detection
185+
3. If it's a search query:
186+
- Displays ranked results with code snippets
187+
- Shows personalized repository ordering
188+
- Provides checkboxes to select context for follow-ups
189+
4. If it's a chat query:
190+
- Delivers AI-powered responses
191+
- Can incorporate previous search results as context
192+
5. Users can:
193+
- Switch between search and chat modes
194+
- Click on results to open files in their editor
195+
- Ask follow-up questions using selected context
196+
- Use `@` to add context for specific files, symbols, remote repositories, or other non-code artifacts
197+
198+
</Tab>
199+
</Tabs>

docs/cody/capabilities/prompts.mdx

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Go to **Tools > Prompt Library** from the top navigation bar in the Sourcegraph.
1717

1818
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.
1919

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

2222
### Core (built-in) prompts
2323

@@ -37,15 +37,15 @@ Click the **New prompt** button from the **Prompt Library** page.
3737
- Select the **Owner** and **Prompt Name**
3838
- Write a prompt description
3939
- Next, fill out the **Prompt template** box with all your prompt instructions
40-
- You can also `@` mention [specific and dynamic context](#specific-and-dynamic-context) that will allow your prompt to use content from different sources like current selection and current file
40+
- You can also add dynamic context that will allow your prompt to use content from different sources like current selection and current file
4141
- Select the visibility of the prompt, either **Public** or **Private**
4242
- You can mark your prompt as **draft**. Draft prompts are not visible to other users until you publish it
4343
- Choose the mode of the prompt, whether it will be **Chat only** or can **Edit code**
4444
- Once done, click the **Create prompt** button
4545

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

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

5050
### Draft prompts
5151

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

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

6666
## Edit prompts
6767

@@ -78,36 +78,18 @@ Site admins can categorize prompts and create **tags**. This helps you keep your
7878
- 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
7979
- Click **New tag**, type the **Tag name** and hit the **Create** button
8080

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

8383
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**.
8484

8585
### Assigning tags to prompts
8686

8787
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.
8888

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

9191
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.
9292

93-
## Specific and dynamic context (beta)
94-
95-
<Callout type="info">Sourcegraph 6.0 adds beta support for the `@` mention menu in the prompt library.</Callout>
96-
97-
When writing prompts, you can leverage both specific and dynamic context through the `@` mention system.
98-
99-
![A dropdown appears after typing `@` in the prompt editor.](https://storage.googleapis.com/sourcegraph-assets/Docs/at-mentions-dropdown.png)
100-
101-
Type `@` to open a dropdown menu that lets you reference specific context like symbols, directories, files, repositories and web URLs.
102-
103-
When selecting a web URL, type out the domain, including the `https://` prefix, for example, https://sourcegraph.com.
104-
105-
For dynamic context that adapts based on what the user is working on, the prompt editor provides special mentions for the current selection, current file, current repository, current directory, and open tabs.
106-
When a user runs a prompt template containing dynamic context mentions, they are automatically resolved to the appropriate specific context based on the user's current workspace state.
107-
To add dynamic context, click on one of the buttons below the prompt editor. We will soon move the buttons into the `@` mention menu as well.
108-
109-
This powerful combination allows prompt authors to create templates that can intelligently access both explicitly defined context and contextually relevant information at runtime.
110-
11193
## Run prompts
11294

11395
You can run prompts via:
@@ -117,13 +99,15 @@ You can run prompts via:
11799

118100
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.
119101

102+
![run-prompt-web](https://storage.googleapis.com/sourcegraph-assets/Docs/run-prompt-web-2025.png)
103+
120104
## Promoted prompts
121105

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

124108
**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.
125109

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

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

0 commit comments

Comments
 (0)