head-side-brainUtilize and Integrate Deep Researcher Component

Overview

This guide shows how to perform deep research using the Deep Researcher component starting from simple, direct usage and gradually moving toward more advanced orchestration patterns.

Additionally, Component can be placed inside a Pipeline when you need additional logic such as context preparation or routing decisions. The Pipeline orchestrates when and under what conditions deep research is invoked, but does not define how deep research itself works internally.

chevron-rightPrerequisiteshashtag

This example specifically requires:

  1. completion of all setup steps listed on the Prerequisites page.

  2. API key for deep researcher component set. Please refer to

You should be familiar with these:

  1. Pipeline and orchestration:

  2. Event emitting: Event Emitter

Installation

# you can use a Conda environment
pip install --extra-index-url "https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/" python-dotenv gllm-core gllm-generation gllm-inference gllm-pipeline

Utilize Deep Research as a Component

See Quickstart for the simplest way to perform deep research using the GL SDK, which is by invoking deep research directly without any Pipeline orchestration.

Integrate in a Research Pipeline with Routing

This section demonstrates how to place DeepResearcher Component inside a Pipeline to orchestrate when it is invoked, based on the characteristics of a user query.

Here, the Pipeline is responsible for:

  • inspecting the incoming request

  • deciding whether deep research is required

  • routing execution accordingly

The Pipeline does not define how deep research is executed internally. Deep research is invoked as an encapsulated step, and its internal reasoning remains provider-defined.

See complete code in GitHub

Project Setup

1

Clone the repository

2

Set UV authentication and install dependencies

Unix-based systems (Linux, macOS):

For Windows:

3

Prepare .env file

Implementation

In this example, DeepResearcher Component is used as one step within a Pipeline. The Pipeline handles routing logic and context preparation, while deep research itself remains a standalone invocation.

Run the script

How it works:

  1. The Pipeline evaluates the user query and determines the appropriate execution path.

  2. If deep research is required, the Pipeline invokes the deep research step.

  3. Otherwise, the Pipeline routes the request to a simpler response path.

  4. The Pipeline returns the final result produced by the selected path.

circle-info

The deep research step is treated as an encapsulated unit; the Pipeline does not break down or modify its internal execution.

Deep Research Pipeline with Google Drive Integration

This section demonstrates Pipeline orchestration with additional data sources, using Google Drive as an example.

In this setup:

  • the Pipeline controls routing and execution flow

  • Google Drive access is provided via an MCP connector

  • Deep research is invoked as an encapsulated step with additional data available during execution

See complete code in GitHub

Project Setup

1

Clone the repository

2

Set UV authentication and install dependencies

Unix-based systems (Linux, macOS):

For Windows:

3

Prepare .env file with Google Drive authentication

Get the auth token from OpenAI Connector Guidearrow-up-right

When generating the token, make sure to enable the following scopes:

  • userinfo.email

  • userinfo.profile

  • drive.readonly

Add to .env:

Implementation

In this example, Google Drive is made available to deep research through an MCP connector, while the Pipeline determines when deep research should be invoked.

The Google Drive connector extends the data available during research, but does not change the execution flow or reasoning strategy of deep research itself.

Run the script

Benefits:

  • Make documents stored in Google Drive available as research context

  • Combine private documents with public information during research

  • Integrate external data sources without changing research execution logic

Last updated

Was this helpful?