Deep Research
Smart Search SDK supports advanced deep research using the Sonar and Assafelovic engines, with both POST and WebSocket interfaces. These methods allow asynchronous, long-form, or real-time research execution.
Initialize the Deep Research Client
from smartsearch.deep_research.client import SmartSearchDeepResearchClient
client = SmartSearchDeepResearchClient(
base_url=os.getenv("SMARTSEARCH_BASE_URL"),
cache_manager=cache_manager
)Authenticate with Token
await client.authenticate(token=os.getenv("SMARTSEARCH_TOKEN"))Must be called once before making any search requests.
Usage
Sonar Deep Research (POST)
Perform deep research via the Sonar engine using a standard POST request.
Parameters:
type
enum
Use ResearchType.POST_SONAR
query
string
The topic or question to analyze
Sonar Deep Research (WebSocket)
Enable real-time result streaming using Sonar via WebSocket.
Parameters:
type
enum
Use ResearchType.WS_SONAR
query
string
Query for research
websocket
DummyWebSocket
An async-compatible WebSocket handler
Assafelovic Deep Research (POST)
Run in-depth analysis using the Assafelovic engine through POST.
Parameters:
type
enum
Use ResearchType.POST_ASSAFELOVIC
query
string
Query or topic to be researched
Assafelovic Deep Research (WebSocket)
Use WebSocket to stream live responses from the Assafelovic engine.
Parameters:
type
enum
Use ResearchType.WS_ASSAFELOVIC
query
string
Research query
websocket
DummyWebSocket
WebSocket implementation to receive live results
Full Code Snippet
Last updated
