Skip to main content

Indagar

Deep research from the command line.

Indagar asks a question, plans sub-questions, searches multiple sources, reads what it finds, and produces a cited research report or a source dossier. The name is Spanish for to investigate, inquire, or probe.

Phase 1 core loop is implemented. research is retrieval-only by default; adding --llm turns on LLM planning, source reading, grounded quote extraction, a bounded gap check, and citation-checked synthesis.

Quick start

git clone https://github.com/michael-borck/indagar.git
cd indagar
uv venv
source .venv/bin/activate
uv pip install -e '.[dev]'

indagar doctor
indagar search "retrieval augmented generation" --limit 5
indagar research "Does retrieval augmented generation reduce hallucination?" \
  --max-sources 10

# Full Phase 1 loop; requires an LLM provider and model.
indagar research "Does retrieval augmented generation reduce hallucination?" \
  --llm --max-sources 10 --depth 1

If the checkout is on an exFAT drive, create the virtual environment on a local disk instead: uv venv ~/.venvs/indagar.

The research command writes a Markdown report and a JSON run record under runs/. Every source keeps its URL, provider, and sub-question. With --llm, quotes are checked against the source text, citations are validated before the report is accepted, and per-model token usage is recorded. --depth 0 disables follow-up rounds; the default is one.

LLM smoke test

Anthropic:

export ANTHROPIC_API_KEY="..."
export INDAGAR_LLM_PROVIDER=anthropic
export INDAGAR_LLM_MODEL=claude-sonnet-4-5

indagar llm "In one sentence, what makes a source trustworthy?"

A local OpenAI-compatible server such as Ollama or LM Studio:

export OPENAI_BASE_URL=http://localhost:11434/v1
export INDAGAR_LLM_PROVIDER=openai-compatible
export INDAGAR_LLM_MODEL=llama3.1

indagar llm "In one sentence, what makes a source trustworthy?"

Use --role planner|reader|writer to exercise a role-specific model, and --json to request JSON output.

The same provider powers the full research loop:

indagar research "What limits photosynthesis in C4 plants?" --llm --depth 1

Planning, extraction, gap checks, and synthesis use the planner, reader, and writer roles. If synthesis uses an unknown citation ID, Indagar rejects it and falls back to the grounded evidence table rather than keeping an unverifiable claim.

Configuration

Copy .env.example to .env and set the providers you have.

Variable Purpose
FIRECRAWL_URL Self-hosted or cloud Firecrawl base URL, e.g. http://localhost:3002
FIRECRAWL_API_KEY Optional key when Firecrawl is behind an auth gate
BRAVE_API_KEY Brave Search API key
SERPER_API_KEY Serper API key
SEARXNG_URL Self-hosted SearXNG base URL
INDAGAR_SEARCH_ORDER Provider order. Default firecrawl,brave,serper,searxng
ANTHROPIC_API_KEY Anthropic key
ANTHROPIC_BASE_URL Anthropic API base. Default https://api.anthropic.com
OPENAI_API_KEY OpenAI-compatible key
OPENAI_BASE_URL OpenAI-compatible base URL, including Ollama/LM Studio
INDAGAR_LLM_PROVIDER anthropic or openai-compatible. Defaults to the first configured
INDAGAR_LLM_MODEL Global model ID for every role
INDAGAR_PLANNER_MODEL Model for sub-question planning and gap checks
INDAGAR_READER_MODEL Model for source extraction
INDAGAR_WRITER_MODEL Model for the final synthesis
INDAGAR_LLM_MAX_TOKENS Tokens per call. Default 1024
INDAGAR_LLM_TEMPERATURE Sampling temperature. Default 0.2
INDAGAR_LLM_TIMEOUT LLM request timeout in seconds. Default 60
INDAGAR_MAX_SOURCES Sources per run. Default 12
INDAGAR_MAX_SECONDS Wall-clock budget. Default 300
INDAGAR_SEARCH_LIMIT Results requested per sub-question. Default 8
INDAGAR_MAX_DEPTH Follow-up rounds for --llm. Default 1, max 2
INDAGAR_MAX_FOLLOW_UPS Follow-up questions per gap check. Default 3
INDAGAR_MAX_CONTENT_CHARS Source text sent to the reader model. Default 12000
INDAGAR_MAX_CLAIMS Claims extracted per source. Default 5
INDAGAR_SYNTHESIS_MAX_TOKENS Synthesis output cap. Default 2048
INDAGAR_READER_TIMEOUT Page read timeout in seconds. Default 45

indagar doctor shows what is configured.

Status

  • CLI with doctor, llm, search, and research
  • Firecrawl, Brave, Serper, and SearXNG adapters
  • Ordered fallback, over-fetch, URL dedupe, and a 10-minute cache
  • Deterministic research plan and cited source dossier
  • Anthropic and OpenAI-compatible LLM adapters with role-based models
  • LLM planner, source reader, verbatim quote extraction, gap loop, and synthesis
  • Citation ledger with dedupe, source grouping, and Markdown rendering
  • Per-run source-read and model-usage tables
  • Cost estimate before a run and provider rate limiting
  • Web UI and desktop shell
  • Academic, podcast, and video sources

PyPI has 0.1.0. The Phase 1 work on main is version 0.2.0 and is not published yet.

See SPEC.md for the design and roadmap.

Development

uv pip install -e '.[dev]'
ruff check .
ruff format --check .
pytest -q

Licence

MIT. See LICENSE.

Metadata

Release files for indagar 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for indagar 0.2.0
File Size Uploaded Provenance Actions
indagar-0.2.0.tar.gz 36.9 kB Without provenance Details for indagar-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for indagar 0.2.0
File Interpreter ABI Platform Actions
indagar-0.2.0-py3-none-any.whl Python 3 none any Details for indagar-0.2.0-py3-none-any.whl

Total release size: 73.6 kB

Release files / indagar-0.2.0.tar.gz

Download URL indagar-0.2.0.tar.gz
Size 36.9 kB
Tags Source
SHA-256 checksum
How to use checksums
56dcc28145c268fcd8557b913966e05a3e1f4e709dff27596310907d7d9cb0ff
BLAKE2b-256 checksum
How to use checksums
f6df1ec28f80f75c40c03416c1368b6ca3a9739ce842d9ebd4ce8453d8602211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Release files / indagar-0.2.0-py3-none-any.whl

Download URL indagar-0.2.0-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4afb2f96158325c57f467740e4e73cf6fa9578e720bac25d275dacfc55c79938
BLAKE2b-256 checksum
How to use checksums
0d8d4c0b07135c2327db33800d1ad372537acefe292ab6471e1ea435e007d1da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.0

Security for indagar 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page