Skip to main content
Reasoning Mode combines Deepseek’s advanced reasoning capabilities with Gemini’s search tools to provide transparent, strategic analysis of complex queries.

What Makes It Different

Unlike other search modes that directly answer your query, Reasoning Mode takes a two-stage approach:

Reasoning Stage

Deepseek Reasoner analyzes your query and creates a search strategy
  • Identifies information needs
  • Defines search approach
  • Plans explanation structure
  • Shows its thought process in real-time

Search Stage

Gemini 2.0 Flash executes the strategy and delivers results
  • Performs ≥10 targeted searches
  • Synthesizes information
  • Structures comprehensive response
  • Includes images and related questions
The key innovation is transparency: you see how the AI approaches your query before seeing the answer.

How It Works

Architecture

Stage 1: Reasoning
  • Model: Deepseek Reasoner (configurable)
  • Input: User query + language preference
  • Output: Search strategy (streamed)
  • Duration: ~3-5 seconds
Stage 2: Search & Synthesis
  • Model: Gemini 2.0 Flash
  • Input: Query + reasoning strategy
  • Output: Comprehensive answer with sources
  • Duration: ~5-10 seconds

Reasoning System Prompt

The Deepseek model receives specific instructions to act as a “search strategist”:
You are a helpful reasoner, acting as the **initial explorer** for a Search Agent.
Your role is to **define the search strategy**, not to find the answer itself.

Your task is to think like a search expert and determine:

1. **Information Needs:** What specific types of information, facts, or data are
   absolutely necessary to fully understand and answer the user's query? Think
   about the *categories* of information we need to search for.

2. **Explanation Strategy:** Once we have all the necessary information, how
   should we structure our explanation to clearly and comprehensively answer
   the user's query? Outline the *key points* or *logical steps* of the
   explanation.

Remember, your output should be a **search and explanation plan**, not the
answer. Focus on *how* we will search and *how* we will explain, rather than
*what* the answer is.
The reasoning model is explicitly instructed NOT to answer the query directly, only to plan the search strategy.

Example: Reasoning in Action

How would implementing universal basic income affect the economy?

Model Configuration

Deepseek Reasoner Settings

model
string
default:"deepseek-reasoner"
The reasoning model (configurable via REASON_MODEL environment variable)
stream
boolean
default:true
Enables real-time streaming of reasoning process
messages
array
required
System prompt + user query requesting search strategy

Gemini Search Settings

temperature
number
Balanced creativity for comprehensive responses
topP
number
Top 95% probability mass for response diversity
topK
number
default:40
Consider top 40 tokens for generation
maxOutputTokens
number
default:65536
Full output capacity for detailed responses
systemInstruction
string
required
Instructs model to follow reasoning strategy and perform ≥10 searches

When to Use Reasoning Mode

✅ Ideal For

  • Complex analytical questions
  • Multi-perspective topics
  • Strategic planning queries
  • Research requiring structure
  • Queries with no simple answer
  • Academic or professional analysis

❌ Not Ideal For

  • Simple factual questions
  • Quick lookups
  • Time-sensitive queries
  • When you don’t need to see the reasoning
  • Straightforward how-to questions

Benefits of Two-Stage Reasoning

1. Transparency

// User sees the AI's thought process BEFORE the answer
<ThinkingComponent reasoning={reasoningText} />
You can verify that the AI:
  • Understood your question correctly
  • Identified relevant information needs
  • Planned an appropriate search strategy
  • Structured a logical explanation

2. Better Search Quality

Without Reasoning:
"universal basic income" → Generic search → Generic answer

With Reasoning:
"UBI pilot programs results" +
"UBI inflation concerns economic theory" +
"UBI labor market effects" +
... → Targeted searches → Comprehensive answer

3. Structured Responses

The reasoning plan becomes an outline for the final answer:
Reasoning Plan:          →    Final Response:
1. Definition                  ## What is UBI?
2. Economic Effects            ## Economic Implications
3. Empirical Evidence          ## Research Findings
4. Implementation              ## Practical Considerations
5. Conclusion                  ## Summary

4. Educational Value

Users learn:
  • How to break down complex questions
  • What information is relevant
  • How to structure research
  • Critical thinking approaches

API Usage

# Stream the reasoning process
curl "https://api.omnisearches.com/api/reasoning?q=your+query&language=English"

Response Format

Reasoning Stage Response

// Server-Sent Events (SSE) stream
data: {"content": "<think>\nThis query requires..."}
data: {"content": " analysis of multiple factors..."}
data: {"content": "\n\n## Information Needs:\n1. "}
...
data: {"complete": true, "reasoning": "<full reasoning text>"}

Search Stage Response

{
  "sessionId": "abc123",
  "summary": "<formatted HTML response>",
  "sources": [
    {
      "title": "Universal Basic Income Study Results",
      "url": "https://example.com/ubi-study",
      "snippet": "Research findings show..."
    }
  ],
  "relatedQuestions": [
    "What are the main criticisms of UBI?",
    "Which countries have implemented UBI pilots?",
    "How would UBI affect inflation rates?"
  ],
  "images": [
    {
      "url": "https://commons.wikimedia.org/...",
      "caption": "UBI pilot program in Finland",
      "alt": "Graph showing UBI pilot results"
    }
  ]
}

Comparison with Other Modes

FeatureReasoning ModeExhaustive ModeDefault Mode
Reasoning Process✅ Visible❌ Hidden❌ Hidden
Search Strategy🎯 Planned🔄 Automatic🔄 Automatic
Number of Searches≥10 (targeted)≥10 (broad)≥5 (broad)
Response Time8-15s5-10s3-5s
Transparency🔍 High📊 Medium📊 Medium
Best ForComplex analysisDeep researchGeneral queries
Images✅ 4-8✅ 10+✅ 4-8
Related Questions✅ Yes✅ Yes✅ Yes

Performance Considerations

Reasoning Mode is the slowest mode due to the two-stage process. Use it when transparency and strategic analysis are more important than speed.

Timing Breakdown

Total Time: ~8-15 seconds
├─ Reasoning Stage: 3-5s
│  ├─ Deepseek processing: 2-4s
│  └─ Streaming to client: 1s
└─ Search Stage: 5-10s
   ├─ 10+ web searches: 3-6s
   ├─ Content synthesis: 1-2s
   ├─ Image fetching: 1-2s (parallel)
   └─ Response formatting: <1s

Optimization Tips

  • Display reasoning as it streams (don’t wait for completion)
  • Show loading indicators during search stage
  • Cache reasoning for follow-up questions in same session
  • Use streaming for reasoning (reduces perceived latency)
  • Fetch images concurrently with search results
  • Consider caching common reasoning patterns

Customization

You can customize the reasoning model:
# .env configuration
REASON_MODEL=deepseek-reasoner  # or any compatible model
REASON_MODEL_API_URL=https://api.deepseek.com/v1
REASON_MODEL_API_KEY=your_api_key
The reasoning model must support OpenAI-compatible API and streaming responses.

Troubleshooting

Check that:
  • REASON_MODEL_API_KEY is valid
  • API endpoint is accessible
  • Network connection is stable
  • Client properly handles SSE events
Ensure:
  • Reasoning text is properly passed to search endpoint
  • Gemini system prompt includes instruction to follow reasoning
  • Reasoning output is well-formed (starts with <think>, ends with </think>)
Consider:
  • Using Default or Exhaustive mode for faster results
  • Reducing maxOutputTokens in reasoning stage
  • Implementing server-side caching
  • Using a faster reasoning model

Search Modes

Compare Reasoning Mode with other search modes

Image Search

How images are included in reasoning mode responses

Related Questions

AI-generated follow-up questions

Build docs developers (and LLMs) love