Skip to main content

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.

The You.com API provides real-time web search designed for LLM and RAG applications.

Overview

This will help you get started with the YouRetriever retrieval. For web search tools built on the dedicated LangChain integration package, see You.com search tools.

Integration details

RetrieverSourcePackage
YouRetrieverReal-time web search@langchain/community

Setup

Set your You.com API key. Get your API key at you.com/platform.
process.env.YDC_API_KEY = "your-api-key";
If you want automated tracing from individual queries, set your LangSmith API key:
// process.env.LANGSMITH_API_KEY = "<YOUR API KEY HERE>";
// process.env.LANGSMITH_TRACING = "true";

Installation

This retriever lives in the @langchain/community package:
npm install @langchain/community @langchain/core

Instantiation

import { YouRetriever } from "@langchain/community/retrievers/you";

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

Usage

const query = "latest AI developments";

const docs = await retriever.invoke(query);

API reference

For more details, see the You.com API documentation.