npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@future-agi/sdk

v0.1.1

Published

We help GenAI teams maintain high-accuracy for their Models in production.

Readme

Future AGI TypeScript SDK

The official TypeScript / Node.js client for the Future AGI platform.
Use it to create and manage evaluation datasets, run prompt–template experiments, build knowledge-bases, and monitor the quality of your generative-AI models – all from code.



Features

• 📊 Datasets – create, mutate, download & evaluate tabular datasets.
• 📜 Prompt templates – full CRUD, versioning and execution of templates (including OpenAI-style chat messages & variables).
• 📚 Knowledge-bases – upload files, list and delete KB assets.
• ⚙️ Utilities – bounded executors, helper constants and strong TypeScript types for all request / response payloads.
• 🤝 Modern build – ships both ESM (ES2020) and CommonJS (ES2016) bundles; works in Node 18+ and all modern bundlers.

Requirements

  • Node.js 18 or later (the SDK targets ES2020 for ESM builds).
  • An API key and Secret key obtained from your Future AGI account.

Installation

# npm
npm install @future-agi/sdk

# pnpm
pnpm add @future-agi/sdk

# yarn
yarn add @future-agi/sdk

The package automatically selects the build that matches your environment:

| Import style | Runtime requirement | File served | | ------------------ | ------------------- | -------------------------- | | import … from | ES modules (Node 14+, browsers) | dist/esm/** (ES2020) | | require('…') | CommonJS (all Node versions) | dist/src/** (ES2016) |

Authentication

Set your credentials as environment variables once:

export FI_API_KEY="YOUR_API_KEY"
export FI_SECRET_KEY="YOUR_SECRET_KEY"

…or pass them explicitly when creating a client:

import { Dataset } from '@future-agi/sdk';

const ds = await Dataset.open('my-dataset', {
  fiApiKey: 'YOUR_API_KEY',
  fiSecretKey: 'YOUR_SECRET_KEY',
  createIfMissing: true
});

Quick-start

1. Create a dataset & add rows

import { Dataset, DataTypeChoices } from '@future-agi/sdk';

async function main() {
  // Open (or create) a dataset
  const ds = await Dataset.open('translations', { createIfMissing: true });

  // Add two columns
  await ds.addColumns([
    { name: 'prompt',  dataType: DataTypeChoices.TEXT },
    { name: 'answer',  dataType: DataTypeChoices.TEXT }
  ]);

  // Add a couple of rows
  await ds.addRows([
    { prompt: 'Translate “Hello World” to French', answer: 'Bonjour le monde' },
    { prompt: 'Translate “Good night”  to German', answer: 'Gute Nacht'      }
  ]);

  console.log('Dataset ready:', ds.getConfig());
}

2. Create & execute a prompt template

import { Prompt, MessageBase, ModelConfig } from '@future-agi/sdk';

const prompt = new Prompt();

await prompt.createNewVersion({
  template: {
    name: 'translator',
    messages: [
      { role: 'system', content: 'You are a translator.' } as MessageBase,
      { role: 'user',   content: 'Translate {{text}} to French.' } as MessageBase
    ],
    variable_names: { text: 'string' },
    model_configuration: new ModelConfig({ model_name: 'gpt-3.5-turbo' })
  }
});

// Run the template with variables
const result = await prompt.template?.run({ text: 'Good morning' });
console.log(result);

3. Build a knowledge base

import { KnowledgeBase } from '@future-agi/sdk';

const kb = new KnowledgeBase();
await kb.createKb('docs', ['./README.md', './whitepaper.pdf']);

const list = await kb.listKbs();
console.log(`You now have ${list.length} knowledge-bases!`);

API overview

import {
  Dataset,          // datasets / evaluations
  KnowledgeBase,    // RAG knowledge-bases
  Prompt,           // prompt templates
  constants,        // misc constants
  errors            // rich error classes
} from '@future-agi/sdk';

See the full TypeDoc API reference at
https://futureagi.com/docs/sdk/typescript.

Error handling

All SDK-specific failures extend SDKException.

import { SDKException } from '@future-agi/sdk/dist/src/utils/errors';

try {
  await Dataset.open('missing-dataset');
} catch (err) {
  if (err instanceof SDKException) {
    console.error(err.getErrorCode(), err.getMessage());
  } else {
    console.error('Unexpected error', err);
  }
}

Common subclasses include:

  • InvalidAuthError – wrong or missing credentials.
  • DatasetNotFoundError – dataset name not found.
  • RateLimitError – API quota exceeded.

Contributing

  1. Fork the repo and create your branch from main.
  2. Run pnpm i && pnpm test to ensure the test-suite is green.
  3. Submit a pull-request – please include unit tests for new behaviour.

See CONTRIBUTING.md at the project root for more details.

License

This project is distributed under a BSD-style license – see LICENSE.md for the full text.