> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# You.com search tools

> Integrate with the You.com search tools using LangChain JavaScript.

The `@youdotcom-oss/langchain` package provides three `DynamicStructuredTool` instances for web search and content extraction, built for LangChain.js agents.

## Setup

Install the package with your preferred package manager:

<CodeGroup>
  ```bash npm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  npm install @youdotcom-oss/langchain
  ```

  ```bash yarn theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  yarn add @youdotcom-oss/langchain
  ```

  ```bash pnpm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pnpm add @youdotcom-oss/langchain
  ```
</CodeGroup>

Set your You.com API key. Get your API key at [you.com/platform](https://you.com/platform).

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
process.env.YDC_API_KEY = "your-api-key";
```

## Available tools

### `youSearch`

Web and news search with advanced filtering (dates, sites, file types).

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { youSearch } from "@youdotcom-oss/langchain";

const searchTool = youSearch({ apiKey: process.env.YDC_API_KEY });
const result = await searchTool.invoke({ query: "latest AI developments", count: 5 });
```

### `youResearch`

Comprehensive answers with cited sources. Supports configurable effort levels: `lite`, `standard`, `deep`, and `exhaustive`.

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { youResearch } from "@youdotcom-oss/langchain";

const researchTool = youResearch({ apiKey: process.env.YDC_API_KEY });
const result = await researchTool.invoke({ query: "WebAssembly vs JavaScript performance" });
```

### `youContents`

Extract full page content from URLs in markdown or HTML format.

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { youContents } from "@youdotcom-oss/langchain";

const contentsTool = youContents({ apiKey: process.env.YDC_API_KEY });
const result = await contentsTool.invoke({ urls: ["https://example.com/article"] });
```

## Use with an agent

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { createAgent, initChatModel } from "langchain";
import { youSearch, youResearch, youContents } from "@youdotcom-oss/langchain";

const model = await initChatModel("claude-haiku-4-5", { temperature: 0 });

const agent = createAgent({
  model,
  tools: [
    youSearch(),
    youResearch(),
    youContents(),
  ],
  systemPrompt: "You are a helpful research assistant. Always cite your sources.",
});

const result = await agent.invoke({
  messages: [{ role: "user", content: "What are the latest developments in AI?" }],
});
```

For more details, see the [You.com LangChain package README](https://github.com/youdotcom-oss/dx-toolkit/tree/main/packages/langchain#readme).

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/tools/youdotcom.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
