Skip to content

feat: add optional You.com search integration - #784

Open
mouse-value-add wants to merge 6 commits into
langchain-ai:mainfrom
mouse-value-add:feat/youcom-search-integration
Open

feat: add optional You.com search integration#784
mouse-value-add wants to merge 6 commits into
langchain-ai:mainfrom
mouse-value-add:feat/youcom-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

Overview

This PR adds an optional You.com web search integration to Deep Agents, providing an alternative search provider alongside the existing Tavily integration in the research examples.

What's Changed

  • New You.com search tool (tools/youcom-search.ts) with full TypeScript support
  • Enhanced research agent that includes both Tavily and You.com search options
  • Standalone example (youcom-search-agent.ts) demonstrating You.com-only usage
  • Comprehensive documentation (README-youcom.md) with setup, usage, and troubleshooting

Key Features

Flexible authentication: Works with or without API key (keyless mode supported)
Error handling: Graceful handling of rate limits, auth errors, and network issues
TypeScript integration: Full type safety with Zod schema validation
LangChain compatibility: Follows standard LangChain tool patterns
Zero breaking changes: Pure additive integration, existing code unchanged

Usage

Basic Setup (Keyless)

import { youcomSearch } from "./tools/youcom-search.js";

const agent = createDeepAgent({
  model: new ChatAnthropic({ model: "claude-sonnet-4-20250514" }),
  tools: [youcomSearch], // Works without API key
});

Enhanced Setup (With API Key)

# Optional: Add to .env for enhanced features
YDC_API_KEY=your_api_key

Integration Approach

This integration follows Deep Agents' existing patterns:

  • Uses the same tool structure as the Tavily integration
  • Maintains consistency with existing search tool interfaces
  • Provides multiple search provider options for research workflows
  • Includes proper error handling and user feedback

Testing

The integration has been tested for:

  • ✅ TypeScript compilation and type safety
  • ✅ Tool parameter validation with Zod schemas
  • ✅ Error handling for various API scenarios
  • ✅ Integration with Deep Agents' tool system
  • ✅ Keyless and authenticated operation modes

Why This Integration

You.com's search API provides:

  • High-quality, curated search results
  • Strong source attribution and citations
  • Flexible authentication options
  • Complementary capabilities to existing search providers

This gives Deep Agents users more choice in search providers and can improve research quality by combining multiple search sources.

Related Issue

Tracking: youdotcom-oss/integration-tracking#212

- Add youcom-search.ts tool for web search using You.com API
- Support both authenticated (YDC_API_KEY) and keyless modes
- Add You.com search to research agent alongside existing Tavily
- Include standalone youcom-search-agent.ts example
- Add comprehensive README-youcom.md documentation
- Follow Deep Agents tool patterns and conventions
- Graceful error handling for rate limits and auth issues
@changeset-bot

changeset-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 360c0f3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

mouse-value-add is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

- Replace instanceof check with typeof check to satisfy no-instanceof rule
- Fix template string formatting in research-agent.ts
@mouse-value-add

Copy link
Copy Markdown
Author

I found the CI formatting failures are due to invalid Unicode escape sequences in the commented-out example code. The issues are on lines 226, 229-231, and 236 where template literals contain nested backticks which confuse the formatter.

The main integration code is working correctly - these are just formatting issues in the example usage comments. The quickest fix would be to either:

  1. Remove the problematic commented lines entirely, or
  2. Replace the nested template literals with string concatenation

The You.com search integration itself is functional and ready to use.

- Fix unterminated template string by properly closing template literal on line 201
- Replace nested template literals with string concatenation in commented examples to avoid Unicode escape sequence issues
- All linting checks now pass
@mouse-value-add

Copy link
Copy Markdown
Author

Fixed the CI linting failures! The issues were:

  1. Unterminated template string - The template literal on line 201 had malformed escape sequences
  2. Nested template literals in comments - Lines 226, 229-231, and 236 had problematic nested backticks in commented examples

Resolution:

  • Fixed the template string termination on line 201
  • Replaced nested template literals with string concatenation in the commented example code
  • All linting checks now pass with 0 warnings and 0 errors

The You.com search integration functionality remains unchanged and is ready for review. The integration adds optional You.com search capabilities to the research agent toolkit, following the existing pattern for tool registration.

@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

Copy link
Copy Markdown

Open in StackBlitz

deepagents-acp

npm i https://pkg.pr.new/deepagents-acp@784

deepagents

npm i https://pkg.pr.new/deepagents@784

@langchain/sandbox-standard-tests

npm i https://pkg.pr.new/@langchain/sandbox-standard-tests@784

@langchain/daytona

npm i https://pkg.pr.new/@langchain/daytona@784

@langchain/deno

npm i https://pkg.pr.new/@langchain/deno@784

@langchain/modal

npm i https://pkg.pr.new/@langchain/modal@784

@langchain/node-vfs

npm i https://pkg.pr.new/@langchain/node-vfs@784

@langchain/quickjs

npm i https://pkg.pr.new/@langchain/quickjs@784

commit: 360c0f3

@mouse-value-add

Copy link
Copy Markdown
Author

On the changeset warning: this PR only touches examples/ (no package source), so it intentionally doesn't bump any packages — no changeset needed per the bot's own guidance. All checks are green on the latest commit.

@mouse-value-add

Copy link
Copy Markdown
Author

Clarification on my earlier changeset comment: the examples package is in the changeset ignore list in .changeset/config.json, so no changeset is needed here (I briefly added one and reverted it — the bot's guidance applies and the PR correctly bumps nothing). Branch is current with all checks green.

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