How to Add Web Search to an AI Agent with Context.dev: Return Only the Relevant Passages
Blog post from Context.dev
Context.dev presents a web-search and content-extraction API designed for AI agents, combining ranked search results, relevance labels, page highlights, Markdown scraping, and multi-page answers under one API key. Its central feature, Highlights, extracts only query-relevant passages from pages or known URLs, including YouTube transcripts, helping agents avoid large volumes of navigation, ads, boilerplate, and other web noise that can consume context windows, raise costs, weaken reasoning, and increase prompt-injection exposure. The guide cites academic and company-reported benchmarks suggesting that retrieval-stage pruning can substantially reduce token use while preserving or improving task accuracy and grounding. Developers can use TypeScript, HTTP, or function-calling integrations to search up to 100 results, set character and cache-freshness limits, and request focused text in page order with headings and source information preserved. It also emphasizes resilient agent behavior through explicit per-result status codes for successful reads, timeouts, blocked sites, oversized content, and other failures, advising developers to retain URLs, titles, and descriptions even when content extraction is unavailable.
Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.