Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

langchain-parallel-web

LangChain tool and toolkit for Parallel Web search. It exposes a tool that performs web research and returns ranked, compressed excerpts from multiple sources, plus a toolkit to easily wire it into agents.

Installation

pip install -U langchain-parallel-web

Set your Parallel API key:

export PARALLEL_API_KEY="your-api-key"

You can also pass the key directly to the classes shown below.

Tool: Parallel Web Search

ParallelWebTool exposes the Parallel Web search as a LangChain tool.

from langchain_parallel_web.tools import ParallelWebTool

# Option 1: rely on PARALLEL_API_KEY in env
tool = ParallelWebTool()

# Option 2: pass the key explicitly
# tool = ParallelWebTool(parallel_api_key="your-api-key")

result_json = tool.invoke({
    "objective": "Find when the UN was founded; prefer official sources.",
    "search_queries": [
        "United Nations founding year",
        "When was the UN founded official site"
    ],
})
print(result_json)

Configuration

You can control search behavior via ParallelWebSearchConfig.

from langchain_parallel_web.parallel_web_wrapper import ParallelWebSearchConfig
from langchain_parallel_web.tools import ParallelWebTool

config = ParallelWebSearchConfig(
    max_results=10,          # up to 40
    processor="base",        # or "pro"
    max_chars_per_result=1500
)

tool = ParallelWebTool(config=config)

Toolkit: Agent Integration

ParallelWebToolkit returns a ready-to-use list of tools for agent setups.

from langchain_parallel_web.toolkits import ParallelWebToolkit

# Pass the key explicitly for the toolkit
toolkit = ParallelWebToolkit(parallel_api_key="your-api-key")

tools = toolkit.get_tools()

# Use `tools` with your LangChain agent or runnable graph

Direct API Wrapper

For lower-level control, call the wrapper directly.

from langchain_parallel_web.parallel_web_wrapper import (
    ParallelWebAPIWrapper,
    ParallelWebSearchInput,
)

wrapper = ParallelWebAPIWrapper()  # uses PARALLEL_API_KEY from env
# or: wrapper = ParallelWebAPIWrapper(parallel_api_key="your-api-key")

payload = ParallelWebSearchInput(
    objective="Summarize key announcements from OpenAI DevDay 2023.",
    search_queries=["OpenAI DevDay 2023 announcements", "OpenAI DevDay keynote summary"],
)

out = wrapper.search(payload)
print(out.model_dump())

Async usage is supported:

import asyncio
from langchain_parallel_web.parallel_web_wrapper import (
    ParallelWebAPIWrapper,
    ParallelWebSearchInput,
)

async def main():
    wrapper = ParallelWebAPIWrapper()
    out = await wrapper.asearch(
        ParallelWebSearchInput(
            objective="Latest SEC filing summary for NVDA.",
            search_queries=["NVIDIA latest 10-Q", "NVDA SEC filing"],
        )
    )
    print(out.model_dump())

asyncio.run(main())

Metadata

Release files for langchain-parallel-web 0.0.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-parallel-web 0.0.1a0
File Size Uploaded
langchain_parallel_web-0.0.1a0.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-parallel-web 0.0.1a0
File Interpreter ABI Platform
langchain_parallel_web-0.0.1a0-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / langchain_parallel_web-0.0.1a0.tar.gz

Download URL langchain_parallel_web-0.0.1a0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d47f856862877005fca7acf40041bd4b696ecd7c5535f5c276a10df2b61b0d5f
BLAKE2b-256 checksum
How to use checksums
9b32118883fbe8458516e5c5514c5033e07782f82d5f14c09b8d67d4e25cde9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.10.16 Darwin/24.5.0

Release files / langchain_parallel_web-0.0.1a0-py3-none-any.whl

Download URL langchain_parallel_web-0.0.1a0-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f813b535116d8b4517fc65ee9bba47121cd5a89a1658093f2278e768584df62
BLAKE2b-256 checksum
How to use checksums
539a8a53592602faf2c3f469f71250d28da2fa4095cc714ab27af926133dfa48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.10.16 Darwin/24.5.0

Release history Release notifications | RSS feed

This release

0.0.1a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page