Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

LinkupWebSearch

Search the web using the Linkup API and return results as Haystack Documents.

Key Features​

  • Uses the Linkup Search API, which is optimized for LLM applications.
  • Supports three search depths: fast (sub-second, beta), standard (simple search), and deep (agentic workflow with higher quality).
  • Returns structured documents with content and URL links.
  • Supports per-run overrides of top_k, depth, and search parameters.
  • Supports domain filtering, date range filtering, and image inclusion through search_params.

Configuration​

  1. Drag the LinkupWebSearch component onto the canvas from the Component Library.
  2. Click on the component to open the configuration panel.
  3. On the General tab:
    1. Create a secret with your Linkup API key and set it as api_key. Use LINKUP_API_KEY as the environment variable name. For instructions, see Create Secrets.
    2. Set top_k to control the maximum number of results (default: 10).
    3. Set depth to fast, standard, or deep depending on your latency and quality requirements.
  4. Go to the Advanced tab to configure search_params for domain and date filters.

Connections​

LinkupWebSearch receives a query string and returns a list of Document objects and a list of URLs. Connect its documents output to downstream components such as PromptBuilder for retrieval-augmented generation.

Source Code​

To check this component's source code, open linkup_websearch.py in the Haystack Core Integrations repository.

Usage Examples​

Basic Configuration​

LinkupWebSearch:
type: haystack_integrations.components.websearch.linkup.linkup_websearch.LinkupWebSearch
init_parameters:
api_key:
type: env_var
env_vars:
- LINKUP_API_KEY
strict: false
top_k: 5
depth: standard

Using the Component in a Pipeline​

# haystack-pipeline
components:
websearch:
type: haystack_integrations.components.websearch.linkup.linkup_websearch.LinkupWebSearch
init_parameters:
api_key:
type: env_var
env_vars:
- LINKUP_API_KEY
strict: false
top_k: 5
depth: standard

prompt_builder:
type: haystack.components.builders.chat_prompt_builder.ChatPromptBuilder
init_parameters:
required_variables: "*"
template:
- role: user
content: |
Answer the question using the following search results:
{% for doc in documents %}
{{ doc.content }}
{% endfor %}
Question: {{ question }}

llm:
type: haystack.components.generators.chat.openai.OpenAIChatGenerator
init_parameters:
api_key:
type: env_var
env_vars:
- OPENAI_API_KEY
strict: false
model: gpt-4o-mini

connections:
- sender: websearch.documents
receiver: prompt_builder.documents
- sender: prompt_builder.prompt
receiver: llm.messages

max_runs_per_component: 100

metadata: {}

inputs:
query:
- websearch.query
- prompt_builder.question

outputs:
replies: llm.replies

Parameters​

Inputs​

ParameterTypeDescription
querystrThe search query string.

Outputs​

ParameterTypeDescription
documentsList[Document]A list of documents containing search result content.
linksList[str]A list of URLs from the search results.

Init Parameters​

These are the parameters you can configure in Pipeline Builder:

ParameterTypeDefaultDescription
api_keySecretSecret.from_env_var("LINKUP_API_KEY")The Linkup API key.
top_kOptional[int]10Maximum number of results to return. Maps to the max_results parameter of the Linkup API.
depthstrstandardSearch depth: "fast" (sub-second, beta, keyword-based queries only), "standard" for a simple search, or "deep" for a more powerful agentic workflow.
search_paramsOptional[Dict[str, Any]]NoneAdditional parameters for the Linkup API. Supported keys include include_images, from_date, to_date, include_domains, and exclude_domains.

Run Method Parameters​

These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.

ParameterTypeDefaultDescription
querystrThe search query string.
top_kOptional[int]NonePer-run override of the maximum number of results.
depthOptional[str]NonePer-run override of the search depth ("fast", "standard", or "deep").
search_paramsOptional[Dict[str, Any]]NonePer-run override of search parameters. If provided, fully replaces the init-time search_params.