Data
golem can answer questions about data you already have: a folder of spreadsheets, a database, a file on the web. You add it as a source. The model writes the question as SQL, golem runs it, and you get the answer as a table you can sort, chart, save and export.
golem only reads. It never changes your files or your database, and a source is never reached over the network while a question runs.
What a source is
A source is a named, read-only view of some data. It has a name, a kind, and a privacy level. The model uses the name, so you can say "how much did I spend last month, from bank?" and it knows which one.
| Kind | What it is |
|---|---|
| Files or a folder | CSV, Parquet, JSON lines, Excel, or a pattern such as ~/Documents/sales/*.csv. A pattern reads many files as one table |
| A SQLite or DuckDB file | A database kept in one file |
| A database | PostgreSQL or MySQL, on this Mac or on a server |
| A URL | A CSV, Parquet or JSON file on the web, or a .gz or .zip of one |
golem also has one built-in source, golem. It holds your own usage, runs and chats list, with no message text. Try golem data query golem "select model, sum(cost_usd) from usage group by model".
Add a source
In the web app, open Data in the rail and press Add a source. Pick what it is, say where it is, then say who may see its rows. golem reads it in place and never writes to it.
| Step | What you do |
|---|---|
| What kind | Files or a folder, Database, or A URL. Through MCP is for BigQuery, Snowflake and the like. It adds an MCP server, so there is no privacy choice. See MCP servers |
| Where | For files, a folder, a file, or a pattern. For a database, pick the Type (PostgreSQL, MySQL or SQLite file), then Host, Port, Database, User, Password and Encryption. For a URL, the Address |
| Check | Check reads the headers and a few sample rows. Test connection does the same for a database. golem shows what it found and suggests a privacy level and the reason. If it fails you can still go on, and Add source shows the real error |
| Name | The model calls the source by this name, as @name |
| Save in | this project, or yours, every chat |
| Who may see rows | One of three levels, below |
| Keep it fresh | For a URL: Only when I press Refresh, Every day or Every week |
Then press Add source. A URL says Download and add.
A database password goes to the macOS Keychain, never to a file or a model. golem connects from the daemon, so the shell and the model never see the address or the password. Give the address without a password, such as postgres://golem_ro@localhost:5432/shop_dev. Use a login that can only read: golem warns when yours can write, and still opens the source.
Some kinds need a small add-on that golem downloads once into its own folder: Excel, SQLite files, PostgreSQL and MySQL. The page says so and shows Get it (one-time download). golem downloads nothing until you press it.
In the terminal, golem data add does the same. /data lists your sources and opens one, and @ in the chat box suggests their names. See Commands.
You can also write the source by hand in config.toml. Settings lists every key.
Who may see the rows
Every source has one of three levels. A model always sees the names of the tables and columns, so it can write a question. The level says whether it sees the rows.
| Level | Chip | What the model sees |
|---|---|---|
| Open | rows open | Every model may read rows and results |
| Local | rows local | Local models read rows. Hosted models see the schema, row counts and column stats, and a result reaches them as "N rows, shown to the user" |
| Schema | schema only | No model sees rows. The model writes the query, and only you see what it returns |
A new source starts at the level golem suggests. A column named like an amount, an email, a name, a phone or an address, or a place in your home folder, gives Local. A database on this Mac or a folder of test data gives Open. When golem cannot tell, it picks Local. From the terminal, a database on another machine starts at Schema. You change the level at any time on the source page, under Settings.
A hosted model never gets the rows of an Open source in a private chat, such as one in a local-only folder. You always see every row yourself, whatever the level.
When a model is not allowed the rows, the result table shows the line "The model saw only the row count and column names". Show what it saw shows the exact text it got.
Ask in a chat
Ask in plain words. You can name the source with @:
@bank what did I spend on food each month this year?The model reads the source's tables and your notes, writes a query, and runs it. You get the whole result as a table, not only the rows the model read. The model sees the first 20 rows, with the smallest, largest and sum of each number column.
The result table lets you:
- Page through it. Pages of 50 rows by default, with a Rows per page choice.
- Sort. Press a column heading. Sorting is on the page you see, and the table says "sorted on this page".
- Show as a chart. With a number column and a label or date column, switch Show as from table to chart. A chart is a bar chart, or a line chart for dates. It draws the rows of the page.
- Save query. Keeps the question with the source, below.
- Export. Writes the whole result to a new file, below.
A question has a time limit, and a result a row limit. Limits says how many.
The source page
Pick a source in the Data list. Its page has five tabs.
| Tab | What it shows |
|---|---|
| Columns | Each table with its columns, their types, and a small chart of each column's shape. Switch Show columns as List or Cards. Counts are exact up to a million rows, and above that golem estimates them and marks the number with ~. Every model may see these |
| Rows | The whole table, not a sample. Scroll it, sort by a column, filter, search with Find in text columns…, open one row, and Export… the rows you are looking at |
| Notes | What the tables mean, in your words, below |
| Queries | Your saved queries, below |
| Settings | Who may see rows, where the source is and where it is saved, and Remove source. A web source has Keep it fresh. A folder has New files. A database has Snapshot, below. Remove source makes golem forget it. The files and the database stay as they are |
Notes
Notes tell the model what your data means: "amt is in cents", "a refund is a negative amount", "ignore rows where status is test". The model reads them before it writes a query, so they save you from repeating yourself and from wrong answers.
On the Notes tab, write them in Markdown and press Save. Draft notes (or Draft with golem) asks a model to write a first version from the column names and types. Nothing is saved until you press Accept. Correct whatever golem got wrong.
From the terminal, golem data notes <source> --edit opens them in $EDITOR.
The notes are a file, DATA.md. A source of yours keeps it in ~/.golem/data/<name>/. A source of a project keeps it in the project's .golem/data/<name>/, so it travels with the project. The model reads the first 16 KB. Removing a source leaves its notes, so adding the same name again finds them.
Saved queries
Press Save query on a result, or New query on the Queries tab. A saved query has a Name, an optional What it answers that the model reads, and the SQL. Try runs it and shows the first rows before you save.
On the Queries tab each saved query has:
- Run, which runs it in one click, with no model.
- Ask in chat, which starts a chat with the question.
- Routine (⏱), which schedules it, below.
- A menu with Edit and Copy SQL, and a way to remove it.
Only a query that reads can be saved. The model can run a saved query by name, and golem shows when each one last ran.
Saved queries are a file, queries.toml, next to DATA.md. When each ran is kept apart, so a committed file does not change on every run.
From the terminal: golem data query list, run, save and remove. See Commands.
Run a query on a schedule
On a saved query, ⏱ Routine opens New routine. Pick when, then Then:
| Choice | What happens |
|---|---|
| Post the result to the Inbox | Every time, with the first rows |
| Post only when it finds rows | An alert. Put the threshold in the query, such as where amount < -500 or having count(*) > 5 |
| Ask a model to write a summary | Starts the data report workflow with this query. Only that one step uses a model |
The first two use no model and no chat. The Inbox is on this Mac, so it shows the rows whatever the source's privacy. A push to your phone says only the name and the row count. Routines has the rest, and Workflows the report.
Export
Export on a result, or Export… on the Rows tab, writes a new file: CSV, Parquet, JSON or Excel. The default folder is ~/Downloads. golem writes a new file. It never replaces one that is there, and never writes into a data source. Excel needs the small add-on.
When the model exports with data_export, golem asks you first, every time. The file goes to your own disk and no model reads it, so this works for a source of any level.
From the terminal: golem data query <source> <sql> --out file.csv, or golem data export <result_id> <file>.
A file on the web
A URL source is downloaded by golem, not by the engine. It follows the rules of web pages: https only, public addresses only, a redirect only on the same host, and at most max_download. The data engine reads the copy and never goes on the network.
On the source page, Download now or Refresh now fetches it again, and Cancel stops a download. Keep it fresh in Settings can do it every day or every week. A file that has not changed is not fetched twice. A refresh that fails keeps the last copy and says so.
A database, live or a snapshot
A Postgres or MySQL source is read live, in a read-only session with a time limit. golem keeps no rows. Every question goes to the server.
For a database that is slow, far away or only reachable on the VPN, take a snapshot. Open the source's Settings, then Snapshot, tick the tables, and press Take snapshot. golem shows an estimate first. It copies the tables into Parquet files on this Mac, and the source reads the copy.
- Reading switches between Live and Snapshot. Tables that are not in the snapshot are still read live, and the Columns tab marks them.
- Take again makes a newer copy. Under Keep it fresh, Every day or Every week does it for you.
- Delete snapshot removes the files. The source reads the server again.
- A snapshot keeps the source's privacy level.
The terminal has golem data snapshot <source>.
The analyst helper
A question that needs several queries, such as "which customers ordered less this year than last, and why?", can go to the analyst. It is a helper that runs the queries in its own window and hands back the answer with its numbers. It reads sources and cannot change anything, and it follows the same privacy levels. Ask for it in plain words, or let the chat decide.
Limits
| Limit | Value |
|---|---|
| Read only | A question is one statement that reads: SELECT, WITH, DESCRIBE or SUMMARIZE. Anything that writes, attaches, installs or changes a setting is refused with a sentence that says why |
| Time limit | 15 seconds by default (query_timeout_seconds). A slower query is stopped. On a database server, timeout_s sets the server's own limit |
| Row cap | 10 000 rows (max_rows). The result says when there are more |
| Memory | 2 GB for the engine (worker_memory) |
| Size of a download or snapshot | 2 GB (max_download). A table over it is listed with why it is left out |
| Never on the network | The engine reads only the files of the source. It cannot open another file, a URL, or a server of its own |
A runaway query cannot take golem down. The engine runs in its own process, and golem stops it when it goes over the time limit.
The limits are in [data] of config.toml. Settings lists them.
Where the files live
| What | Where |
|---|---|
| Your sources | [data.<name>] in ~/.golem/config.toml, or in a trusted project's .golem/config.toml |
| Notes and saved queries | ~/.golem/data/<name>/, or the project's .golem/data/<name>/ |
| Results you can page through | ~/.golem/data/results/. golem removes a file after 30 days, and the oldest when they pass 1 GB |
| Web files | ~/.golem/data/downloads/<name>/ |
| Snapshots | ~/.golem/data/snapshots/<name>/ |
| Add-ons | ~/.golem/data/extensions/ |
| A database password | The macOS Keychain |
A project's source is used only when you trust the project's folder. Until then it is listed, and its row says "untrusted — trust this folder to use it".
Measure your model on data questions
How well does your model answer questions about data? Measure asks 30 fixed questions about two small datasets and scores them exactly. On the web, the Measure tab has a Data view. From the terminal, run golem eval data. Your own sources are never read. See Measure.