Wrap TrendsAGI in typed LangChain tools built with tool() from @langchain/core. The planner gets strict zod input schemas, and every result is JSON-serializable so it can go straight back into the loop. This page lists the required credentials, setup example, mapped endpoints, and production notes.
Base URL
https://staging-api.trendsagi.com115
Routes
23
Guides
3
Languages
Typed tools for LangChain planners
Wrap TrendsAGI in typed LangChain tools built with tool() from @langchain/core. The planner gets strict zod input schemas, and every result is JSON-serializable so it can go straight back into the loop.
Install
npm install @trendsagi/langchain @trendsagi/core @langchain/openai zodRequired credentials
import { ChatOpenAI } from "@langchain/openai";
import { TrendsAGI } from "@trendsagi/core";
import { createTrendsAGITools } from "@trendsagi/langchain";
const trendsagi = new TrendsAGI();
const model = new ChatOpenAI({ model: "gpt-4o-mini" }).bindTools(
createTrendsAGITools(trendsagi),
);
const result = await model.invoke("Find a rising skincare trend.");
console.log(result.content);# Save as quickstart.mjs
node quickstart.mjs1. Install
Add SDK/dependency for this integration path.
2. Authenticate
Set API key and any provider-specific credentials.
3. Map endpoints
Use mapped endpoints below to build deterministic flow.
4. Harden
Add rate-limit backoff, idempotency, and safety gates.
Endpoint Mapping
Each integration is mapped to specific API endpoints so teams can compose deterministic workflows.
Production notes