hermes-yandex-search-api
A Hermes Agent plugin that connects the Yandex Search API as a search engine for the agent.
It registers two capabilities:
| Capability | Type | What it does |
|---|---|---|
yandex |
Web-search backend provider | Plugs into Hermes' built-in web_search tool and returns classic web results (links with titles and snippets). |
yandex_generative_search |
Standalone tool | Returns a single grounded answer synthesised from live web sources, together with the source URLs it cites. |
Why these two search modes
The Yandex Search API offers several modes — classic web search, generative search, image search, deferred (async) web search, and Wordstat keyword statistics. This plugin deliberately wires up the two that fit an autonomous agent, each in the shape Hermes expects:
- Web search → a
web_searchbackend. Hermes already ships aweb_searchtool whose backend returns a list of{title, url, description}results. The classic Yandex web search maps onto that contract exactly, so the model can use the search tool it already knows without learning a new one. - Generative search → its own tool. Generative search returns a synthesised
answer with citations, not a list of links. That is a fundamentally different
result shape, so it is exposed as a distinct
yandex_generative_searchtool. It is the best fit when the agent wants a direct, grounded answer to a factual question.
The other modes are intentionally left out: image search returns image URLs
an agent cannot usefully consume, Wordstat is SEO keyword analytics unrelated
to agentic search, and deferred web search has a multi-minute latency that is
unusable for interactive turns. All of them can be added later on top of the same
YandexSearchClient if a use case appears.
About the Yandex Search API
The Yandex Search API is Yandex Cloud's paid programmatic access to Yandex web search and its generative answer engine. Requests are authenticated with a Yandex Cloud API key and are billed to the Yandex Cloud folder that owns the key. Both search modes used here run synchronously:
POST /v2/web/searchreturns Base64-encoded XML search results.POST /v2/gen/searchreturns a JSON grounded answer with cited sources.
See the pricing and quotas pages for current limits (roughly 10k web requests/hour and 1k generative requests/hour by default).
Requirements
- Hermes Agent
>= 0.19(tested against 0.19.x). - Python
>= 3.11, < 3.14. - A Yandex Cloud account with the Search API enabled, an API key, and the folder id that owns it.
Getting a Yandex Search API token
- Create or open a Yandex Cloud account and a folder (catalog). Note its folder id — you can copy it from the console URL or with the CLI: how to get the folder id.
- Create a service account in that folder and grant it the
search-api.webSearch.userrole. - Create an API key for that service account (Console → the service account
→ API keys → Create API key), or via CLI:
yc iam api-key create --service-account-name <sa-name> --format json
Copy thesecretvalue — this is yourYANDEX_API_KEY. - Make sure the Search API is enabled for the folder and that billing is active.
You now have the two values the plugin needs: YANDEX_API_KEY and
YANDEX_FOLDER_ID.
Installing the plugin into Hermes
Option A — install from Git (recommended)
hermes plugins install akinfold/hermes-yandex-search-api --enable
Option B — drop-in directory
Copy the plugin directory into your Hermes plugins folder under the web
category, then enable it:
mkdir -p ~/.hermes/plugins/web
cp -r hermes_yandex_search ~/.hermes/plugins/web/yandex
hermes plugins enable yandex
(Or download hermes-yandex-search-plugin-<version>.zip from a
GitHub Release
and unzip it into ~/.hermes/plugins/web/.)
Option C — pip
pip install hermes-yandex-search-api
hermes plugins enable yandex
Hermes discovers the plugin through the hermes_agent.plugins entry point.
Configuring the token in Hermes
The plugin reads its credentials from the environment, resolved the way every
Hermes web backend resolves them: os.environ first, then ~/.hermes/.env.
The simplest, persistent option is to put them in ~/.hermes/.env:
YANDEX_API_KEY=your-api-key
YANDEX_FOLDER_ID=your-folder-id
# Optional: market/domain, default SEARCH_TYPE_RU.
# One of SEARCH_TYPE_RU | SEARCH_TYPE_COM | SEARCH_TYPE_TR | SEARCH_TYPE_KK | SEARCH_TYPE_BE | SEARCH_TYPE_UZ
YANDEX_SEARCH_TYPE=SEARCH_TYPE_RU
# Optional: override the API base URL (for a private gateway / testing).
# YANDEX_SEARCH_API_URL=https://searchapi.api.cloud.yandex.net
hermes plugins install ... --enable will also prompt for the values declared in
the plugin manifest (YANDEX_API_KEY, YANDEX_FOLDER_ID) during installation.
Selecting Yandex as the web-search backend
To route Hermes' built-in web_search tool to Yandex, set the backend in
~/.hermes/config.yaml:
web:
search_backend: yandex
plugins:
enabled:
- yandex
The yandex_generative_search tool becomes available as soon as the plugin is
enabled — no extra configuration needed.
Configuration reference
| Variable | Required | Default | Description |
|---|---|---|---|
YANDEX_API_KEY |
yes | – | Yandex Cloud API key. |
YANDEX_FOLDER_ID |
yes | – | Yandex Cloud folder ("catalog") id. |
YANDEX_SEARCH_TYPE |
no | SEARCH_TYPE_RU |
Search market/domain enum. |
YANDEX_SEARCH_API_URL |
no | https://searchapi.api.cloud.yandex.net |
API base URL override. |
Development
python -m venv .venv && source .venv/bin/activate
pip install -e '.[dev]'
ruff check . # lint
ruff format --check . # code style
pytest # unit tests (live E2E tests are deselected by default)
The package layout separates a Hermes-independent API client from the host integration:
hermes_yandex_search/client.py— theYandexSearchClient(pure HTTP + parsing, no Hermes imports).hermes_yandex_search/provider.py— theyandexweb-search backend provider.hermes_yandex_search/generative.py— theyandex_generative_searchtool.hermes_yandex_search/config.py— builds a client from environment variables.hermes_yandex_search/__init__.py—register(ctx), the plugin entry point.
Running the live E2E tests
The E2E suite (marked e2e, deselected by default) hits the live Yandex
Search API and, when hermes-agent is installed, a live Hermes host.
Locally
Store your API key in a file (created with restrictive permissions), and the folder id in a companion file:
umask 077 && printf '%s' 'your-yandex-search-api-key' > ~/.yandex-search-api-key
umask 077 && printf '%s' 'your-yandex-folder-id' > ~/.yandex-folder-id
(Alternatively, export YANDEX_API_KEY and YANDEX_FOLDER_ID in your shell —
environment variables take precedence over the files.) Then:
pytest -m e2e -v
The Hermes-host test (tests/e2e/test_live_hermes.py) skips automatically unless
hermes-agent is importable; install it with pip install hermes-agent to run
it.
On GitHub Actions
The E2E (live) workflow (.github/workflows/e2e.yml) is manual
(Actions → E2E (live) → Run workflow). It reads credentials from a GitHub
Environment
so they are never committed to the repo.
If you fork this repository and want to run the live E2E workflow, set up the Environment once:
- Open Settings → Environments → New environment and name it
yandex-e2e(the name the workflow references). - Under that environment, add two secrets:
YANDEX_API_KEY— your Yandex Cloud API key.YANDEX_FOLDER_ID— your Yandex Cloud folder id.
- Optionally add an environment variable
YANDEX_SEARCH_TYPE(e.g.SEARCH_TYPE_COM) to change the default market. You can also override it per-run via the workflow input. - (Recommended) Add required reviewers to the environment so live runs must be approved — this gates access to the paid API.
- Run the workflow from the Actions tab.
Releases and publishing
Hermes plugins are distributed in two places, and this repo automates both:
- As a Git repository, installable with
hermes plugins install akinfold/hermes-yandex-search-api. - On PyPI as
hermes-yandex-search-api, discovered through thehermes_agent.pluginsentry point.
Workflows:
release-build.yml— builds the wheel, sdist, and the drop-in plugin.zip(reusable; also runnable manually).release-publish.yml— on av*tag, builds the artifacts, creates a GitHub Release with them attached, and (optionally) publishes to PyPI.
To cut a release:
git tag v0.1.0
git push origin v0.1.0
PyPI publishing is opt-in: set the repository variable PUBLISH_TO_PYPI=true and
configure a PyPI Trusted Publisher
for the release-publish.yml workflow (environment pypi). Without it, releases
still build and attach artifacts to the GitHub Release.
To list the plugin in the community index, submit it to awesome-hermes-agent.
License
MIT © Roman Akinfeev
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hermes_yandex_search_api-0.1.1.tar.gz.
File metadata
- Download URL: hermes_yandex_search_api-0.1.1.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68d57c9f6981ee001139769d38274587115eac420efff648feb604a79c97b2a2
|
|
| MD5 |
76a613077816d74b2189ebf69a2dac35
|
|
| BLAKE2b-256 |
ad43c4b234f2f75256bdb466bd7394500293252de961003ca5b9b3e8bcb601a9
|
Provenance
The following attestation bundles were made for hermes_yandex_search_api-0.1.1.tar.gz:
Publisher:
release-publish.yml on akinfold/hermes-yandex-search-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hermes_yandex_search_api-0.1.1.tar.gz -
Subject digest:
68d57c9f6981ee001139769d38274587115eac420efff648feb604a79c97b2a2 - Sigstore transparency entry: 2240877515
- Sigstore integration time:
-
Permalink:
akinfold/hermes-yandex-search-api@4a338538a10979caffe41c21eabdc1ca26797b48 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/akinfold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-publish.yml@4a338538a10979caffe41c21eabdc1ca26797b48 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hermes_yandex_search_api-0.1.1-py3-none-any.whl.
File metadata
- Download URL: hermes_yandex_search_api-0.1.1-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d90971060070bc8c6c5f2ece93295c25dec42eca093c1dbd19529e0f623cf70b
|
|
| MD5 |
8cd1700c968dad0294f7609c46427e6e
|
|
| BLAKE2b-256 |
86f3f6cab46ba7a8e2969e52e3b52df52dea8a7b2831e74a6cc48af1995997e1
|
Provenance
The following attestation bundles were made for hermes_yandex_search_api-0.1.1-py3-none-any.whl:
Publisher:
release-publish.yml on akinfold/hermes-yandex-search-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hermes_yandex_search_api-0.1.1-py3-none-any.whl -
Subject digest:
d90971060070bc8c6c5f2ece93295c25dec42eca093c1dbd19529e0f623cf70b - Sigstore transparency entry: 2240878373
- Sigstore integration time:
-
Permalink:
akinfold/hermes-yandex-search-api@4a338538a10979caffe41c21eabdc1ca26797b48 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/akinfold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-publish.yml@4a338538a10979caffe41c21eabdc1ca26797b48 -
Trigger Event:
push
-
Statement type: