/deep-research

The deep_research endpoint is an intelligent code analysis agent that goes beyond simple search to provide comprehensive understanding of your codebase. Think of it as having a senior architect who has thoroughly studied every line of your code and can answer complex questions about architecture, patterns, and implementation strategies.

Key Features:

  • Code Understanding: Comprehends code logic, architecture, and design patterns.

  • Cross-Repository Analysis: Can analyze relationships between different parts of your codebase.

  • Implementation Planning: Helps plan new features based on existing code patterns.

  • Best Practice Recommendations: Suggests improvements based on codebase analysis.

  • Architecture Insights: Provides high-level understanding of system design.


API/MCP Reference

Request Format

{
  "tool": "deep_research",
  "parameters": {
    "input": "How does the authentication flow work across our microservices? What security measures are in place?",
    "repositories": ["backend/api", "frontend/app"],  // Repos to analyze
    "session_id": "analysis-123"                      // Track conversation context
  }
}

Parameters

Parameter
Type
Required
Description

input

string

Yes

Your question or research query. Be specific and detailed for best results.

repositories

array

No

List of repository identifiers to scope the search. Format: org/repo

session_id

string

No

Unique identifier to maintain context across multiple queries in a conversation.


Best Practices

  • Be specific and detailed - "How does user authentication work across our microservices?" provides richer insights than general queries

  • Include context about your goals - Mentioning why you need the information helps Deep Research tailor its analysis

  • Leverage session_id for complex investigations - Build on previous queries to dive deeper into specific areas

  • Specify repositories for focused analysis - When you know which repos are relevant, include them for more targeted results

  • Ask 'why' and 'how' questions - Deep Research excels at explaining design decisions and implementation reasoning

👿 Avoid

  • Asking for simple keyword searches, use get_context instead

  • Asking the agent to modify your code, deep-research analyzes, and suggest code, it will not modify files

  • Asking about external services not in your codebase\s

  • Don't use for real-time data - it analyzes code structure, not runtime behavior


Usage Patterns

Pattern 1: Architecture Discovery

When to use: Understanding how your system works

Returns: Complete flow diagram in text, service interactions, data transformations, error handling paths

Pattern 2: Security Audit

When to use: Evaluating security implementation

Returns: Security analysis, best practice violations, specific vulnerabilities, improvement recommendations

Pattern 3: Feature Planning

When to use: Before implementing new features

Returns: Implementation strategy, integration points, consistent patterns to follow, potential challenges

Pattern 4: Performance Analysis

When to use: Identifying bottlenecks and optimization opportunities

Returns: Bottleneck identification, N+1 queries, inefficient algorithms, caching opportunities

Pattern 5: Dependency Impact

When to use: Before upgrading dependencies or making breaking changes

Returns: Affected code sections, breaking changes, migration strategy, risk assessment

Pattern 6: Onboarding New Developers

When to use: Explaining complex parts of the codebase

Returns: Conceptual explanation, implementation details, key files and functions, potential gotchas

Pattern 7: Best Practice Validation

When to use: Ensuring code quality and consistency

Returns: Pattern analysis, anti-pattern identification, specific improvement suggestions, refactoring priorities

Last updated