Skip to content
DOCS — INTEGRATIONS · WEB SEARCH

Web Search

OpenMed does not search the web unless you turn it on — on every provider, including OpenAI and ChatGPT OAuth. This page explains why, what enabling it sends where, and how to configure it.

Why it is off by default

A search query built from a case tends to contain clinical detail. Sending that query to a hosted search API makes that vendor a third-party data processor for your patient data. That is a decision an operator should make deliberately, with knowledge of which vendor and under which agreement — not one inherited from a default.

There is a second reason, specific to clinical work. OpenAI's Responses API can run a provider-side search where the model searches and returns prose. Those results never reach OpenMed as inspectable sources, so a claim drawn from them cannot be traced back to a page you can open and check. OpenMed's evidence rules require citations to be verifiable, so OpenMed does not request provider-side search unless you opt in separately; see provider-native search. The search on this page runs client-side, and every result becomes a source record with a URL you can inspect.

What still works with search off

Search being off does not mean OpenMed is cut off from evidence:

  • PubMed, MedlinePlus and RxNorm lookups work normally and do not use a third-party search vendor. Those queries go from your machine to the public APIs, so avoid identifiers in them.
  • fetch_web_page retrieves a specific URL you or the agent already has.
  • The literature and guideline workflows are unaffected.

What is unavailable is open-ended discovery — "find me recent papers on X" where no URL is known yet.

Enabling it

Two things are required: the feature flag, and a backend key. A key on its own does nothing, so that adding a key for another purpose can never silently start sending clinical text to a vendor.

export OPENMED_WEB_SEARCH=1
export SERPER_API_KEY="..."

The flag accepts 1, true, yes or on. Restart OpenMed after changing it.

Supported backends:

Backend Key Sign-up
Serper SERPER_API_KEY https://serper.dev
Tavily TAVILY_API_KEY https://tavily.com
Brave Search BRAVE_SEARCH_API_KEY https://brave.com/search/api/

With more than one key present, OpenMed picks the first configured backend in the order above. To pin one explicitly:

export OPENMED_WEB_SEARCH_BACKEND=tavily

Keys can also live in ~/.openmed/service_secrets.json rather than the environment. Each backend has its own top-level field:

{
  "web_search_serper_api_key": "...",
  "web_search_tavily_api_key": "...",
  "web_search_brave_api_key": "..."
}

Include only the backends you use. A value can be "{env:NAME}" to read it from the environment variable NAME.

Keys are sent as request headers, not as query parameters, so they do not appear in request URLs. They are not embedded in the binary, and openmed env does not print them.

Checking the state

openmed env

reports whether search is enabled and which backend is active. When the flag is set but no usable backend is found, the search tool stays available and tells the model what is missing, so it can tell you what to do. Without the flag, the tool is not offered to the model at all.

What gets sent

When enabled, the search query goes to the backend you configured. The query is composed by the model from the conversation, so assume it can contain clinical detail. The rest of the case is not sent.

Search results come back as titles, URLs and snippets. Snippets are the search engine's summaries, not page content. The agent is instructed to fetch a page with fetch_web_page before citing anything from it.

PHI and third-party search

If you handle PHI under HIPAA or equivalent, treat a search vendor as a sub-processor. Confirm your agreement covers it before enabling search on sessions that touch patient data, or keep search off and rely on the PubMed and guideline tools, which do not use one.

Turning it off

unset OPENMED_WEB_SEARCH

After a restart, the search tool is not offered to the model.