Deep Research APIs
Deep Research APIs enable comprehensive, multi-agent research workflows with clarification questions, structured briefs, and detailed final reports.
Overview
The Deep Research system uses multiple AI agents working in parallel to conduct thorough research on any topic. The workflow includes:
- Optional Clarification - Ask clarifying questions before starting
- Research Brief - Generate a structured research plan
- Multi-Agent Research - Multiple agents research different aspects
- Final Report - Comprehensive, synthesized report
Start Research
Start a deep research workflow for the given query.
This endpoint initiates a research workflow that will:
- Optionally ask clarifying questions
- Create a research brief
- Conduct research using multiple agents
- Generate a comprehensive final report
The workflow runs in the background and streams progress via SSE.
POST /research/startRequest Body
{
"query": "string",
"allow_clarification": true,
"max_concurrent_research_units": 0,
"max_researcher_iterations": 0,
"tenant_id": "string",
"serviceId": "string"
}| Field | Type | Required | Description |
|---|---|---|---|
query | string | ✅ | The research query or question |
allow_clarification | boolean | ❌ | Whether to allow clarification questions |
max_concurrent_research_units | integer | ❌ | Maximum concurrent research agents |
max_researcher_iterations | integer | ❌ | Maximum iterations per researcher |
tenant_id | string | ❌ | Tenant identifier |
serviceId | string | ✅ | Service ID for credit checking |
Successful Response (200 OK)
{
"thread_id": "string",
"status": "string",
"message": "string",
"research_brief": "string",
"final_report": "string"
}Validation Error (422)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}Example
curl -X POST https://chordian-core.chordian.ai/research/start \
-H "Content-Type: application/json" \
-d '{
"query": "Analyze the competitive landscape of AI coding assistants",
"allow_clarification": true,
"serviceId": "srv_123"
}'Stream Research Progress
Stream real-time progress of a research workflow via Server-Sent Events (SSE).
Args:
thread_id: The thread ID of the research workflow
Returns:
StreamingResponse: SSE stream with real-time updates
GET /research/stream/{thread_id}Successful Response (200 OK)
"string"Validation Error (422)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}JavaScript Example
import requests
import json
def stream_research_progress(thread_id):
url = f"https://chordian-core.chordian.ai/research/stream/{thread_id}"
with requests.get(url, stream=True) as response:
for line in response.iter_lines():
if line:
decoded_line = line.decode('utf-8')
# Parse SSE format
if decoded_line.startswith('data: '):
data_str = decoded_line[6:] # Remove 'data: ' prefix
try:
data = json.loads(data_str)
if data.get('event') == 'clarification':
print(f"Clarification needed: {data.get('question')}")
elif data.get('event') == 'progress':
print(f"Progress: {data}")
elif data.get('event') == 'complete':
print(f"Research complete! {data.get('final_report')}")
break
except json.JSONDecodeError:
print(f"Received: {decoded_line}")
# Usage
stream_research_progress("your-thread-id")Get Research Status
Get the current status of a research workflow.
Args:
thread_id: The thread ID of the research workflow
Returns:
Dict: Containing the current status and metadata
GET /research/status/{thread_id}Successful Response (200 OK)
"string"Validation Error (422)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}Get Active Research Workflows
Get all currently active research workflows.
Returns:
Dict: Containing active research workflows and their metadata
GET /research/activeSuccessful Response (200 OK)
"string"Respond to Clarification
Respond to a clarification question and continue the research.
POST /research/respond/{thread_id}?response={your_response}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
thread_id | string | ✅ | Thread ID of the research |
response | string | ✅ | Your response to the clarification |
Example
curl -X POST "https://chordian-core.chordian.ai/research/respond/research_abc123?response=Focus%20on%20code%20completion%20accuracy" \
-H "Content-Type: application/json"Response
{
"status": "processing",
"message": "Research continuing with your response"
}Stop Research Workflow
Stop a running research workflow.
Args:
thread_id: The thread ID of the research workflow to stop
Returns:
Dict: Containing the stop operation result
DELETE /research/stop/{thread_id}Successful Response (200 OK)
"string"Validation Error (422)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}Research Workflow Lifecycle
Research Brief Structure
The research brief includes:
# Research Brief
## Research Question
[Original query]
## Objectives
- Objective 1
- Objective 2
## Research Areas
1. **Area 1**: Description
2. **Area 2**: Description
## Methodology
- Approach 1
- Approach 2
## Expected Deliverables
- Deliverable 1
- Deliverable 2Final Report Structure
The final report includes:
# Final Report: [Topic]
## Executive Summary
[High-level overview]
## Key Findings
1. Finding 1
2. Finding 2
## Detailed Analysis
### Section 1
[Detailed analysis]
### Section 2
[Detailed analysis]
## Conclusions
[Conclusions and recommendations]
## Sources
- Source 1
- Source 2Best Practices
? Info: Tip: Enable clarification questions for complex research topics to get more targeted results.
- Clear Queries - Provide specific, well-defined research questions
- Use Clarification - Enable clarification for complex topics
- Monitor Progress - Use SSE streaming for real-time updates
- Resource Management - Stop workflows that are no longer needed
- Handle Timeouts - Implement timeout handling for long-running research
Configuration Options
Max Concurrent Research Units
Controls how many research agents work in parallel (default: 5).
- Higher values: Faster research, more resource usage
- Lower values: Slower research, less resource usage
Max Researcher Iterations
Controls how deep each agent researches (default: 3).
- Higher values: More thorough research, longer time
- Lower values: Faster research, less depth
Next Steps
- Learn about CSV Import APIs
- View Research Schemas
- Follow the Streaming Guide