# DuckDB (VYAGENT Radar #10)

> In-process analytical SQL engine for querying local CSV, JSON, and Parquet files in milliseconds—ideal for data-heavy AI agents.

- **URL**: https://vyagent.com/radar/duckdb
- **Published**: 2026-11-26
- **Category**: CLI & Embedded DB · Local Analytics
- **License**: MIT
- **Pricing**: Free & Open Source (MIT)
- **Agent Ready**: CLI, Local-first, Open Source
- **Source**: https://github.com/duckdb/duckdb
- **Package / Docs**: https://duckdb.org/

## 1. Friction Solved
Feeding raw CSV or JSON exports directly into an LLM fails past a few thousand rows and invites arithmetic hallucinations. DuckDB gives both humans and coding agents a zero-server SQL binary that aggregates millions of rows directly from local files—returning exact tables to the model instead of raw dumps.

## 2. Best-Fit Scenarios
- Giving AI research agents exact SQL aggregation over large market snapshots, server logs, or Parquet datasets without hallucinating sums.
- Exploring gigabyte-scale CSV/NDJSON exports locally on a laptop where spreadsheets freeze and pandas runs out of RAM.
- Converting messy JSON/CSV folders into compact Parquet archives with one SQL statement.

## 3. Setup (Zero-Setup Local SQL Over CSV / Parquet / JSON)
```
# Install CLI on macOS (or pip install duckdb)
brew install duckdb

# Query a local CSV or Parquet file directly without importing into a server
duckdb -c "
  SELECT category, COUNT(*) AS items, ROUND(AVG(price), 2) AS avg_price
  FROM 'market_snapshot.parquet'
  WHERE price > 0
  GROUP BY category
  ORDER BY items DESC
  LIMIT 10;
"
```

## 4. Reality Check & Trade-offs
- Built for analytical scans (OLAP), not high-concurrency transactional writes (OLTP)—stick to SQLite or Postgres for multi-user web app writes.
- While single-file `.duckdb` databases support out-of-core execution, only one process can hold a read-write lock at a time.
- When letting an autonomous agent run DuckDB SQL over local files, run in `-readonly` mode or inside a scoped directory so it cannot overwrite source files via `COPY ... TO`.

## 5. Editorial Verdict
Our own WorkBuddy market research (89,403 records) proved why local analytical engines matter: let deterministic SQL compute the facts, and let LLMs help explore hypotheses.

## 6. FAQ
### Do I need to create a schema or import data before querying a CSV?
No. DuckDB infers headers and column types automatically when you query a CSV, JSON, or Parquet file path directly in the FROM clause.

### Can DuckDB run inside Python or Node.js scripts alongside AI SDKs?
Yes. Official in-process libraries exist for Python, Node.js, Rust, Go, and WebAssembly, requiring zero external daemon.
