Librarium -- Multi-Provider Deep Research
Run research queries across 10 search and deep-research APIs in parallel, collect results, deduplicate sources, and produce structured output.
Prerequisites
librarium CLI installed (npm install -g librarium)
- API keys configured (
librarium init --auto)
- Binary at:
librarium (or npx librarium)
7-Phase Research Workflow
Phase 1: Query Analysis
Analyze the user's research question. Determine:
- Is this a technical, business, or general knowledge query?
- Which provider group is best suited? (
quick for fast answers, deep for thorough research, comprehensive for important decisions, all for maximum grounded coverage, llm for an ungrounded baseline/contrast with no citations)
- What execution mode? (
sync for quick queries, mixed for deep research)
Phase 2: Provider Selection
Select providers based on query type:
- Technical queries: Use
comprehensive group (deep research + AI-grounded)
- Quick facts: Use
quick group (AI-grounded only, fast)
- Competitive research: Use
all group (maximum coverage)
- Specific provider: Use
--providers flag (accepts canonical IDs or display names, e.g. -p "Exa Search,brave-search")
- Competitive research: Use
all group (maximum grounded coverage)
- Ungrounded baseline / contrast: Use
llm group (Claude, OpenAI, Gemini, OpenRouter -- direct model answers, no citations)
- Specific provider: Use
--providers flag
Phase 3: Dispatch
Run the query:
librarium run "your query here" --group <group> [--mode mixed]
Phase 4: Monitor Async Tasks
If deep-research providers were used in async mode:
librarium status --wait
Phase 5: Retrieve Results
Once complete, async results can be retrieved:
librarium status --retrieve
Phase 6: Analyze Output
Read the output files:
summary.md -- Overall research summary with statistics
sources.json -- Deduplicated citations ranked by frequency
- Individual
{provider}.md files for detailed per-provider results
run.json -- Machine-readable manifest
Phase 7: Synthesize
Combine findings from multiple providers into a coherent answer. Cross-reference sources that appear across multiple providers (higher citation count = higher confidence).
Key Commands
| Command |
Purpose |
librarium run <query> |
Run research query |
librarium run <query> --group quick |
Fast AI-grounded search |
librarium run <query> --group deep |
Deep research (async) |
librarium run <query> --group all |
All providers |
librarium answer <query> |
Fan out (default quick) and synthesize one grounded, cited answer to answer.md |
librarium run <query> --max-cost 0.50 |
Stop launching providers once API-reported cost crosses the budget |
librarium run <query> --yes |
Skip the deep-research pre-flight confirm (3+ deep providers) |
librarium status |
Check async tasks |
librarium status --wait --retrieve |
Wait and fetch async results |
librarium usage [--days N] [--json] |
Aggregate API-reported cost and tokens across past runs |
librarium run <query> --html --open |
Run, then open an HTML report |
librarium run <query> --jsonl |
Run, then write machine-readable results.jsonl |
librarium browse |
Browse past runs interactively |
librarium html [run-dir] |
Generate report.html for a run |
librarium jsonl [run-dir] |
Generate results.jsonl for a run |
librarium refine <goal> |
Tier-tuned query variants, no dispatch |
librarium ls |
List providers and status |
librarium doctor |
Health check providers |
librarium config |
Show resolved config |
librarium cleanup [--days N] [--dry-run] |
Delete run dirs older than N days (default 30) |
librarium clear [--dry-run] [-i] [--yes] |
Delete all run dirs (alias for cleanup --all); -i to pick interactively |
MCP Server
Instead of shelling out to the CLI, agents can drive librarium over the Model Context Protocol with librarium mcp (stdio transport). Register it once with claude mcp add librarium -- librarium mcp, then call the tools: research, get_results, check_async, list_providers, list_groups. The research tool runs the same silent file-writing pipeline as librarium run and returns a compact structured result; fetch full provider markdown with get_results.
Provider Tiers
| Tier |
Providers |
Speed |
Depth |
| deep-research |
perplexity-sonar-deep, perplexity-deep-research, perplexity-advanced-deep, openai-deep, openai-deep-o3, gemini-deep |
Minutes |
Comprehensive |
| ai-grounded |
perplexity-sonar-pro, brave-answers, exa, you-research, kagi-fastgpt |
Seconds |
Good |
| raw-search |
perplexity-search, brave-search, jina-search, searchapi, serpapi, tavily |
Fast |
Links only |
| llm |
claude, openai-chat, gemini-chat, openrouter-chat |
Seconds |
Ungrounded (no citations) |
Output Structure
./agents/librarium/{timestamp}-{slug}/
prompt.md, run.json, summary.md, sources.json
{provider}.md, {provider}.meta.json
async-tasks.json (if applicable)
Source: jkudish/librarium — distributed by TomeVault.
1---2name: librarium3description: Run multi-provider deep research queries using the librarium CLI Use when this capability is needed.4---56# Librarium -- Multi-Provider Deep Research78Run research queries across 10 search and deep-research APIs in parallel, collect results, deduplicate sources, and produce structured output.910## Prerequisites1112- `librarium` CLI installed (`npm install -g librarium`)13- API keys configured (`librarium init --auto`)14- Binary at: `librarium` (or `npx librarium`)1516## 7-Phase Research Workflow1718### Phase 1: Query Analysis19Analyze the user's research question. Determine:20- Is this a technical, business, or general knowledge query?21- Which provider group is best suited? (`quick` for fast answers, `deep` for thorough research, `comprehensive` for important decisions, `all` for maximum grounded coverage, `llm` for an ungrounded baseline/contrast with no citations)22- What execution mode? (`sync` for quick queries, `mixed` for deep research)2324### Phase 2: Provider Selection25Select providers based on query type:26- **Technical queries**: Use `comprehensive` group (deep research + AI-grounded)27- **Quick facts**: Use `quick` group (AI-grounded only, fast)28- **Competitive research**: Use `all` group (maximum coverage)29- **Specific provider**: Use `--providers` flag (accepts canonical IDs or display names, e.g. `-p "Exa Search,brave-search"`)30- **Competitive research**: Use `all` group (maximum grounded coverage)31- **Ungrounded baseline / contrast**: Use `llm` group (Claude, OpenAI, Gemini, OpenRouter -- direct model answers, no citations)32- **Specific provider**: Use `--providers` flag3334### Phase 3: Dispatch35Run the query:36```bash37librarium run "your query here" --group <group> [--mode mixed]38```3940### Phase 4: Monitor Async Tasks41If deep-research providers were used in async mode:42```bash43librarium status --wait44```4546### Phase 5: Retrieve Results47Once complete, async results can be retrieved:48```bash49librarium status --retrieve50```5152### Phase 6: Analyze Output53Read the output files:541. `summary.md` -- Overall research summary with statistics552. `sources.json` -- Deduplicated citations ranked by frequency563. Individual `{provider}.md` files for detailed per-provider results574. `run.json` -- Machine-readable manifest5859### Phase 7: Synthesize60Combine findings from multiple providers into a coherent answer. Cross-reference sources that appear across multiple providers (higher citation count = higher confidence).6162## Key Commands6364| Command | Purpose |65|---------|---------|66| `librarium run <query>` | Run research query |67| `librarium run <query> --group quick` | Fast AI-grounded search |68| `librarium run <query> --group deep` | Deep research (async) |69| `librarium run <query> --group all` | All providers |70| `librarium answer <query>` | Fan out (default `quick`) and synthesize one grounded, cited answer to `answer.md` |71| `librarium run <query> --max-cost 0.50` | Stop launching providers once API-reported cost crosses the budget |72| `librarium run <query> --yes` | Skip the deep-research pre-flight confirm (3+ deep providers) |73| `librarium status` | Check async tasks |74| `librarium status --wait --retrieve` | Wait and fetch async results |75| `librarium usage [--days N] [--json]` | Aggregate API-reported cost and tokens across past runs |76| `librarium run <query> --html --open` | Run, then open an HTML report |77| `librarium run <query> --jsonl` | Run, then write machine-readable results.jsonl |78| `librarium browse` | Browse past runs interactively |79| `librarium html [run-dir]` | Generate report.html for a run |80| `librarium jsonl [run-dir]` | Generate results.jsonl for a run |81| `librarium refine <goal>` | Tier-tuned query variants, no dispatch |82| `librarium ls` | List providers and status |83| `librarium doctor` | Health check providers |84| `librarium config` | Show resolved config |85| `librarium cleanup [--days N] [--dry-run]` | Delete run dirs older than N days (default 30) |86| `librarium clear [--dry-run] [-i] [--yes]` | Delete all run dirs (alias for `cleanup --all`); `-i` to pick interactively |8788## MCP Server8990Instead of shelling out to the CLI, agents can drive librarium over the Model Context Protocol with `librarium mcp` (stdio transport). Register it once with `claude mcp add librarium -- librarium mcp`, then call the tools: `research`, `get_results`, `check_async`, `list_providers`, `list_groups`. The `research` tool runs the same silent file-writing pipeline as `librarium run` and returns a compact structured result; fetch full provider markdown with `get_results`.9192## Provider Tiers9394| Tier | Providers | Speed | Depth |95|------|-----------|-------|-------|96| deep-research | perplexity-sonar-deep, perplexity-deep-research, perplexity-advanced-deep, openai-deep, openai-deep-o3, gemini-deep | Minutes | Comprehensive |97| ai-grounded | perplexity-sonar-pro, brave-answers, exa, you-research, kagi-fastgpt | Seconds | Good |98| raw-search | perplexity-search, brave-search, jina-search, searchapi, serpapi, tavily | Fast | Links only |99| llm | claude, openai-chat, gemini-chat, openrouter-chat | Seconds | Ungrounded (no citations) |100101## Output Structure102103```104./agents/librarium/{timestamp}-{slug}/105 prompt.md, run.json, summary.md, sources.json106 {provider}.md, {provider}.meta.json107 async-tasks.json (if applicable)108```109110---111> Source: [jkudish/librarium](https://github.com/jkudish/librarium) — distributed by [TomeVault](https://tomevault.io).112<!-- tomevault:4.0:skill_md:2026-06-29 -->