CLI: check and preview
Follow installation. Keep credentials out of chat and source control:
npm install -g librarium
librarium --version
librarium research --help
librarium setup
librarium setup --check --json
librarium research "What HTTP caching rules should a JSON API apply?" \
--only exa,kagi --max-cost 0.25 --dry-run --json
Check the preview’s selection, estimates, skips, and notices; credential presence is not authentication. If everything is skipped, choose priced sources and preview again—keep the cap (budget rules).
Research and read the results
librarium research "What HTTP caching rules should a JSON API apply?" \
--only exa,kagi --max-cost 0.25 --json
librarium show <run-id> --source exa --json
librarium browse
Keep the Run ID and read each source’s answer and citations. For deep work, use --deep --no-wait and recover with show <run-id> --wait (stored files, evidence checks).
JavaScript: preview and read a Run
The Node client uses your configured sources. Dry-run stores nothing and calls no providers.
import { createLibrarium } from 'librarium';
const client = createLibrarium();
const question = 'Compare HTTP caching rules';
const selection = { only: ['exa'], maxCost: '0.25' };
const plan = await client.research(question, {
...selection, dryRun: true,
});
const run = await client.research(question, selection);
Coding agent: the same workflow over MCP
Connect your agent, then ask it to preview before spending and inspect cited passages. Repeated URLs and shared retrieval services are not independent confirmation.
| Step | Tool |
|---|---|
| Discover configured sources | list_sources |
| Preview offline | research with dry_run: true |
| Research after spending approval | research |
| Resume and read complete source evidence | get_run with the Run ID |
Laravel: the same question and Run contract
Follow PHP installation and configure Exa through Laravel config. This is native PHP, not a Node wrapper.
composer require jkudish/laravel-ai-librarium
php artisan vendor:publish --tag=librarium-config
use Jkudish\LaravelAiLibrarium\Facades\Librarium;
$question = 'Compare HTTP caching rules';
$plan = Librarium::research($question)
->only(['exa'])->maxCost('0.25')
->dryRun();
$run = Librarium::research($question)
->only(['exa'])->maxCost('0.25')
->run();
$payload = $run->toArray();
Keep failures and skips visible when reading Run status and evidence. Before background work, choose a supported store and read queues and recovery; your application owns authorization, retention, and domain records.