Deep Research

📢 Note: The API and Deep Research are currently in Beta.

After creating a pipeline, you can generate a Private Deep Research on it.

Generate the Deep Research

Make sure to include the code and imports from the Getting Started page.

First, we need to retrieve the pipeline id. If you created the pipeline via the API, you should have the id in the response. Otherwise you can list the pipelines and get the id from there. From the platform, you can navigate into the pipeline page and check the id in the browser url.

pipelines_api = v.PipelinesApi(api)
response = pipelines.start_deep_research(org, pipeline_id, v.StartDeepResearchRequest(
        # make sure to include a relevant prompt here
        query="What is the meaning of life?",
        # optionally enable additional search on the web
        web_search=False,
))
research_id = response.research_id

Get the Deep Research result

Make sure to include the code and imports from the Getting Started page.

Now we need to poll the Deep Research API to get the result.

while True:
    response = pipelines.get_deep_research_result(org, pipeline_id, research_id)
    if response.ready:
        if response.data.success:
            print(response.data.markdown)
        else:
            print("Deep Research failed: ", response.data.error)
        break
    print("not ready")

Last updated

Was this helpful?