LlamaIndex
LlamaIndex includes a You.com retriever integration through the llama-index-retrievers-you package. It uses You.com’s Search API to retrieve relevant web and news results, converting them into LlamaIndex’s standard NodeWithScore format for use with query engines, agents, and other components.
Getting Started
Install the package
Set your API key
Get your API key at you.com/platform/api-keys.
Basic Usage
Set up the retriever and retrieve web results:
Each result includes the page text along with metadata such as url, title, description, page_age, thumbnail_url, and source_type (either "web" or "news").
Async Usage
The retriever also supports async operations:
News Results
The Search API automatically includes news results based on your query. You can control how many results are returned per type and filter by country:
Customizing Search Parameters
You can pass optional parameters to control the search behavior:
Using with a Query Engine
Combine the retriever with an LLM to synthesize natural language answers from search results:
The query engine retrieves relevant search results from You.com, passes them as context to the LLM, and returns a synthesized answer.