Skip to main content

langchain-agentsearch

LangChain (Python) tools for AgentSearch: live web search for agents.

Tool Name Cost
AgentSearchTool agentsearch_search Free (25 searches/day per user, up to 5 results, no key). Paid & unlimited if a wallet is set.
AgentSearchExtractTool agentsearch_extract $0.005/call (USDC on Base via x402)
AgentSearchRenderTool agentsearch_render $0.005/call (headless browser for JS pages)

Install

pip install -U langchain-agentsearch          # free search
pip install -U "langchain-agentsearch[paid]"  # + x402 payments for extract/render

Quick start (free, no key)

from langchain_agentsearch import AgentSearchTool

search = AgentSearchTool()
print(search.invoke({"query": "latest LangChain release", "max_results": 3}))
# JSON string: {"query": ..., "results": [{"title", "url", "content"}, ...]}

With an agent:

from langgraph.prebuilt import create_react_agent
from langchain_agentsearch import AgentSearchTool, AgentSearchExtractTool, AgentSearchRenderTool

agent = create_react_agent(llm, [AgentSearchTool(), AgentSearchExtractTool(), AgentSearchRenderTool()])

Paid mode

Install the paid extra and set AGENTSEARCH_WALLET_PRIVATE_KEY to the private key of a new wallet made only for this, funded with a little USDC on Base (e.g. $1; no ETH needed). Each call is paid over x402 through the Pocket Network Agentic Portal using the official x402 Python SDK. With a key set, AgentSearchTool also goes paid; force free with AgentSearchTool(mode="free").

Env var Default
AGENTSEARCH_MAX_TOTAL_ATOMIC 1000000 ($1.00 per process)
AGENTSEARCH_MAX_PER_CALL_ATOMIC 5000 ($0.005; can only be lowered)
AGENTSEARCH_TIMEOUT_MS 30000

Limits are checked before anything is signed. The key is never logged or returned. Paid results include a payment object.

Errors

Tools return "Error: ..." strings rather than raising. A 429 from the free relay means the daily limit was hit; the message explains how to upgrade.

Development

pip install -e ".[test,paid]" && pytest            # unit tests (mocked)
AGENTSEARCH_LIVE=1 pytest -k live                    # one real free search

Docs: https://agentsearchhq.com/agents.md?utm_source=langchain-agentsearch&utm_medium=package

MIT

Metadata

Release files for langchain-agentsearch 0.1.0

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-agentsearch 0.1.0
File Size Uploaded
langchain_agentsearch-0.1.0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-agentsearch 0.1.0
File Interpreter ABI Platform
langchain_agentsearch-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / langchain_agentsearch-0.1.0.tar.gz

Download URL langchain_agentsearch-0.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3d40769aaf534bae407d0df4a8400ed30aa954658866d0cbb829794f9b6c15ee
BLAKE2b-256 checksum
How to use checksums
be2bfcfb86613aac15059d49a5dd3b18e61e6540c450ea1f35eeb5e5594b47aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / langchain_agentsearch-0.1.0-py3-none-any.whl

Download URL langchain_agentsearch-0.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ffa14197228191302233f058f9df08e8caa67a9846aa3436217ac2d63f7df0d
BLAKE2b-256 checksum
How to use checksums
e54f15073233ee042ea86d8b9a1a6acd247b24cb073b8c459f41ad67ccea31aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 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