Many LangChain agents use BraveSearchResults as their web search tool. With Brave's free tier removed in February 2026, these agents now face unexpected costs. This tutorial replaces the Brave tool with langchain-scavio, which provides 500 free credits per month and access to 5 platforms.
Prerequisites
- Python 3.10+
- LangChain installed
- A Scavio API key
Walkthrough
Step 1: Install langchain-scavio
Replace the Brave search package with Scavio's LangChain integration.
# Remove Brave search (optional, but clean):
pip uninstall langchain-community # if only used for Brave
# Install Scavio LangChain integration:
pip install langchain-scavioStep 2: Replace tool initialization
Swap BraveSearchResults for ScavioSearchResults in your agent setup.
# BEFORE (Brave):
# from langchain_community.tools import BraveSearch
# search_tool = BraveSearch.from_api_key(api_key=os.environ['BRAVE_API_KEY'])
# AFTER (Scavio):
from langchain_scavio import ScavioSearchResults
import os
search_tool = ScavioSearchResults(
api_key=os.environ['SCAVIO_API_KEY'],
platform='google', # or 'reddit', 'youtube', 'amazon', 'walmart'
)Step 3: Add multi-platform tools (optional)
Add platform-specific tools for richer agent capabilities.
from langchain_scavio import ScavioSearchResults
# Create tools for different platforms:
google_tool = ScavioSearchResults(api_key=os.environ['SCAVIO_API_KEY'], platform='google')
reddit_tool = ScavioSearchResults(api_key=os.environ['SCAVIO_API_KEY'], platform='reddit')
youtube_tool = ScavioSearchResults(api_key=os.environ['SCAVIO_API_KEY'], platform='youtube')
# Use in agent:
tools = [google_tool, reddit_tool, youtube_tool]
# The agent can now search Google for facts, Reddit for opinions,
# and YouTube for tutorials - all under one API key and credit pool.Step 4: Update your agent
Wire the new tools into your existing LangChain agent.
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate
llm = ChatAnthropic(model='claude-sonnet-4-6')
tools = [google_tool, reddit_tool]
prompt = ChatPromptTemplate.from_messages([
('system', 'You are a research assistant. Use search tools to find current information.'),
('human', '{input}'),
('placeholder', '{agent_scratchpad}'),
])
agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools)
result = executor.invoke({'input': 'What is the current state of the SerpAPI lawsuit?'})
print(result['output'])Python Example
from langchain_scavio import ScavioSearchResults
import os
tool = ScavioSearchResults(api_key=os.environ['SCAVIO_API_KEY'], platform='google')
result = tool.invoke('python web framework comparison 2026')
print(result)JavaScript Example
// langchain-scavio is Python-only. For JS, use HTTP directly:
const tool = {
name: 'web_search',
func: async (query) => {
const r = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
body: JSON.stringify({platform: 'google', query})
});
return JSON.stringify((await r.json()).organic?.slice(0,5));
}
};Expected Output
A LangChain agent using langchain-scavio instead of BraveSearch, with multi-platform search capabilities and 500 free credits per month.