A meta harness for research queries

Research inside your JavaScript app.

Collect research from multiple sources with one typed client.

Explore the JavaScript API

Node.js 22.12+ for the Node client

  1. Install

    npm install librarium
  2. Configure sources

    librarium setup
  3. Preview offline

    await librarium.research( 'Lisbon or Porto without a car?', { only: ['exa'], dryRun: true }, );
  4. Research when ready

    await librarium.research( 'Lisbon or Porto without a car?', { only: ['exa'] }, );

Previewing makes no provider calls, so it costs nothing. Research calls your providers and bills to your API keys. See costs and limits.

Create your client

The Node client loads configuration and saves Runs locally. Install the CLI for librarium setup, then configure your sources.

Create your client
import {
  createLibrarium,
} from 'librarium';

const librarium = createLibrarium();

Keep answers with their citations

Each Run keeps the results from every source. Read the Run contract for validation, costs, and failures.

Keep answers with their citations
const run = await librarium.research(
  'Lisbon or Porto without a car?',
  { only: ['exa', 'kagi'] },
);

for (const result of run.results) {
  console.log(
    result.answer, result.citations,
  );
}

Choose your runtime

Use librarium/core in Workers with explicit configuration, credentials, and a persistent store. Custom sources and stores covers the setup.

Choose your runtime
import {
  createLibrarium,
} from 'librarium/core';