> ## Documentation Index
> Fetch the complete documentation index at: https://docs.andiai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deep mode

> Searches your topic from multiple angles to find higher-quality results, with spell correction, in ~2–3 seconds.

Deep mode explores your topic from multiple angles to find results that a single quick search might miss. It applies stronger reranking so only strong, relevant matches make the cut, and corrects any typos in your query. Responses take about 2–3 seconds.

The default `auto` mode escalates to this treatment on its own when a query needs it — pin `searchMode=deep` when you want it on every call. Equivalent to [`effort=high`](/search/search-modes#the-effort-parameter), if you use the generic effort dial instead of naming a mode.

<CodeGroup>
  ```bash curl theme={null}
  curl "https://api.andiai.com/api/v1/search?q=quantm+computing+applications&searchMode=deep" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.andiai.com/api/v1/search",
      params={"q": "quantm computing applications", "searchMode": "deep"},
      headers={"x-api-key": "YOUR_API_KEY"}
  )

  data = response.json()

  if data.get("correctedQuery"):
      print(f"Corrected: {data['correctedQuery']}")

  for result in data["results"]:
      print(f"{result['title']} — {result['source']}")
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.andiai.com/api/v1/search?q=quantm+computing+applications&searchMode=deep",
    { headers: { "x-api-key": "YOUR_API_KEY" } }
  );

  const data = await response.json();

  if (data.correctedQuery) {
    console.log(`Corrected: ${data.correctedQuery}`);
  }

  data.results.forEach(r => console.log(`${r.title} — ${r.source}`));
  ```
</CodeGroup>

<Note>
  The example query intentionally misspells "quantum" — deep mode corrects it automatically.
</Note>

## What deep mode adds

* **Query expansion** — expands your query into related variations and fans out follow-up searches from what the first pass finds
* **Thorough coverage** — finds results across multiple angles of your topic, covering sources a single search might miss
* **Higher quality results** — stronger reranking keeps only strong, relevant matches
* **Spell correction** — fixes typos and misspellings in the query

## When to pin deep mode

* You want thorough coverage on every call, regardless of how simple a query looks
* Queries come from user input that may contain typos
* You want higher-quality results and can accept a 2–3 second response

If only some of your queries need this treatment, `auto` applies it selectively — pinning is for when you want it guaranteed.

## Example response

```json theme={null}
{
  "results_type": "Search",
  "answer": "",
  "type": "Search",
  "title": "quantum computing applications",
  "results": [
    {
      "title": "Quantum Computing: Current Applications and Future Potential",
      "link": "https://example.com/quantum-applications",
      "desc": "Quantum computing is being applied in cryptography, drug discovery, and optimization problems...",
      "source": "example.com"
    }
  ],
  "correctedQuery": "quantum computing applications",
  "metrics": {
    "query": "quantum computing applications",
    "intent": "FallbackSearchIntent",
    "timestamp": "2026-07-14T21:30:00.000Z",
    "duration": 2340,
    "queries_executed": 1,
    "api_requests_count": 1,
    "results_returned": 10,
    "total_results_found": 85,
    "cost_dollars": 0.0089
  }
}
```

### Handling corrected queries

The `correctedQuery` field appears when the search detects and fixes a misspelling. Use it to show users what was actually searched:

```python theme={null}
data = response.json()
if data.get("correctedQuery"):
    print(f"Showing results for: {data['correctedQuery']}")
```

<Note>
  Any mode can return `correctedQuery` when a correction is detected. Deep and exhaustive modes go further: they re-run the search with the corrected query, so the results themselves reflect the correction.
</Note>

<Accordion title="Adding extracts and metadata">
  Combine deep mode with richer output options:

  ```bash theme={null}
  # Deep mode with text extracts
  curl "https://api.andiai.com/api/v1/search?q=quantum+computing&searchMode=deep&extracts=true" \
    -H "x-api-key: YOUR_API_KEY"

  # Deep mode with full metadata
  curl "https://api.andiai.com/api/v1/search?q=quantum+computing&searchMode=deep&metadata=full" \
    -H "x-api-key: YOUR_API_KEY"

  # Deep mode as LLM context
  curl "https://api.andiai.com/api/v1/search?q=quantum+computing&searchMode=deep&format=context" \
    -H "x-api-key: YOUR_API_KEY"
  ```
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Fast mode" icon="bolt" href="/search/fast-search">
    Pinned low latency for real-time applications.
  </Card>

  <Card title="Search modes" icon="gauge-high" href="/search/search-modes">
    Automatic effort by default, manual control when you want it.
  </Card>

  <Card title="Research assistant" icon="book-open" href="/examples/research-assistant">
    Multi-query search with result aggregation.
  </Card>

  <Card title="Query parameters" icon="sliders" href="/features/query-parameters">
    Full parameter reference.
  </Card>
</CardGroup>
