Skip to main content
DeepResearch performs comprehensive research by searching multiple sources, analyzing content, and generating detailed reports. Tasks run asynchronously in the background, enabling thorough multi-step research that can take minutes to complete.

What You Can Do

  • In-depth research - Complex analysis across web, academic, and proprietary sources
  • Report generation - Get markdown or PDF reports with citations
  • Structured data - Extract research results in custom JSON formats
  • Background processing - Long-running research without blocking your application

Features

Getting Started

Create a Research Task

from valyu import Valyu

valyu = Valyu()

# Create a research task
task = valyu.deepresearch.create(
    query="What are the key differences between RAG and fine-tuning for LLMs?",
    mode="standard"
)

print(f"Task created: {task.deepresearch_id}")
print(f"Status: {task.status}")

Wait for Completion

# Wait for the task to complete
result = valyu.deepresearch.wait(
    task.deepresearch_id,
    poll_interval=5,      # Check every 5 seconds
    max_wait_time=1800    # Timeout after 30 minutes (standard mode)
)

if result.status == "completed":
    print("Research completed!")
    print(result.output)
    
    # Access sources used
    for source in result.sources:
        print(f"- {source.title}: {source.url}")
    
    # Check cost
    print(f"Cost: ${result.cost}")

Research Modes

Choose the right mode for your use case:
ModeBest ForTypical Completion Time
fastQuick answers, lightweight research, simple lookups~5 minutes
standardBalanced research, deeper insights without long wait times~10-20 minutes
heavyIn-depth, long-running research tasks, complex analysisUp to ~90 minutes
# Fast mode for quick lookups
task = valyu.deepresearch.create(
    query="What is quantum computing?",
    mode="fast"
)

# Heavy mode for complex research
task = valyu.deepresearch.create(
    query="Analyze the competitive landscape of cloud computing in 2024",
    mode="heavy"
)

Output Formats

Markdown (Default)

task = valyu.deepresearch.create(
    query="Explain quantum computing advancements",
    output_formats=["markdown"]
)

Markdown + PDF

task = valyu.deepresearch.create(
    query="Write a report on renewable energy trends",
    output_formats=["markdown", "pdf"]
)

# After completion, access the PDF URL
result = valyu.deepresearch.wait(task.deepresearch_id)
if result.pdf_url:
    print(f"PDF available at: {result.pdf_url}")

Check Task Status

status = valyu.deepresearch.status(task_id)

print(f"Status: {status.status}")
if status.progress:
    print(f"Progress: {status.progress.current_step}/{status.progress.total_steps}")

Next Steps