Skip to main content
insightsmith

insightsmith

An agentic data consultant that runs on your own machine.

CI PyPI Python License

Point it at a data file. It detects the real format, profiles the data, proposes analyses, writes and sandbox-executes the code, critiques the statistics, and forges a report.

An insightsmith report: 14 findings from a 510-row loan file

Features

  • Local-first. A local model on your hardware is the default, not a degraded fallback. Set local_only = true and a remote model becomes a hard error.
  • Your rows never reach the model. Every agent sees a dataset card: a 2 to 5 KB JSON summary with PII masked. Token cost is flat whether the file is 600 KB or 40 GB.
  • A statistical critic. Every answer is checked against a fixed list of computable problems (tiny groups, skewed means, silent nulls, outlier-driven correlations) and carries the caveats that fired.
  • Auditable by construction. Every result ships with the code that produced it, the hash of the card the model saw, and a notebook that re-runs it.
  • Hardware-aware. ismith doctor reads your GPU and RAM and tells you which models actually fit, with the KV-cache maths done properly.
  • Format sniffing that works on messy files. Semicolon CSVs, decimal commas, cp1252, ambiguous dates. It says what it assumed and how sure it is.

Install

pip install insightsmith              # csv, tsv, parquet, arrow, json, jsonl
pip install insightsmith[excel]       # + xlsx / xls
pip install insightsmith[viz]         # + charts (matplotlib, plotly)
pip install insightsmith[pandas]      # + a .to_pandas() escape hatch
pip install insightsmith[stats]       # + scipy / statsmodels / scikit-learn
pip install insightsmith[fireducks]   # + the pandas-compatible engine
pip install insightsmith[pdf]         # + printing a report to PDF

Base install is seven dependencies: polars, typer, rich, charset-normalizer, psutil, httpx and jinja2. No torch, no pandas, no agent framework.

You also need Ollama with a model pulled, for everything except ismith look.

ismith init      # writes the config, checks Ollama, offers to pull a model that fits

Usage

Command What it does
ismith look Detect the format, profile the data. No LLM.
ismith ask Answer one question by writing and running code.
ismith forge Full autonomous pass, written up as a report.
ismith doctor Probe the machine, recommend models that fit.
ismith models Show which model each role resolves to.
ismith init Set up config and a local model.

Profile a file

ismith look data/sales.csv
ismith look data/sales.csv --json     # machine-readable
ismith look data/sales.csv --card     # exactly what a model would be shown

Prints the detected format with a confidence score and what was assumed, then a column table (dtype, semantic type, nulls, cardinality, distribution) and any quality notes. Works with no model installed.

Ask a question

ismith ask data/sales.csv "which region grew fastest last quarter?"
ismith ask data/sales.csv "correlation between discount and churn" --chart
ismith ask data/sales.csv "average order value by segment" --engine pandas

The code is generated, checked by an AST gate, run in a sandboxed subprocess, and printed alongside the answer. If it crashes, the traceback is fed back and it tries again, up to three times.

A bar chart produced by ismith ask --chart

Useful flags: --approve (see the code before it runs), --no-code, --critique/--no-critique, --engine polars|pandas|fireducks, --chart, --dark, --json.

See what is worth analysing

ismith look data/sales.csv --ideas
Eight ranked analysis ideas, each naming the columns it needs

Ideas come back ranked, each naming the columns it needs. Any idea referencing a column the card does not contain is discarded before you see it, which removes most hallucination for the price of a set-membership test.

Forge a report

ismith forge data/sales.csv -o out/                        # propose analyses, answer them, write it up
ismith forge data/sales.csv "which region grew?" -o out/   # or ask your own
ismith forge data/sales.csv -o out/ -n 15 --pdf

Four files land in the output directory:

File What it is
report.html The report, with figures inline, a contents rail, light and dark
report.md The same content as Markdown, for a repo or a wiki
report.ipynb The run rebuilt as a notebook that executes
report.pdf With --pdf, and the pdf extra installed

Every finding carries the code that produced it, the caveats the critic raised, a confidence index and how many attempts it took. A question that fails is listed under "Not answered" rather than dropped.

One finding: the narrative, the result table and the chart behind it

The notebook is not a transcript. Its first cell rebuilds the dataframe from the original file so every later cell runs, and it says so when the run was on a sample and re-running will not reproduce the numbers.

Pick a model for your machine

ismith doctor        # GPU, RAM, and the models that fit
ismith models        # which model answers as coder, critic, narrator

Configuration

~/.insightsmith/config.toml, written on first run and commented.

local_only = true          # a remote model becomes a hard error
engine = "polars"          # polars | pandas | fireducks

[roles]
ideation = "ollama/qwen3:8b"
coder    = "ollama/qwen3:8b"
critic   = "ollama/qwen3:8b"
narrator = "ollama/qwen3:8b"

As a library

from insightsmith import sniff, load, profile

spec = sniff("data/sales.csv")
print(spec.format, spec.encoding, spec.confidence, spec.warnings)

frame = load(spec)  # a Polars LazyFrame; nothing read yet
result = profile(spec)
print(result.summary())

How it works

sniff -> load -> profile -> card -+- ideation -> ranked ideas
                                  |
                                  +- question -> coder -> sandbox -> critic
                                                   ^        |
                                                   +- retry -+   (max 3, traceback fed back)
                                                            |
                                                            +-> viz -> narrator -> report

Polars LazyFrame is the internal representation, so Parquet, Arrow, NDJSON and UTF-8 CSV are scanned rather than loaded. --engine picks the API the generated snippet is written against; Parquet is the handover, so a result is a Polars frame whichever engine ran.

The coder is given worked examples from a bundled recipe book matched to the shape of your question. Measured on qwen3:8b across 15 questions, that took answered-on-first-attempt from 13/15 to 15/15 and halved the median time.

Formats loadable today: csv, tsv, xlsx/xlsm ([excel]), xls, parquet, feather/arrow, json, jsonl/ndjson. Formats that are detected but not yet loadable say so rather than failing obscurely.

Limits

Worth stating plainly, in advance.

  • LLMs write wrong code confidently. ismith ask prints the code for exactly that reason. The retry loop fixes code that crashes; it cannot tell that a snippet ran cleanly and answered the wrong question.
  • The critic reduces statistical nonsense; it does not remove it. It checks a fixed list of computable things, so it cannot catch a confounder, survivorship bias, or a question that was the wrong question. A clean verdict means nothing on the list fired, not that the analysis is sound. Confidence is an index computed from the caveats, not a probability that the answer is right.
  • The sandbox is defence in depth, not a security boundary. See SECURITY.md. Resource limits are POSIX-only; on Windows the AST gate and the timeout are all there is.
  • Large files are profiled on a sample. Above a size threshold every affected statistic is marked estimated. Row counts stay exact, distributions are approximate, and an answer computed on such a file carries a caveat.
  • PII masking is best-effort. It catches values that look like contact details or identifiers. It cannot recognise a name in free text or an identifier in a format it has not seen. If data must not leave the machine, set local_only.
  • --chart often has nothing to draw. Roughly two answers in five are a single number, and the chart is skipped with the reason given rather than a meaningless figure produced.
  • Dates are inferred, and 04/01/10 is genuinely ambiguous. Where day-first and month-first both fit, the chosen format is reported as a quality note rather than picked silently.
  • Throughput figures are estimates, not benchmarks. ismith doctor derives tok/s from published peak memory bandwidth, which no real decode loop reaches. Devices missing from that table report unknown.
  • FireDucks does not run everywhere. Linux x86_64 and macOS arm64 only, which is why Polars is the default.

Contributing

uv sync --all-extras
uv run pytest
uv run ruff check --fix && uv run ruff format
uv run mypy src

Conventional Commits. One feature, one branch, one squashed PR.

License

Apache-2.0. See LICENSE.

Metadata

Release files for insightsmith 0.8.5

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

Source distribution (sdist)

Source distribution for insightsmith 0.8.5
File Size Uploaded Provenance Actions
insightsmith-0.8.5.tar.gz 245.0 kB With provenance Details for insightsmith-0.8.5.tar.gz

Built distribution (wheel)

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

Total release size: 435.1 kB

Release files / insightsmith-0.8.5.tar.gz

Download URL insightsmith-0.8.5.tar.gz
Size 245.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a62ce92bdd845d071b5b2008efaffe5bd73446c5985962b8c1272b79679418cc
BLAKE2b-256 checksum
How to use checksums
7a05499911cfb01b18d825fa9f0bc1dc5f45f2c4dbce737c2779c9323693cb7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Release files / insightsmith-0.8.5-py3-none-any.whl

Download URL insightsmith-0.8.5-py3-none-any.whl
Size 190.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9399c78eb9a1efeab99072b24f13243b157d21f847bbc86ed84bb129715768fc
BLAKE2b-256 checksum
How to use checksums
5e3604e45b79228e2d72abd45a5db7e35a97e2d1f9bfc4ddff72e47094e32b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

Security for insightsmith 0.8.5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for insightsmith-0.8.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 20, 2026.

Transparency log

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