LlamaIndex Integration
Use SERPHouse AI SDK with LlamaIndex for live web search in AI agents.
The SERPHouse AI SDK is a Python SDK for the SERPHouse search API, built to plug live web search data directly into AI agents. It provides first-class, framework-native integrations for both LangChain and LlamaIndex.
Installation
Quick setup with a single pip command.
pip install serphouse-ai-sdk[llamaindex]For all frameworks:
pip install serphouse-ai-sdk[all]API Key Setup
Set your SERPHOUSE_API_KEY environment variable before using the SDK.
export SERPHOUSE_API_KEY=your_key_hereAvailable Tools
| Tool | Description | Endpoint |
|---|---|---|
search() | Google Web Search | /web-search-lite |
news() | Google News Search | /google-news |
short_video() | Google Short Videos Search | /google-short-videos-api |
Usage Example
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from serphouse.llamaindex import search, news, short_video
agent = FunctionAgent(
llm=OpenAI(model="gpt-4"),
tools=[search(), news(), short_video()],
)
response = agent.run("Latest AI news from OpenAI")
print(response)Works with OpenAI, Anthropic Claude, and Google Gemini models.
Related Links
Last updated on
How is this guide?