If you search "deep search" today, the top results pull in four directions at once: Google Gemini's research assistant, ChatGPT's autonomous browsing agent, a people-search app on the App Store, and IBM's document AI. None of them helps you understand a 4-million-line monorepo. That is a problem, because "deep search" is quickly becoming the default name for a new category of agentic retrieval, and code is one of the domains where it matters most. In this post, we define deep search in a code context, compare it to the web research tools most people think of first, and show what it looks like in practice within our own Deep Search.
What Is Deep Search?
Deep search is an agentic approach to information retrieval in which an AI model plans a research task, runs multiple searches, reads the results, reasons across them, and returns a synthesized answer with sources, instead of handing the user a list of links or files. The agent decides what to look up next based on what it has already found. That iterative retrieval loop is what makes it "deep."
In the context of software engineering, deep search for code refers to this same pattern applied to a codebase: a natural-language question in, a synthesized answer with file-level citations out, with the agent running the code searches in between.
The same pattern shows up across domains. Gemini Deep Research uses a four-stage workflow of planning, searching, reasoning, and reporting to "automatically browse hundreds of websites" before producing multi-page reports. ChatGPT Deep Research, announced by OpenAI in February 2025, autonomously browses the web for several minutes per query before producing a cited report. We built Deep Search to apply the same pattern to a codebase: it runs queries, follows references, reads files, and returns a high-level explanation built from real code with inline source citations.
Deep Search for the Web vs. Deep Search for Code
Web deep research and code deep search share the same underlying pattern but operate on completely different substrates.
Web deep research agents crawl public pages, news sites, PDFs, and (optionally) your Google Workspace or Drive content. They deal with unstructured prose, conflicting sources, and freshness questions. The output is usually a prose report with citations.
Code deep search agents work across an organization's indexed repositories. The substrate is structured: symbols, references, files, commits, branches, and a Git history. The agent uses code-aware tools like regex search, symbol lookup, and commit history to trace how a system actually behaves. The output is an answer grounded in specific files, citations, and changes.
The distinction matters because the tools a good agent needs for each job are different. A web agent needs a fetcher, a summarizer, and a citation tracker. A code agent needs a code search index, code navigation, Git history, and permission-aware access to private repositories.
Why "Deep Search" Means Different Things in Different Contexts
The phrase is overloaded because the pattern generalizes. At least five distinct meanings are competing in Google search results right now:
- Web research assistants: Gemini Deep Research, ChatGPT Deep Research, Perplexity Deep Research
- People search apps: consumer apps that scrape public records
- Document AI: IBM's Deep Search for scientific papers and patents
- Web search features: Microsoft Bing's "Deep Search" query expansion, launched in December 2023
- Code search agents: our Deep Search
Each is solving a real retrieval problem with an agentic loop. They are not substitutes for each other. If you need to write a market research report, Gemini is the right tool. If you need to understand why your payment webhook is failing in production, you need something that reads your code.
How Deep Search Works for Code
Code is not prose, and that changes the agent's job completely. A code deep search agent has to handle several things a web agent does not: private repositories, permission boundaries, cross-repo references, Git history, and the fact that "the answer" is often distributed across dozens of files that only make sense together.
Our Deep Search documentation describes it as "an AI agent that uses various tools to generate its answer," leveraging our Code Search and Code Navigation features through "an agentic loop" where the agent progressively refines its understanding until it is confident in the response. Here is what happens inside that loop.
Agentic Search: Going Beyond Keyword Matching
Keyword search answers "where does this string appear?" That is useful, but it is rarely the question a developer is actually asking. The real question is usually "how does this work?" or "why is this broken?"
An agentic code search system takes a natural-language question and decomposes it into a series of concrete searches. Ask "how does authentication work in this codebase?" and the agent might run multiple targeted searches (regex, symbol lookup, and structural queries), pull the symbol definitions it finds, follow references to callers, check for middleware patterns, and read the top few files that tie it together. Then it writes an answer that explains the flow, with links back to the relevant files and cited sources it used.
The user asks the question and can optionally scope it with @-mentions for specific repositories or files; the agent handles the underlying search steps, running many of them in different shapes and chaining them together.
Multi-Step Reasoning Over Code
The "deep" in deep search is the iteration. After each search, the agent evaluates what it found, decides whether it has enough information, and picks the next action if not. It might notice that an authentication call dispatches to a handler it has not read yet, open that file, and find a second layer of logic worth explaining.
This matters for codebases where no single file contains the answer. Distributed systems, microservice architectures, and shared libraries all require stitching context together from multiple places. A single-shot RAG query over code often struggles on large, multi-repo systems, where the right context is not in one chunk; a multi-step agent that can take twenty small actions usually fares better.
Combining Search, Git History, and Code Navigation
Code deep search is only as good as the tools the agent can call. Deep Search combines several:
- Code Search for regex and structural queries across all indexed repositories
- Code Navigation for go-to-definition and find-references
- Git history to answer "what changed recently?" and "who introduced this?"
- File reading with branch awareness so the agent can work off any branch, not just
main
Every response includes a detailed list of sources. The output is not a black-box summary; it is a research trail the reader can verify file by file.
Deep Search vs. Traditional Code Search
Traditional code search is a tool you use when you know what you are looking for. Deep search is a tool you use when you do not.
| Dimension |
Traditional Code Search (grep/regex) |
Deep Search (AI-powered) |
| Input |
Exact string, regex, or symbol name |
Natural-language question |
| Output |
List of matching files and lines |
Synthesized answer with source citations |
| Best for |
"Where is this function called?" |
"How does this system work?" |
| User effort |
High: user writes queries, reads results, stitches context together |
Low: user reviews answer and sources |
| Determinism |
Fully deterministic |
Probabilistic, but grounded in cited sources |
| Speed for a known target |
Seconds |
Slower (agent runs multiple searches) |
| Speed for an unknown system |
Hours of reading |
Minutes |
The two are complementary, not competing. A traditional code search index is what the deep search agent uses under the hood. Teams that already rely on code search day to day tend to adopt deep search for the kinds of questions they used to answer by asking a senior engineer.
When You Know What You're Looking For vs. When You Don't
Use keyword or regex search when you have a concrete target: a function name, an error string, a specific file. It is faster and fully deterministic. You will get all the matches and nothing else.
Use deep search when the target is a concept, a behavior, or a system boundary. "How is tenant isolation enforced?" is not a regex. Neither is "what could cause this webhook to double-fire?" Those questions require reading across many files and reasoning about how they fit together, which is exactly what the agent does.
Search Results vs. Synthesized Answers
Traditional search returns a list. The reader has to rank, filter, open files, and build the mental model. Deep search returns a paragraph (or several) with a list of the files it used. The reader verifies by clicking through the sources, not by redoing the search from scratch.
This is the single biggest workflow change. Engineers go from "find and read" to "read the summary, then spot-check the sources."
Deep Search Use Cases
The use cases for code deep search fall into a small number of patterns. All of them involve a question where the cost of answering it manually is high.
Onboarding to Unfamiliar Codebases
New engineers spend weeks building a mental map of a large codebase. Deep search shortens that. A new hire can ask "how does the billing service talk to Stripe?" on day one and get a grounded explanation with the actual files to read next. The answer is specific to the repository, not a generic tutorial.
When we introduced Deep Search, we described exactly this pattern: users can ask conversational questions like "How does authentication work?" and get "a high-level explanation built from real code, not just keyword matches."
Cross-Repository Investigation
Most real systems are not in one repository. A single feature often lives across a frontend, an API, a backend service, and shared libraries. Traditional search works fine inside one repo. Deep search works across all of them at once, which is where the compounding effect shows up. Ask "describe an API call pattern between repo X and repo Y," and the agent traces it end-to-end.
Security and Vulnerability Analysis
Security teams use deep search to answer questions that are hard to phrase as a regex. "Where do we handle user-uploaded file paths?" or "List every place we construct SQL from string concatenation." The agent can combine pattern matching with reasoning about which matches actually represent risk, and it cites every file so the reviewer can verify.
Supporting Non-Engineering Teams
This is the use case that surprises people. Deep search is not only for engineers. Our own support team uses Deep Search to investigate customer issues faster without escalating to engineering for every question. Traditional investigation took 45 to 90 minutes of searching, digging through history, and escalating; with Deep Search, three focused queries get to a complete understanding in roughly five minutes, producing "evidence-backed answers for customer communications."
The same pattern applies to product managers validating a feature spec, security analysts doing triage, and engineering leaders answering executive questions about architecture.
Deep Search Tools Compared
Because "deep search" and "deep research" have become overloaded terms, it is worth laying out the actual landscape. These tools are not substitutes. They solve different problems in different domains.
| Tool |
Domain |
Method |
Best For |
| Google Gemini Deep Research |
Public web + Google Workspace |
Agentic: plan, search, reason, report |
Market research, competitive analysis, multi-source synthesis |
| ChatGPT Deep Research |
Public web |
Autonomous browsing, 5-30 min per query |
Cited reports on open questions, due diligence |
| Deep Search (Sourcegraph) |
Private code repositories |
Agentic loop over code search, navigation, Git history |
Understanding internal codebases, debugging, and onboarding |
| Microsoft Bing Deep Search |
Public web |
Query expansion and reranking |
Higher-quality web results for ambiguous queries |
Google Gemini Deep Research
Gemini Deep Research is a research assistant built into Gemini that can "automatically browse hundreds of websites" and, with permission, read your Gmail, Drive, and Chat. It runs a four-stage workflow (plan, search, reason, report) and produces multi-page reports that can be exported as audio overviews or interactive Canvas content. It is free on desktop and mobile in 150+ countries. Its domain is the web and your personal workspace, not code.
ChatGPT Deep Research
ChatGPT Deep Research, launched by OpenAI in February 2025, autonomously browses the web for several minutes per query and produces cited reports. Like Gemini's version, it is a web research tool. It is not designed to reason over a private codebase with permission boundaries, code navigation, or Git history.
Our Deep Search
Our Deep Search applies the same agentic pattern to code. It accepts natural-language questions, runs code search and navigation queries under the hood, reads files across repositories and branches, and returns an answer with a detailed list of sources. Per the docs, "all processing happens within your Sourcegraph instance. Only external calls are made to the configured LLM." Deep Search went GA in Sourcegraph 6.9 with role-based permissions for enterprise teams.
We are honest about the positioning: Deep Search is not competing with Gemini or ChatGPT. Those tools are built for web research. Deep Search is built for code. A general web research agent is not designed to operate over private codebases with full code navigation, permissions, and Git history, which is where most of the expensive engineering questions actually live.
Microsoft Bing Deep Search
Bing introduced Deep Search in December 2023 as a way to expand ambiguous queries into richer search plans and rerank results. It is a web search enhancement, not an agent that writes reports. Worth naming because it uses the "deep search" term, but functionally distinct from the agentic tools above.
Getting Started with Deep Search for Code
What You Need
Deep Search runs as part of Sourcegraph. You need your code indexed (the thing Code Search already does), an Enterprise Starter or Enterprise plan, and the feature enabled in site config with "deepSearch.enabled": true. Each Code Search license includes three free Deep Searches per user per month, pooled across the organization, with additional searches available for purchase. Role-based permissions let admins grant Read (view existing searches) and Write (create new ones) access through Site Admin → Role, which is the setup we introduced alongside GA in the 6.9 release.
Example Deep Search Workflow
Here is what a real session looks like for a debugging investigation, adapted from the pattern our support team documented.
Question 1: "Explain the payment processor state machine and what could cause an invalid transition from pending_verification to completed." The agent searches for the state machine, reads the relevant files, traces the valid transitions, and names the conditions that would allow (or block) the one in question.
Question 2: "Show me recent changes to the payment verification webhook handling." The agent uses Git history to pull recent commits touching that path, summarizes the changes, and flags anything that could relate to the first question.
Question 3: "Are there any existing fixes for webhook race conditions in the payment system?" The agent searches for related patterns, looks at prior commits and comments, and either points to an existing fix or confirms there is not one.
Three queries, roughly five minutes, evidence-backed answer. The same investigation done manually is 45 to 90 minutes of grepping, reading files, and walking through commit history.
For teams building AI agents of their own, external tools can interact with Deep Search through our APIs and MCP server, as described in the Deep Search docs.
Conclusion
Deep search is not one product; it is a pattern. An agent plans, searches, reads, reasons, and answers with sources. Gemini and ChatGPT apply the pattern to the web. We apply it to code, which is the domain where most of the expensive "how does this work?" questions inside engineering organizations actually live.
If you have a codebase large enough that new engineers take weeks to onboard, or a support team that escalates every second customer issue to engineering, the ROI shows up fast. Try it on your own codebase on the Deep Search product page, or read our original launch announcement for the full feature breakdown.
FAQ
What is deep search?
Deep search is an agentic approach to information retrieval where an AI model plans a task, runs multiple searches, reads the results, reasons across them, and returns a synthesized answer with sources. It is "deep" because the agent iterates: each search informs the next one. The pattern is used across domains, from web research (Gemini, ChatGPT) to code (our Deep Search).
How does deep search differ from regular code search?
Regular code search takes an exact query (a string, regex, or symbol) and returns matches. Deep search takes a natural-language question, runs many code searches under the hood, reads the results, and returns an answer with citations. Use regular search when you know what you are looking for; use deep search when the answer requires reading across many files.
Is Deep Search the same as ChatGPT Deep Research?
No. ChatGPT Deep Research browses the public web to produce cited reports. Our Deep Search runs a similar multi-step search process over a private codebase using code search, code navigation, and Git history. They share the underlying approach (iterative retrieval, sources, synthesis) but operate in different domains. A general web research agent is not designed to operate over private codebases with the tooling that a code-specific agent has.
Can non-developers use deep search?
Yes. Support engineers, security analysts, product managers, and engineering leaders all use code deep search to answer codebase questions without waiting on an engineer. Because the output is a natural-language explanation with links to the source files, the reader does not need to be fluent in the language the code is written in.