Skip to content

feat: add optional you.com search integration - #548

Open
brainsparker wants to merge 1 commit into
OpenBMB:mainfrom
brainsparker:feat/youcom-search
Open

brainsparker wants to merge 1 commit into
OpenBMB:mainfrom
brainsparker:feat/youcom-search

Conversation

@brainsparker

Copy link
Copy Markdown

I work at You.com. This follows up on #534 and @xhd0728's note there: Tavily stays the default, and this adds youcom as one more opt-in websearch_backend, keyed only (YDC_API_KEY). It is modeled on the Serply backend from #531.

What changes

  • servers/retriever/src/websearch_backends/youcom_backend.py: new YoucomWebSearchBackend. It sends POST https://ydc-index.io/v1/search with X-API-Key, maps results.web[] to passages (snippets joined, description as fallback, empty results dropped), and trims to top_k.
  • Errors: 401/403 raise ToolError (bad key), 402 raises ToolError (out of credits), 429 retries and waits for Retry-After when the server sends it, otherwise the usual exponential backoff. Other failures retry like the other backends and return [] at the end.
  • websearch_backends/__init__.py: registers youcom.
  • servers/retriever/parameter.yaml: adds youcom to the options comment and a youcom block with the same fields Serply uses. websearch_backend stays tavily.
  • .env.dev: adds YDC_API_KEY=. AGENTS.md: lists youcom among the backends.
  • The User-Agent is youdotcom-integration/openbmb-ultrarag, so we can see on our side how much traffic comes from UltraRAG. Happy to change it to UltraRAG like Serply if you prefer.

To use it: set YDC_API_KEY and websearch_backend: youcom. Keys come from https://you.com/platform?utm_source=openbmb-ultrarag&utm_medium=oss_integration&utm_campaign=2026-10-oss-integrations&utm_content=pr_body

Tests

tests/servers/retriever/test_youcom_websearch_backend.py runs against a local aiohttp server, the same way the Serply test does. It covers:

  • the request body, key and User-Agent;
  • snippet and description handling, top_k, and empty results;
  • the env var key;
  • a missing key;
  • 401/403/402 failing at once with no retry;
  • 429 honoring Retry-After;
  • 429 running out of retries.
$ pytest -q tests/servers/retriever/test_youcom_websearch_backend.py tests/servers/retriever/test_serply_websearch_backend.py
10 passed

ruff format is clean. ruff check reports the same rule groups it already reports on serply_backend.py (typing aliases, broad except). I kept the file's style matching the other backends instead of changing it.

On keyless mode: I left it out because #534 said keyed-only was fine. If you want it later, it would be a small follow-up.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant