Python CLI that researches any question on the live web and writes a detailed cited markdown brief.
Flow: detect entity/intent → plan queries → search/rank/filter → fetch → grounded evidence → detailed synthesis.
cd ~/research-cli
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
cp .env.example .env # optionalDefaults: Ollama at http://127.0.0.1:11434/v1, model llama3.2.
source .venv/bin/activate
research-cli "What is RAG and when should I use it?"
research-cli what is youtube --depth deep
research-cli # interactiveInteractive: type a question, or help / history / clear / exit.
| Flag | Default | Meaning |
|---|---|---|
--depth |
normal |
fast (quick) / normal / deep (more sources) |
--max-sources |
depth default | Cap pages to read |
--out-dir |
briefs |
Where markdown briefs are saved |
- Detect — intent + domain persona (e.g. CS → senior SWE at Meta; ML → senior ML engineer)
- Plan — LLM proposes 2–4 entity-locked search queries
- Search — DuckDuckGo; dedupe, rank, drop junk hosts
- Fetch — extract main text from top pages
- Evidence — extract claim-checked
[n] factlines - Synthesize — detailed brief in the domain persona’s voice; falls back to a deterministic draft if citations break
Domains: computer_science, machine_learning, biology, finance, physics, product, general.
Progressive PE harness lives in scripts/pe_cycle.py (stages S0→S5) with verify in scripts/pe_verify.py.
python scripts/pe_cycle.py # full progressive cycle
python scripts/pe_verify.py # score current S5 promptsLatest verify (eval_out/pe-verify-20260809-000427): 100% pass, mean quality 110 on DuckDuckGo + RAG + hash map.
Hardening with winning prompts: domain personas in {persona} slots, acronym expansion, entity aliases (hash map ↔ hash table), nested-query parsing, single-sentence evidence, stricter citation validation.
| Variable | Default |
|---|---|
OPENAI_BASE_URL |
http://127.0.0.1:11434/v1 |
OPENAI_API_KEY |
ollama |
RESEARCH_MODEL |
llama3.2 |