Integration
🔗

LangChain Integration

Connect SearchHive to LangChain agents and chains for powerful web-augmented LLM applications.

Features

✓ Native LangChain tool adapter
✓ Async support for chains
✓ Streaming search results
✓ Custom tool wrappers
✓ Agent integration patterns

Quick Start

import { SearchHive } from '@searchhive/sdk'
import { Tool } from 'langchain/tools'

class SearchHiveTool extends Tool {
  name = 'searchhive_search'
  description = 'Search the web for current information'

  async _call(query: string): Promise<string> {
    const client = new SearchHive({ apiKey: process.env.SEARCHHIVE_API_KEY })
    const results = await client.search({ query, maxResults: 5 })
    return JSON.stringify(results.organic.map(r => ({
      title: r.title,
      snippet: r.snippet,
      url: r.link
    })))
  }
}

Benefits

→Zero-config LangChain setup
→Production-ready tool adapter
→Works with all LLM providers
→Built-in rate limiting
→Comprehensive documentation

Start integrating today

Free tier includes 1,000 API calls/month.