LangChain
LangChain is one of the most popular frameworks for building LLM-powered applications. By connecting You.com’s search and content APIs to LangChain, you can ground your agents and RAG pipelines in real-time, accurate web data instead of relying on static training knowledge alone.
The langchain-youdotcom package provides three integration points: a search tool (YouSearchTool), a content extraction tool (YouContentsTool), and a retriever (YouRetriever). Drop them into any LangChain agent or chain to give it live web access.
Getting Started
Install the package
Set your API key
Get your API key at you.com/platform/api-keys.
Usage
YouSearchTool
YouSearchTool wraps the You.com Search API as a LangChain tool, making it available to any agent that uses tools.
To customize search parameters, pass them via api_wrapper:
YouContentsTool
YouContentsTool fetches and extracts clean content from web pages.
YouRetriever
YouRetriever implements LangChain’s retriever interface, making it a drop-in for any RAG pipeline.
To use it in a retrieval chain:
Agent with LangGraph
Both tools work with any LangChain agent. Here’s an example using create_agent:
Community package
You.com is also available via langchain-community:
The standalone langchain-youdotcom package is recommended for new projects as it stays up to date with the latest You.com API features.