Skip to content
Closed
Show file tree
Hide file tree
Changes from 21 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
100 changes: 95 additions & 5 deletions docs/cody/capabilities/chat.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# 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.

Expand Down Expand Up @@ -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,7 +70,7 @@ 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).

Expand Down Expand Up @@ -103,5 +105,93 @@ 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 or Enterprise account
- A supported editor extension (VS Code, JetBrains) 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 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

* 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>
94 changes: 94 additions & 0 deletions docs/cody/capabilities/query-types.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Chat Query Types

<p className="subtitle">This page lists all the query types that will return search results with the Sourcegraph chat.</p>

<Callout type="note">Query types are only supported on Enterprise Starter and Enterprise plans.</Callout>

## Symbol Search

Symbol Search is a query type or workflow that helps developers understand how specific symbols (like functions, variables, or hooks) are used across a codebase by combining search results with contextual analysis through chat.

It enables developers to explore and understand symbol usage patterns through a two-step process. First, developers search for a specific symbol (like `useCallback`) using Sourcegraph Chat, which returns relevant code snippets from across the codebase.

These search results are automatically preserved as context for follow-up chat interactions. Developers can refine their understanding by selecting specific search results and asking natural language questions about the symbol's usage patterns. The chat will analyze the selected code context and provide a comprehensive summary of how the symbol is implemented and used throughout the codebase.

### Try it

1. Query for `= useCallback`
2. Select a subset of the search results which include usage for `useCallback`
3. Follow up and ask Sourcegraph chat `Summarize how useCallback is used`

### Example

<video width="100%" controls>
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/chat-query-types-symbol-search-20250124.mp4" type="video/mp4" />
</video>

## File Search

Search is a query type or workflow that enables users to locate specific files across repositories and perform targeted analysis on the selected files through natural language follow-up queries.

File Search simplifies finding and analyzing specific file types across your codebase. Unlike traditional code search, this workflow allows you to identify relevant files (for example, all `package.json` files), select the specific files you want to analyze, and then ask follow-up questions about the selected files.

This two-step approach is particularly powerful when analyzing patterns or extracting information from similar files spread across multiple repositories. For instance, you could identify all configuration files, select the ones from relevant services, and then analyze their contents for inconsistencies or gather specific information through natural language queries.

### Try it

1. Type `package.json`
2. Check the checkbox next to the results you want to analyze
3. Follow up with `List all the dependencies used across these package.json files`

### Example

<video width="100%" controls>
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/chat-query-types-file-search-20250124.mp4" type="video/mp4" />
</video>

## String Literal Search

String literal search is a query type or workflow that allows you to find exact text matches by enclosing your search term in quotes. This ensures precise matching instead of keyword-based results.

When you enclose the text in quotes like `" authInfo: async provider =>"",` Sourcegraph performs an exact match search rather than keyword matching. After finding relevant files, you can select specific ones to analyze and ask follow-up questions about their contents - creating an interactive workflow combining precise search and contextual code analysis.

### Try it

1. Start a new chat with `"authInfo: async provider =>"`
2. Select a subset of the search results which include usage for the string
3. Follow up with `Summarize the contents`

### Example

<video width="100%" controls>
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/chat-query-types-string-literal-search-20250124.mp4" type="video/mp4" />
</video>

## Error Lookups

Error Lookups is a conversational workflow for Sourcegraph chat that helps developers understand error messages by providing plain-English explanations of when and why specific errors occur in their codebase and external service calls.

Developers can use Error Lookups to understand error messages occurring in their codebase. When encountering an error, especially from external services or dependencies, developers can use chat to:

1. Search for specific error messages across their codebase
2. Select relevant files where the error is thrown or handled
3. Request a natural language explanation of the error's context, triggers, and implications

The workflow combines Sourcegraph's code search capabilities with AI-powered analysis to provide developers with a clear, contextual understanding of error scenarios. Instead of having to dig through docs or source code manually, developers can quickly grasp the following:

* The specific conditions that trigger the error
* The underlying reasons for the error occurrence
* Common scenarios where this error might appear
* Potential approaches to handling or preventing the error

This approach helps developers make more informed decisions about error handling and debugging, reducing the time spent deciphering cryptic error messages or searching through external docs.

### Try it

* Query for `"unsupported platform"`
* Select the file(s) where the error is thrown
* Follow up with "Explain when and why this error is thrown"

### Demo

<video width="100%" controls>
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/chat-query-types-error-lookups-20250124.mp4" type="video/mp4" />
</video>
6 changes: 3 additions & 3 deletions docs/cody/clients/feature-reference.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Feature Parity Reference for Cody Clients
# Feature Parity Reference for Sourcegraph Clients

<p className="subtitle">This document compares Cody's features and capabilities across different clients and platforms like VS Code, JetBrains, and Sourcegraph.com (Web UI).</p>
<p className="subtitle">This document compares features and capabilities across different clients and platforms like VS Code, JetBrains, and Sourcegraph.com (Web UI).</p>

## Chat

| **Feature** | **VS Code** | **JetBrains** | **Visual Studio** | **Eclipse** | **Web** | **CLI** |
| ---------------------------------------- | ----------- | ------------- | ----------------- | ----------- | -------------------- | ------- |
| Chat with Cody | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Chat | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Chat history | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Clear chat history | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Edit sent messages | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
Expand Down
26 changes: 7 additions & 19 deletions docs/cody/clients/install-vscode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can install VS Code directly from the [VS Code extension marketplace listing
- Type **Cody AI** in the search bar and click the **Install** button
- After installing, you may be prompted to reload VS Code to activate the extension

![install-cody-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/install-cody-vscode.png)
![install-cody-vscode](https://storage.googleapis.com/sourcegraph-assets/Docs/install-cody-vscode-2025.png)

Alternatively, you can also [download and install the extension from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) directly.

Expand All @@ -34,33 +34,21 @@ After a successful installation, the Cody icon appears in the [Activity sidebar]

Cody Free and Cody Pro users can sign in to their Sourcegraph.com accounts through GitHub, GitLab, or Google.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-new-ui-0724.jpg)
![](https://storage.googleapis.com/sourcegraph-assets/Docs/cody-new-ui-2025.jpg)

### Sourcegraph Enterprise Cody Users

<Callout type="info"> If you are using an older version of Cody, uninstall it and reload VS Code. It's always recommended to install the latest version before proceeding to next steps.</Callout>

Sourcegraph Enterprise users should connect Cody to their Enterprise instance by clicking **Sign In to Your Enterprise Instance**.

You'll be prompted to choose how to sign-in, select **Sign In to Sourcegraph Instances v5.1 and above**.
You'll be prompted to choose how to sign-in, Enter the URL of your Enterprise instance. If you are unsure, please contact your administrator.

![](https://storage.googleapis.com/sourcegraph-assets/Docs/927fb401aa80af47f4384a854309b0ed5ac58da34507ed4c0dfd72da61e1edfb.png)

Enter the URL of your Enterprise instance. If you are unsure, please contact your administrator.

<img
src="https://storage.googleapis.com/sourcegraph-assets/Docs/c8fc65594ac718cfc6e6d67e76af8dd8989c8dd6300725f5afd872210f76e786.png"
alt="Instance URL"
style={{ aspectRatio: '1210 / 150' }}
/>
![](https://storage.googleapis.com/sourcegraph-assets/Docs/vscode-cody-enterprise-login.png)

A pop-up will ask if you want to Open the URL in a new window. Click **Open** to open the URL in a new window. Next, sign in to your instance. If you do not yet have a login, please contact your administrator.

<img
src="https://storage.googleapis.com/sourcegraph-assets/Docs/3b66de59129d19d8e71ed4d07b1e369ac956b7e3177cb8d3af60765559842431.png"
alt="Sign in"
style={{ aspectRatio: '784 / 806' }}
/>
![](https://storage.googleapis.com/sourcegraph-assets/Docs/sign-in-to-sourcegraph-2025.jpg)

Create an access token from Account Settings - Access Tokens. Click **+ Generate new token**

Expand Down Expand Up @@ -127,7 +115,7 @@ The chat interface is designed intuitively. Your very first chat input lives at
Since your first message to Cody anchors the conversation, you can return to the top chat box anytime, edit your prompt, or re-run it using a different LLM model.

<video width="1920" height="1080" loop playsInline controls style={{ width: '100%', height: 'auto', aspectRatio: '1920 / 1080' }}>
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/Media/cody-in-action-102024.mp4" type="video/mp4" />
<source src="https://storage.googleapis.com/sourcegraph-assets/Docs/Media/cody-in-action-2025.mp4" type="video/mp4" />
</video>

### Chat History
Expand Down Expand Up @@ -170,7 +158,7 @@ Cody defaults to showing @-mention context chips for all the context it intends

When you start a new Cody chat, the chat input window opens with a default `@-mention` context chips for all the context it intends to use. This context is based on your current repository and current file (or a file selection if you have code highlighted).

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

At any point in time, you can edit these context chips or remove them completely 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 source of context.

Expand Down
1 change: 1 addition & 0 deletions docs/omnibox/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Omnibox
Loading
Loading