A meta harness for research queries
Research inside your JavaScript app.
Collect research from multiple sources with one typed client.
Node.js 22.12+ for the Node client
Install
npm install librariumConfigure sources
librarium setupPreview offline
await librarium.research( 'Lisbon or Porto without a car?',{ only: ['exa'], dryRun: true }, ); 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.
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.
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.
import {
createLibrarium,
} from 'librarium/core';