Skip to content

Deep Search: updates for 6.5 #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 24, 2025
45 changes: 35 additions & 10 deletions docs/code-search/types/deep-search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,61 @@

<p className="subtitle">Learn more about Sourcegraph's agentic Code Search tool Deep Search.</p>

<Callout type="note"> New in version 6.4. Deep Search is currently in research preview for Enterprise customers with access to Cody and Code Search. Because Deep Search is in research preview, it might change significantly in the future as we make improvements and adjust to user feedback. Please reach out to your Sourcegraph account team to request access. </Callout>
<Callout type="note"> New in version 6.4. Deep Search is currently in research preview for Enterprise customers. Because Deep Search is in research preview, it might change significantly in the future as we make improvements and adjust to user feedback. Please reach out to your Sourcegraph account team to request access. </Callout>

Deep Search is an agentic code search tool. It receives a natural language question about a codebase, performs an in-depth search, and returns a detailed answer. The user can also ask follow-up questions to improve the answer further.
Deep Search is an agentic code search tool that understands natural language questions about your codebase. When a question is submitted, Deep Search performs an in-depth search and returns a detailed answer. The conversation can be continued with follow-up questions to dive deeper into relevant code.

Under the hood, Deep Search is an AI agent that uses various tools to generate its answer. These tools include multiple modes of Sourcegraph's Code Search and Code Navigation tools. Using tools in an agentic loop enables Deep Search to iteratively refine its understanding of the question and codebase, searching until it is confident in its answer.
Under the hood, Deep Search is an AI agent that uses various tools to generate its answer. The tools are functionalities available in Sourcegraph. They include multiple modes of Sourcegraph's Code Search and Code Navigation features. All processing happens within your Sourcegraph instance - only LLM calls are made to external providers based on your configuration.

Deep Search displays a list of sources used to generate the answer. The sources are the various types of searches it performs and the files it reads. The answer is formatted in markdown. If prompted to do so, Deep Search can also generate diagrams as part of its answer.
The core of Deep Search is an agentic loop. The AI agent can intelligently use tools to explore the codebase. In each loop iteration, the agent gradually refines its understanding of the question and codebase, searching until it is confident in its answer.

Every Deep Search response includes a detailed list of sources that contributed to the answer. These sources show exactly which searches were performed and which files were read. The list of sources is extremely useful for understanding where the answer came from and for further explorations of the codebase.

The answer is formatted in Markdown and can include links to relevant files, directories, or repositories. If prompted to do so, Deep Search can also generate diagrams as part of its answer.

## Best practices

- Give the agent a starting point for the search: Mention relevant repositories, files, directories, or symbol names. The more specific you are, the faster the search will be.
- Give the agent a starting point for the search: use @-mentions to mention relevant repositories, files, directories, or symbol names. The more specific you are, the faster the search will be.
- Provide reasonably scoped questions. The agent will perform much better if it does not have to read the entire codebase at once.
- Check the list of sources. This is extremely useful for debugging and understanding where the answer came from. If something is missing, ask a follow-up question and mention the missing source.

### Examples of prompts

- Find examples of logger usage and show examples of the different types of logging we use.
- I want to know when the indexing queue functionality was last changed in `sourcegraph/zoekt`. Show me the last few commit diffs touching this code and explain the changes.
- Look at the GraphQL APIs available in `sourcegraph/sourcegraph`. Are any of them unused? The client code is in `sourcegraph/cody`.
- I want to know when the indexing queue functionality was last changed in `@zoekt`. Show me the last few commit diffs touching this code and explain the changes.
- Look at the GraphQL APIs available in `@sourcegraph/sourcegraph`. Are any of them unused? The client code is in the `@cody` repository.
- Which tools do we use in our build processes defined in `BUILD.bazel` files?
- Generate a request flow diagram for `src/backend`. Mark the auth and rate limit points.

## Enabling Deep Search
## Conversation sharing
You can share Deep Search conversations with other users in your Sourcegraph instance. To share a conversation, click the "Share" button in the top left, then copy the link.
Once you share a conversation, any user on your instance is able to view it with the link. You can also reset the share link and generate a new one, which invalidates the previous link.

Deep Search can only be used on Sourcegraph instances with Code Search and Cody licenses.
Note that currently, we do not enforce [permissions](/admin/permissions) for viewing shared Deep Search conversations. This means that any user in your Sourcegraph instance can view any shared conversation, regardless of which repositories they have access to. We plan to add support for permission checking in the future.

## Enabling Deep Search

Deep Search is disabled by default. To enable it, ask your site administrator to set `experimentalFeatures.deepSearch.enabled = "true"` in your site configuration.
Deep Search is disabled by default. To enable it, ask your site administrator to enable the following setting in your site configuration:
```json
"experimentalFeatures": {
"deepSearch.enabled": true,
},
```

For optimal performance, Deep Search is specialized to only use one model. Currently, Deep Search only supports Claude Sonnet 4.

If you are not using [Cody Gateway](/cody/core-concepts/cody-gateway), you will also need to configure the model through either Amazon Bedrock or GCP Vertex.

### Enabling conversation sharing
Conversation sharing is disabled by default. To enable conversation sharing, ask your site administrator to enable the following setting in your site configuration:

```json
"experimentalFeatures": {
"deepSearch.enabled": true,
"deepSearch.sharing.enabled": true,
},
```

### Configuring Deep Search on Amazon Bedrock or GCP Vertex

Include configuration for Claude Sonnet 4 in [modelOverrides](/cody/enterprise/model-configuration#model-overrides) in your site configuration. For more information on configuring models, refer to [Model Configuration](/cody/enterprise/model-configuration).
Expand Down