Skip to content

Decodo/decodo-langchain-ts

Repository files navigation

Decodo LangChain Tools

A Node.js LangChain plugin that enables developers to use Decodo's Scraper API alongside their LangChain applications.

Features

  • Web Scraping: Scrape any URL and retrieve Markdown content
  • Google Search: Search Google and retrieve structured results
  • Amazon Search: Search Amazon and retrieve structured product data
  • Reddit Scraping: Scrape Reddit posts and subreddits
  • Full TypeScript Support: Complete type definitions for all parameters
  • LangChain Integration: Seamless integration with LangChain's Tool system

Installation

npm install @decodo/langchain-ts

Quick Start

Prerequisites:

  • Node.js >= v20
  • Decodo Web Advanced subscription

To use the tools in this project, you will need a Decodo Advanced Web Scraping API subscription. Free trials are available on the dashboard.

Once you have a plan activated, take a note of your generated username and password:

Decodo dashboard

  1. Clone this repo and install dependencies:
git clone git@github.com:Decodo/decodo-langchain-ts.git
cd decodo-langchain-ts
npm i
  1. Run any of the sample agents:
npm run example:agent-universal
npm run example:agent-google
npm run example:agent-amazon

Available Tools

See the tools/ directory for a list of available tools.

Examples

See the examples/ directory to see tools in action.

Configuration

All tools accept a DecodoConfig object:

type DecodoConfig = {
  username: string; // Your Web Advanced product username
  password: string; // Your Web Advanced product password
};

API Parameters

See the Scraper API documentation for a list of available parameters.

License

MIT

Support

For support, please visit Decodo's documentation or open an issue on GitHub.