[Go to site: main page, start]

Skip to main content
For AI agents: a documentation index is available at https://docs.parallel.ai/llms.txt. The full text of all docs is at https://docs.parallel.ai/llms-full.txt. You may also fetch any page as Markdown by appending .md to its URL or sending Accept: text/markdown.
Add Parallel’s search and extract tools and search-powered chat model to your LangChain applications.
View the complete repository for this integration here

Features

  • Chat Models: ChatParallelWeb - Real-time web research chat completions
  • Search Tools: ParallelWebSearchTool - Direct access to Parallel’s Search API
  • Extract Tools: ParallelExtractTool - Clean content extraction from web pages
  • Streaming Support: Real-time response streaming
  • Async/Await: Full asynchronous operation support
  • OpenAI Compatible: Uses familiar OpenAI SDK patterns
  • LangChain Integration: Seamless integration with LangChain ecosystem

Installation

Setup

  1. Get your API key from Parallel
  2. Set your API key as an environment variable:

Chat Models

ChatParallelWeb

The ChatParallelWeb class provides access to Parallel’s Chat API, which combines language models with real-time web research capabilities.

Basic Usage

Streaming Responses

Async Operations

Conversation Context

Configuration Options

Real-Time Web Research

Parallel’s Chat API provides real-time access to web information, making it perfect for:
  • Current Events: Get up-to-date information about recent events
  • Market Data: Access current stock prices, market trends
  • Research: Find the latest research papers, developments
  • Weather: Get current weather conditions
  • News: Access breaking news and recent articles

Integration with LangChain

Chains

Agents

Search API

The Search API provides direct access to Parallel’s web search capabilities, returning structured, compressed excerpts optimized for LLM consumption.

ParallelWebSearchTool

The search tool provides direct access to Parallel’s Search API:

Search API Configuration

turbo mode requires langchain-parallel v0.5.0 or later.

Search with Specific Queries

You can provide specific search queries instead of an objective:

Tool Usage in Agents

The search tool works seamlessly with LangChain agents:

Extract API

The Extract API provides clean content extraction from web pages, returning structured markdown-formatted content optimized for LLM consumption.

ParallelExtractTool

The extract tool extracts clean, structured content from web pages:

Extract with Search Objective and Advanced Options

Focus extraction on specific topics using search objectives, with control over excerpts and fetch policy:

Extract with Search Queries

Extract content relevant to specific search queries:

Content Length Control

Extract API Configuration

Extract Error Handling

The extract tool gracefully handles failed extractions:

Async Extract

Error Handling

Examples

See the examples/ and docs/ directories for complete working examples:
  • examples/chat_example.py - Chat model usage examples
  • docs/search_tool.ipynb - Search tool examples and tutorials
  • docs/extract_tool.ipynb - Extract tool examples and tutorials
Examples include:
  • Basic synchronous usage
  • Streaming responses
  • Async operations
  • Conversation management
  • Tool usage in agents