Skip to content

Search

Query Brave, Tavily, Exa, SearXNG, DuckDuckGo, SerpAPI and Serper web search from SQL through one interface

Connector software
Free and open source
Service credentials
Required
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/search/index.md to help me query Search with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Search the web from SQL

Example output · captured
Connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT title, url, rank
FROM search.main.web_search('python programming language', provider := 'ddg', count := 5)
ORDER BY rank
Result
title url rank
Python (programming language) https://en.wikipedia.org/wiki/Python_(programming_language) 1
Python (programming language) Category https://duckduckgo.com/c/Python_(programming_language) 2
CPython https://duckduckgo.com/CPython 3
Cython https://duckduckgo.com/Cython 4
Jupyter https://duckduckgo.com/Project_Jupyter 5

Quick start

Choose where to run Search, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'search' AS search (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-search-worker'
);

3. Add service credentials

After attaching, create the secret for the service you want to query in the same SQL session. Replace the placeholders with your service settings.

brave credentials

Optional Brave Search API key for web_search(provider := brave) / web_answer. Falls back to the BRAVE_API_KEY environment variable.

Get these credentials →
secret.sql
CREATE SECRET brave (
    TYPE brave,
    api_key '<BRAVE_API_KEY>'  -- secret
);
tavily credentials

Optional Tavily Search API key for web_search(provider := tavily) / web_answer. Falls back to the TAVILY_API_KEY environment variable.

Get these credentials →
secret.sql
CREATE SECRET tavily (
    TYPE tavily,
    api_key '<TAVILY_API_KEY>'  -- secret
);
exa credentials

Optional Exa Search API key for web_search(provider := exa) / web_answer. Falls back to the EXA_API_KEY environment variable.

Get these credentials →
secret.sql
CREATE SECRET exa (
    TYPE exa,
    api_key '<EXA_API_KEY>'  -- secret
);
serpapi credentials

Optional SerpApi (opt-in; requires VGI_SEARCH_ENABLE_SERP=1) key for web_search(provider := serpapi) / web_answer. Falls back to the SERPAPI_API_KEY environment variable.

Get these credentials →
secret.sql
CREATE SECRET serpapi (
    TYPE serpapi,
    api_key '<SERPAPI_API_KEY>'  -- secret
);
serper credentials

Optional Serper.dev (opt-in; requires VGI_SEARCH_ENABLE_SERP=1) key for web_search(provider := serper) / web_answer. Falls back to the SERPER_API_KEY environment variable.

Get these credentials →
secret.sql
CREATE SECRET serper (
    TYPE serper,
    api_key '<SERPER_API_KEY>'  -- secret
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT title, url, rank
FROM search.main.web_search('python programming language', provider := 'ddg', count := 5)
ORDER BY rank
More example queries →
Technical details
Verified connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'search' AS search (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-search-worker'
);

Overview

Unified web search over pluggable providers for SQL / RAG.

Catalog

Everything search exposes once attached — read straight from the worker's released build.

search 1 schema
main 1 table · 2 functions

Unified web search over pluggable providers for SQL / RAG

Schema examples (6)
Examples (6)

List every provider and whether each is configured, before choosing one.

SELECT provider, requires_key, configured
FROM search.main.search_providers()
ORDER BY provider;

Top web results via the free, keyless DuckDuckGo provider.

SELECT title, url, rank
FROM search.main.web_search('python programming language', provider := 'ddg', count := 5)
ORDER BY rank;
Result
title url rank
Python (programming language) https://en.wikipedia.org/wiki/Python_(programming_language) 1
Python (programming language) Category https://duckduckgo.com/c/Python_(programming_language) 2
CPython https://duckduckgo.com/CPython 3
Cython https://duckduckgo.com/Cython 4
Jupyter https://duckduckgo.com/Project_Jupyter 5

Top-10 web results via Brave (needs a key).

SELECT title, url, snippet
FROM search.main.web_search('vector database', provider := 'brave', count := 10);

A synthesized one-line answer via free DuckDuckGo Instant Answer.

SELECT search.main.web_answer('python programming language', 'ddg') AS answer;
2 more examples

One grounding row: DuckDuckGo's Instant Answer summary for a topic, plus the URLs of the top 5 web_search results for the same query (in rank order) to cite alongside it

SELECT search.main.web_answer('python programming language', 'ddg') AS answer,
  list(url ORDER BY rank) AS sources
FROM search.main.web_search('python programming language', provider := 'ddg', count := 5);

Expand a search into definitions: for each DuckDuckGo related-topic result, look up the Instant Answer summary of its title (NULL where DuckDuckGo has none, e.g. category pages)

SELECT rank, title, search.main.web_answer(title, 'ddg') AS definition
FROM search.main.web_search('python programming language', provider := 'ddg', count := 6)
WHERE extra->>'result_kind' = 'related_topic'
ORDER BY rank;
Tables
search_providers 7 examples4 cols

Directory of available search providers and whether each is configured

Columns
providernot null VARCHAR
Provider name (pass as provider := ...).
requires_keynot null BOOLEAN
Whether the provider needs an API key.
supports_answernot null BOOLEAN
Whether the provider exposes a synthesized answer.
configurednot null BOOLEAN
Whether a key (or base_url for searxng) is configured.
ConstraintsPRIMARY KEY (provider)
Examples (7)

Each provider with its key requirement and configured state, ordered by name.

SELECT provider, requires_key, configured
FROM search.main.search_providers
ORDER BY provider;

Just the providers that are ready to use.

SELECT provider FROM search.main.search_providers WHERE configured;

Providers that can serve web_answer.

SELECT provider FROM search.main.search_providers WHERE supports_answer;
4 more examples
SELECT provider, requires_key, configured
FROM search.main.search_providers()
WHERE configured
ORDER BY provider;
SELECT provider, requires_key, configured
FROM search.main.search_providers()
ORDER BY provider;
SELECT title, url, rank
FROM search.main.web_search('python programming language', provider := 'ddg', count := 5)
ORDER BY rank;
Result
title url rank
Python (programming language) https://en.wikipedia.org/wiki/Python_(programming_language) 1
Python (programming language) Category https://duckduckgo.com/c/Python_(programming_language) 2
CPython https://duckduckgo.com/CPython 3
Cython https://duckduckgo.com/Cython 4
Jupyter https://duckduckgo.com/Project_Jupyter 5
SELECT search.main.web_answer('python programming language', 'ddg') AS answer;
Link
Scalar functions
web_answer (query VARCHAR, provider VARCHAR) 3 examples

Synthesized one-line answer for a query (tavily/ddg); NULL when unavailable

Arguments
query VARCHAR
Query to answer.
provider VARCHAR
Provider name: 'tavily' or 'ddg'.
ReturnsVARCHAR
Examples (3)

DuckDuckGo Instant Answer (free, no key)

SELECT search.main.web_answer('python programming language', 'ddg');

Tavily-synthesized answer; needs a tavily secret and returns NULL without one

SELECT search.main.web_answer('who maintains duckdb', 'tavily');

One grounding row: DuckDuckGo's Instant Answer summary for a topic, plus the URLs of the top 5 web_search results for the same query (in rank order) to cite alongside it

SELECT search.main.web_answer('python programming language', 'ddg') AS answer,
  list(url ORDER BY rank) AS sources
FROM search.main.web_search('python programming language', provider := 'ddg', count := 5);
Link
Table functions

Credentials

The 5 secret types search declares, as reported by the worker itself.

brave

How to get these credentials

Optional Brave Search API key for web_search(provider := brave) / web_answer. Falls back to the BRAVE_API_KEY environment variable.

secret.sql
CREATE SECRET brave (
    TYPE brave,
    api_key '<BRAVE_API_KEY>'  -- secret
);
Key Type Required Description
api_key secret VARCHAR — Brave Search API key, issued from your account at https://brave.com/search/api/

The worker doesn't mark which keys are required.

Needed by web_searchsearch_providers

tavily

How to get these credentials

Optional Tavily Search API key for web_search(provider := tavily) / web_answer. Falls back to the TAVILY_API_KEY environment variable.

secret.sql
CREATE SECRET tavily (
    TYPE tavily,
    api_key '<TAVILY_API_KEY>'  -- secret
);
Key Type Required Description
api_key secret VARCHAR — Tavily Search API key, issued from your account at https://app.tavily.com/

The worker doesn't mark which keys are required.

Needed by web_answerweb_searchsearch_providers

exa

How to get these credentials

Optional Exa Search API key for web_search(provider := exa) / web_answer. Falls back to the EXA_API_KEY environment variable.

secret.sql
CREATE SECRET exa (
    TYPE exa,
    api_key '<EXA_API_KEY>'  -- secret
);
Key Type Required Description
api_key secret VARCHAR — Exa Search API key, issued from your account at https://dashboard.exa.ai/api-keys

The worker doesn't mark which keys are required.

Needed by web_searchsearch_providers

serpapi

How to get these credentials

Optional SerpApi (opt-in; requires VGI_SEARCH_ENABLE_SERP=1) key for web_search(provider := serpapi) / web_answer. Falls back to the SERPAPI_API_KEY environment variable.

secret.sql
CREATE SECRET serpapi (
    TYPE serpapi,
    api_key '<SERPAPI_API_KEY>'  -- secret
);
Key Type Required Description
api_key secret VARCHAR — SerpApi (opt-in; requires VGI_SEARCH_ENABLE_SERP=1) key, issued from your account at https://serpapi.com/manage-api-key

The worker doesn't mark which keys are required.

Needed by web_searchsearch_providers

serper

How to get these credentials

Optional Serper.dev (opt-in; requires VGI_SEARCH_ENABLE_SERP=1) key for web_search(provider := serper) / web_answer. Falls back to the SERPER_API_KEY environment variable.

secret.sql
CREATE SECRET serper (
    TYPE serper,
    api_key '<SERPER_API_KEY>'  -- secret
);
Key Type Required Description
api_key secret VARCHAR — Serper.dev (opt-in; requires VGI_SEARCH_ENABLE_SERP=1) key, issued from your account at https://serper.dev/api-key

The worker doesn't mark which keys are required.

Needed by web_searchsearch_providers

Create the secret in the same session, after attaching search — the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

List every provider and whether each is configured, before choosing one.

SELECT provider, requires_key, configured
FROM search.main.search_providers()
ORDER BY provider

Top-10 web results via Brave (needs a key).

SELECT title, url, snippet
FROM search.main.web_search('vector database', provider := 'brave', count := 10)

Uses web_search

A synthesized one-line answer via free DuckDuckGo Instant Answer.

SELECT search.main.web_answer('python programming language', 'ddg') AS answer

Uses web_answer

One grounding row: DuckDuckGo's Instant Answer summary for a topic, plus the URLs of the top 5 web_search results for the same query (in rank order) to cite alongside it

SELECT search.main.web_answer('python programming language', 'ddg') AS answer,
  list(url ORDER BY rank) AS sources
FROM search.main.web_search('python programming language', provider := 'ddg', count := 5)

Uses web_answerweb_search

Each provider with its key requirement and configured state, ordered by name.

SELECT provider, requires_key, configured
FROM search.main.search_providers
ORDER BY provider

Uses search_providers

Providers that are ready to use right now, with their key requirement

SELECT provider, requires_key, configured
FROM search.main.search_providers()
WHERE configured
ORDER BY provider

6 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Show me the full directory of search providers this worker supports: every provider, with all of its columns, ordered by provider name.
  • Which of the search providers require an API key? List just their names, sorted.
  • Which providers can return a synthesized one-line answer for web_answer? List their names, sorted.
  • List the names of the search providers that are configured and ready to use right now, sorted.
  • Using the free, keyless DuckDuckGo (ddg) provider, search for 'python programming language' and return the titles and URLs of the top 5 results ordered by rank.
  • Get a single synthesized one-line answer for 'python programming language' using the free DuckDuckGo (ddg) provider, without any API key.

Search is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.