← All news

brasil-cli: Brazil's public microdata, ready for an AI agent to query in seconds

We shipped brasil-cli 0.4.0 to PyPI: PNADC, 2022 Census, TSE and BCB/IPCA data with weighted estimates, bootstrap confidence intervals, and read-only SQL, built for LLM agents.

Leonardo Dias brasil-cliopen-sourcedados

I spent two decades building search engines to find things that already existed but were buried — jobs at Catho, products at a major Brazilian e-commerce retailer, news on G1. The problem was never missing data. It was the friction between the data and whoever needed it.

Brazil runs, arguably, the most sophisticated statistical apparatus in Latin America. The continuous household survey (PNADC), the Census, electoral data from the TSE, central bank series — all of it produced with real methodological rigor, by serious people, and published openly. The problem shows up right after: downloading a microdata file, decoding the variable dictionary, applying the correct sample weight, computing standard error without tripping over a classic survey-design mistake. That eats days of a trained analyst’s time today — and it’s too opaque for an AI agent to even attempt.

So we shipped brasil-cli, now at version 0.4.0 on PyPI.

What it does

pip install brasil-cli gets you access, through the terminal or read-only SQL, to official microdata:

  • PNADC (Brazil’s continuous national household sample survey) — employment, income, labor force
  • 2022 Census
  • TSE — electoral data
  • BCB/IPCA — Brazilian Central Bank series

The point isn’t just “access to the data.” It’s access with the statistical rigor built in: estimates weighted by the sample design, confidence intervals computed via 200-replicate bootstrap, and a statistical audit seal that shows exactly which methodology ran behind any given query. No pulling a naive average out of a stratified sample and calling it a day — that’s the kind of mistake that produces a result that’s “statistically invalid but visually convincing,” which is the worst kind of wrong there is.

Built for agents, not just analysts

brasil-cli was designed from the first commit to be queried by LLM agents, not only by humans typing commands. That means a predictable interface, structured outputs, read-only SQL so an agent can explore without any risk of corrupting anything, and methodology that’s exposed rather than hidden in a black box.

That matters because the next wave of data products won’t be dashboards. It’ll be an agent asking “what was the real income change in rural Northeast Brazil between 2019 and 2023, with a confidence interval” and getting back an auditable answer — not a hallucination dressed up with plausible-looking numbers. I built enterprise search my whole career knowing relevance without precision is pretty garbage. Statistical data without sampling rigor is the same trap, just more dangerous, because it looks more trustworthy.

The line we hold

brasil-cli is not an official tool of IBGE or the TSE. It’s an access and computation layer on top of public data those institutions already publish. We are not affiliated with them, we don’t replace the primary source, and we recommend always citing IBGE, the TSE, and the Central Bank as the original sources of the microdata. What we do is remove the friction between public data and whoever needs it — analyst, journalist, researcher, or agent.

That’s the whole thesis in one line: Brazil takes excellent photographs of itself; friction is what hides the country from itself.

What’s next

brasil-cli is live at brasil.arvor.co, and the code is open source. It’s part of a broader Arvor thesis: trustworthy knowledge systems aren’t born from more data, they’re born from less friction between the data that already exists and whoever needs to reason over it — whether that’s a human analyst or an autonomous agent.

If your company treats Brazilian public data as an input — policy, credit, labor market, elections — and wants it available for your own internal agents to query with statistical safety, that’s exactly the kind of system we build in Arvor’s agentic consulting practice. Reach out at /en/contact.