Skip to content

feat(web-search): add optional youcom search provider - #413

Open
mouse-value-add wants to merge 1 commit into
MemTensor:mainfrom
mouse-value-add:feat/youcom-search-integration
Open

mouse-value-add wants to merge 1 commit into
MemTensor:mainfrom
mouse-value-add:feat/youcom-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

What

Adds You.com as an opt-in web_search provider, following the exact same pattern as the existing brave / tavily / kagi / olostep providers in WebSearchTool.

Why

Memmy's agent runtime leans on web_search for anything current β€” docs lookups, research tasks, fresh context for the memory-driven workflows. The built-in DuckDuckGo path works but is HTML-scraped and rate-limit-prone (the code already defends against bot challenges), and the current keyed providers don't include a citation-first web search option. You.com's Search API returns ranked web results with snippets via a plain JSON endpoint, which slots cleanly into the existing provider switch.

Changes

  • src/core/agent-runtime/tools/web.ts: new youcom provider β€” POST https://ydc-index.io/v1/search with the X-API-Key header, results mapped through the existing formatResults helper. Key resolution follows the other providers: tools.web.search.apiKey first, then YDC_API_KEY. Without a key it falls back to DuckDuckGo, so default behavior is completely unchanged.
  • src/entrypoints/frontend-bridge/settings-api.ts: adds You.com to WEB_SEARCH_PROVIDER_OPTIONS so it shows up in the desktop settings provider list (credential: "api_key").
  • tests/core/agent-runtime/tools/web-search-tool.test.ts: 5 new cases mirroring the Brave/Tavily tests β€” request shape (endpoint, X-API-Key, body), snippet-over-description preference, description fallback, error reporting, and the no-key β†’ DuckDuckGo fallback.
  • docs/en/tools/mcp.mdx + docs/cn/tools/mcp.mdx: documents the full provider list and where keys come from (the provider list wasn't written down anywhere before).

Setup

tools:
  web:
    enabled: true
    search:
      provider: youcom
      apiKey: ${YDC_API_KEY}
      maxResults: 5

API keys are available at you.com/platform/api-keys. I kept this entirely opt-in β€” no new dependencies, no config migration, nothing changes unless you explicitly set provider: youcom.

Validation

  • npx vitest run on the touched suites: 112 tests passing (30 in web-search-tool.test.ts, 10 in settings-api.test.ts, plus tool-loader / searchusage / build-status).
  • npm run typecheck clean.

Notes

For anyone who'd rather use You.com through MCP than the REST API, You.com also exposes a hosted MCP server (https://api.you.com/mcp) that works with Memmy's existing tools.mcpServers streamableHttp config β€” the provider here is just the lighter path when you want results inline in web_search.

Happy to adjust the shape if you'd prefer a different provider name or want the key env var renamed.

Add You.com as an opt-in web_search provider alongside brave, tavily,
searxng, jina, kagi, and olostep. Requests go to the You.com Search API
(POST https://ydc-index.io/v1/search) with the X-API-Key header, reusing
the existing WebSearchConfig apiKey / formatResults plumbing.

- falls back to DuckDuckGo when no key is configured (same as the other
  key-based providers), so default behavior is unchanged
- surfaces You.com in the desktop settings provider list
- documents the full provider list (en + zh-CN)
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