> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-lsapi-1779323176-451247e.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# You.com retriever

> Integrate with the You.com retriever using LangChain JavaScript.

The [You.com API](https://api.you.com) provides real-time web search designed for LLM and RAG applications.

## Overview

This will help you get started with the `YouRetriever` [retrieval](/oss/javascript/langchain/retrieval). For web search tools built on the dedicated LangChain integration package, see [You.com search tools](/oss/javascript/integrations/tools/youdotcom).

### Integration details

| Retriever      | Source               |                              Package                              |
| :------------- | :------------------- | :---------------------------------------------------------------: |
| `YouRetriever` | Real-time web search | [`@langchain/community`](https://npmjs.com/@langchain/community/) |

## Setup

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

```typescript theme={null}
process.env.YDC_API_KEY = "your-api-key";
```

If you want automated tracing from individual queries, set your [LangSmith](/langsmith/home) API key:

```typescript theme={null}
// process.env.LANGSMITH_API_KEY = "<YOUR API KEY HERE>";
// process.env.LANGSMITH_TRACING = "true";
```

### Installation

This retriever lives in the `@langchain/community` package:

<CodeGroup>
  ```bash npm theme={null}
  npm install @langchain/community @langchain/core
  ```

  ```bash yarn theme={null}
  yarn add @langchain/community @langchain/core
  ```

  ```bash pnpm theme={null}
  pnpm add @langchain/community @langchain/core
  ```
</CodeGroup>

## Instantiation

```typescript theme={null}
import { YouRetriever } from "@langchain/community/retrievers/you";

const retriever = new YouRetriever({ k: 5 });
```

## Usage

```typescript theme={null}
const query = "latest AI developments";

const docs = await retriever.invoke(query);
```

## API reference

For more details, see the [You.com API documentation](https://api.you.com).

***

<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/retrievers/youdotcom.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
