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.
  • Conversational. ismith chat keeps the profile, the card and the frame in memory, so a follow-up refers to the turn before 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 eight dependencies: polars, typer, rich, charset-normalizer, psutil, httpx, jinja2 and prompt_toolkit. 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 chat Ask many, in a conversation that remembers.
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.

Hold a conversation

ismith chat data/sales.csv
ismith chat data/sales.csv --engine pandas

ask pays for sniffing, loading and profiling on every question and forgets the answer. chat keeps all three, so a follow-up can refer to what came before.

> what is the total revenue by region?
> now show only the top 2 of those        <- it remembers what "those" were
The insightsmith REPL, showing the banner and the command list

Tab completes on your file's own column names, which is where a question most often goes wrong. History persists between sessions.

Command
/columns /card /ideas what is in the file, and what is worth asking
/code /chart /critique toggle what each answer shows
/engine pandas switch the API the generated code targets
/save out/ forge the conversation into a report and a notebook
/undo /clear forget the last turn, or all of them

What a later turn is shown is the question, the code and the shape of each earlier result: column names and a row count, never the rows themselves. The rule that keeps raw records off the wire matters more here than anywhere, since a transcript is resent on every turn.

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.9.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 insightsmith 0.9.0
File Size Uploaded Provenance Actions
insightsmith-0.9.0.tar.gz 254.9 kB With provenance Details for insightsmith-0.9.0.tar.gz

Built distribution (wheel)

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

Total release size: 453.7 kB

Release files / insightsmith-0.9.0.tar.gz

Download URL insightsmith-0.9.0.tar.gz
Size 254.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e5cc785e325323d591ca341832318ed1c13c60effdcad8bfe3094d3f611cf110
BLAKE2b-256 checksum
How to use checksums
b48344e10a8d5a1200c43a03a00bb1897d6da29e59a34a5f3ec47867ea013c82
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 Oct 4, 2026.

Transparency log

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

Download URL insightsmith-0.9.0-py3-none-any.whl
Size 198.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
396d2f8463f62f8808f6445f1166d5263499ab966e898bc849bb689aa74a6f8f
BLAKE2b-256 checksum
How to use checksums
3722c43d97b6b2c45315c8c556bd90b0882cf4afc622668d7596db9daeae757a
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 Oct 4, 2026.

Transparency log

Security for insightsmith 0.9.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.

Full provenance

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

Select from 2 files

Attestation for insightsmith-0.9.0.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 Oct 4, 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