@pipeworx/sdk
v0.1.0
Published
Pipeworx SDK — live data for AI agents. 261 data sources, 961 tools, one import.
Maintainers
Readme
@pipeworx/sdk
Live data for AI agents. One import gives your agent access to 261 data sources and 961 tools — SEC filings, FDA adverse events, trade flows, mortgage rates, clinical trials, government contracts, and more.
Install
npm install @pipeworx/sdkQuick start
import { Pipeworx } from '@pipeworx/sdk';
const px = new Pipeworx();
// Ask anything — Pipeworx picks the right tool
const trade = await px.ask("What is the US trade deficit with China?");
console.log(trade.data); // { trade_balance_usd: -1811043217557, ... }
console.log(trade.toolSelected); // "census_trade_balance"
// Call a specific tool
const weather = await px.call("get_weather", { latitude: 37.77, longitude: -122.42 });
console.log(weather.data); // { temperature_f: 62, conditions: "Partly cloudy", ... }Features
Ask anything
const result = await px.ask("What are the side effects of ozempic?");
// → Picks fda_drug_events, returns 54,647 adverse event reports
const filing = await px.ask("Get Apple's latest 10-K filing");
// → Picks edgar_company_filings, returns SEC data
const rate = await px.ask("Current 30-year mortgage rate?");
// → Picks fred_get_series(MORTGAGE30US), returns live FRED dataDiscover tools
const tools = await px.discover("housing market data");
tools.tools.forEach(t => console.log(t.name, t.description));
// housing_market_snapshot, attom_avm, fred_get_series, ...Scope to a domain
const housing = new Pipeworx({ task: "housing market" });
const tools = await housing.listTools();
// Only ~20 housing-relevant tools instead of 961Agent memory
await px.remember("target_company", "AAPL");
const target = await px.recall("target_company"); // "AAPL"
const keys = await px.recall(); // ["target_company"]
await px.forget("target_company");Response metadata
Every response includes cost, cache status, and suggestions:
const result = await px.call("get_weather", { latitude: 37.77, longitude: -122.42 });
console.log(result.meta.cost); // { total: 1, components: [{ name: "base", credits: 1 }] }
console.log(result.meta.cache); // { hit: true, age_seconds: 45, fresh_until: "..." }
console.log(result.meta.suggestions); // [{ tool: "get_forecast", reason: "..." }]Authentication
// Anonymous (50 calls/day)
const px = new Pipeworx();
// BYO API key (500 calls/day)
const px = new Pipeworx({ apiKey: "your-key" });
// OAuth/paid (2,000+ calls/day)
const px = new Pipeworx({ token: "bearer-token" });