Skip to content

Add LangChain Search and Extract tools - #52

Open
georgeatparallel wants to merge 6 commits into
parallel-web:mainfrom
georgeatparallel:georgeatparallel/langchain-tools
Open

Add LangChain Search and Extract tools#52
georgeatparallel wants to merge 6 commits into
parallel-web:mainfrom
georgeatparallel:georgeatparallel/langchain-tools

Conversation

@georgeatparallel

@georgeatparallel georgeatparallel commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This adds @parallel-web/langchain so you can give a LangChain agent Parallel Search and Extract without writing the wrappers yourself. createSearchTool() and createExtractTool() go straight into your agent's tools array.

Your app chooses the API key and request settings. The agent gets text with source URLs, capped at 20,000 characters by default, and your app can keep the full API response in the tool artifact. The tools handle input checks and cancellation, and make sure extraction failures still show up when the text gets cut short.

There's a runnable research example too. It shows how to search for sources, read pages, and ask for an answer with citations.

The package isn't on npm yet. Adding it here doesn't publish it; the first release needs the owner setup in PUBLISHING.md.

Testing note: Ran the example against a real model and the live Parallel APIs, both from the repo and from a clean project with the packed package installed. The final run took 8.4 seconds: the agent searched, read the relevant page, and returned an answer citing the sources it actually retrieved. The raw tool artifacts matched the API responses.

Also tried one valid URL and one 404 with the output capped at 1,024 characters. The successful result came through and the text still said Extraction failed for 1 of 2 URLs. All 192 tests and seven CI checks pass, including ESM, CommonJS, and TypeScript compatibility checks.

@georgeatparallel
georgeatparallel marked this pull request as ready for review September 4, 2026 01:08
@georgeatparallel
georgeatparallel requested a review from a team September 4, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant