Skip to main content
Integrations

Dify

The Kaer plugin lets Dify agents, chatflows and workflows search the web through Kaer Search. It adds one tool, Kaer Search, which takes a query and returns ranked results with titles, links and snippets. On the deep lane each result also carries the page's main text.

Plugin
kaer-ai/kaer in the Dify Marketplace
Requires
Dify 1.10.0 or later
Price
Each search is billed like POST /v1/search, see Search pricing

#Before you begin

  • A key with the search scope. See Authentication.
  • Search open on your account: add a card in Billing, which comes with 1,000 free web searches, or make a first top-up of $5 or more. Until then a search returns 403 tier_required.
  • Dify 1.10.0 or later. The dark-theme icon shows from Dify 1.11.0.
  • Outbound HTTPS from your Dify instance to api.kaer.ai on port 443. The plugin connects to no other host.

#Install the plugin

  1. In Dify, open Plugins, find Kaer in the Marketplace and install it.
  2. Open the installed plugin and add your API key in its authorisation settings.
  3. Save. Dify checks the key by running one search on the web lane for one result. That check is billed like any other web search; a check that fails is not billed.

Dify stores the key with your other tool credentials. The plugin sends it only to api.kaer.ai, in the Authorization: Bearer header.

#Set the parameters

Add Kaer Search to an agent, a chatflow or a workflow tool node.

ParameterSet byDefaultWhat it does
queryThe model or youRequiredWhat to search for, 1 to 512 characters.
laneYou, in the node settingsautoHow Kaer runs the search. See Choose a lane.
num_resultsYou, in the node settings5Results to return, from 1 to 25.
include_domainsThe model or youEmptyComma-separated hosts that results must come from, such as bbc.co.uk, reuters.com. Subdomains count. Up to 20.
exclude_domainsThe model or youEmptyComma-separated hosts to leave out. Up to 20.

Hosts can be typed as example.com, https://example.com/page or *.example.com; the plugin keeps the host name only.

#Choose a lane

LaneWhat it doesPer queryTimeout
webKaer's own index alone. Fastest and cheapest.$0.00056 s
fastKaer's index racing the live web.$0.00112 s
deepEvery lane, re-ranked. Results carry the page's main text, up to 4,000 characters, when the page could be read.$0.00340 s
autoKaer picks a lane for each query and bills the lane that served it.As served40 s

A search that fails or runs out of time is not billed.

#Read the output

The tool node gives you two outputs:

  • text: a short summary for people and models. A line naming the query and the lane that served it comes first, then Kaer's instant answer when there is one. Each result follows with its title, link, publication date when known and snippet (up to 400 characters); deep results add up to 800 characters of the page text, and drop the snippet when the page text begins with it. Notes from Kaer come last.
  • json: the full Search response, so later nodes can read any field, such as served_lane, results[].url, results[].text (deep only), answer, warnings and kaer.request_id.
Example text output
Kaer search for "uk bank holidays 2027" (auto lane, served by fast, 1 result)

1. Bank holidays - GOV.UK
   https://www.gov.uk/bank-holidays
   The next bank holiday in England and Wales is ...

#Handle errors

An error stops the tool with a message that says what to do, with the HTTP status, Kaer's error code and the request ID; a timeout or a connection failure says so instead. In an agent, the model sees the message and can try again. Input problems, such as an empty query or a value in include_domains that is not a host name, are reported before any request is sent.

StatusCodeWhat it means
401invalid_api_keyThe key is malformed, unknown, revoked or expired.
402insufficient_creditsYour balance cannot cover the call's hold. Free credit never pays for mail.
403tier_requiredYour tier does not include this service yet.
403insufficient_scopeThe key does not have the endpoint's scope.
403ip_not_allowedThe caller's IP is not on the key's allow-list.
429rate_limit_exceededToo many requests this minute for the key or the account, or too many invalid keys from your address.
429too_many_concurrent_searchesYour account already has its maximum of searches in flight: your tier's figure, or your search plan's when that is higher.
502search_failedThe search service failed. Nothing was charged.
503search_busySearch is at capacity. Nothing was charged.
502 or 503search_unavailableSearch is unreachable or paused. Nothing was charged.
504search_timeoutSearch ran out of time. Nothing was charged.

Every code, with its fix, is in Errors.