lacon
Token-lean data interface

Query data files. Don't read them.

Agents query CSV, Parquet, and JSON through curated DuckDB primitives and get back only the answer — shaped, capped, and token-costed. No file dumping.

01

Why lacon

Built for AI agents that need to understand data without spending tokens reading raw files.

Primitives

Curated, not raw SQL

describe / sample / profile / aggregate / filter — operations an agent can't get syntactically wrong. Raw SQL stays an escape hatch.

Tokens

~tokens on every response

Every result includes its estimated token cost. Agents know what they spend before deciding what to ask next.

Safety

HITL for the escape hatch

query --show-sql previews resolved SQL before execution. Curated primitives need no confirmation — their SQL is fully determined by parameters.

02

Primitives

Nine curated operations cover what agents ask about data. Each maps to a deterministic SQL pattern — no prompt injection surface.

Command Use when the agent asks…
describe "what's in this file?", "what columns?", "how many rows?"
sample "show me some rows", "what does the data look like?"
count "how many rows where X?"
profile "tell me about column X", "any nulls?", "what values?"
distinct "what are the unique values of X?"
aggregate "total/avg X by Y", "group by Z"
filter "show rows where X", projected columns
find-duplicates "are there duplicates?"
query anything the primitives above can't express (HITL required)
03

Install and run

# install
pip install lacon
pip install lacon[tokens]   # adds ~tokens to every response

# Claude Code skill
claude skill install https://github.com/andrii-su/lacon/releases/latest/download/lacon.skill

# quick start
lacon describe sales.csv --pretty
lacon aggregate sales.csv --group-by country --metrics revenue:sum --pretty
lacon query sales.csv "SELECT year, SUM(revenue) FROM {file} GROUP BY year" --show-sql --pretty