Spreadsheets
Let the agents you grant a spreadsheet connection describe the Excel workbooks, OpenDocument spreadsheets and CSV files in their project's workspace, read a range of cells a page at a time, find the cells holding a value, and query a workbook's sheets with SQL, all read-only
A spreadsheet connection lets an agent read the workbooks and CSV files in its project's workspace: see a workbook's sheets and the table under each one's header row, read a range of cells a page at a time, find the cells holding a value, and query the sheets with SQL. Every spreadsheet tool is read-only: an agent reads what AskRAI prepared from a workbook, and never opens or changes the workbook itself.
Before you connect
An agent reads a workbook once it is prepared for agents. Excel workbooks (.xlsx, .xlsm, .xls and .xlsb), OpenDocument spreadsheets (.ods), and CSV and TSV files are prepared once for each version that lands in the project's Workspace tab, and the file's row reads Ready for agents when it is done: see Uploading files for what the row shows meanwhile and what is too large to prepare. An agent reads what was prepared from each version, never the workbook file itself.
A connection reaches nothing outside AskRAI, so it has no server, login or firewall rule to set up.
Add a connection
Open Admin → Tools and choose the Builtin tab.
On the Spreadsheets card, choose Add connection.
Give the connection a Name agents will read, such as Finance workbooks, a Description, and tick the Organizations that may use it. Once it exists, you change them on its Organizations tab.
Adjust the Limits if you need to, and add Notes for agents: what the workbooks hold and how to read them, such as "Budgets are in thousands of euros; each sheet is one cost centre."
Choose Add connection. The connection is on at once, and its four tools arrive approved and ready to grant.
An existing connection is switched off and on again as any server is: see Switching a server on and off.
What agents can do
Every spreadsheet connection offers these four tools, all read-only:
| Tool | What it does |
|---|---|
| describe_workbook | Describes every sheet in brief: its name, whether it is hidden, its used range, how many cells and formulas it holds, the table found under its header row with each column's name and type, and the name query reads it by. It lists the workbook's named ranges too. Asked for one sheet, it describes that sheet in full: its columns, Excel tables and merged areas |
| read_range | Reads an A1 range as whole rows: a cell, a block such as A1:D20, whole columns such as A:D or whole rows such as 3:20, or the sheet's used range when none is given. Each page holds at most the connection's Rows per read, with a cursor the agent asks for the next page from, and, when the agent asks, each formula's text beside its value |
| find | Finds up to 100 cells whose value contains the text, ignoring case, in one sheet or in every sheet |
| query | Runs one DuckDB SQL SELECT over the workbook's sheets: see Query a workbook with SQL |
An agent names a workbook by its path from the workspace root, such as finance/q3-budget.xlsx, or by its askrai-workspace: link, and reads only a file inside the folders its workspace access lets it read. A file outside them, or in another project's workspace, reads as not found.
An agent sees each tool under the connection's own name, so one granted Finance workbooks calls finance-workbooks__query. Each tool's description opens with the connection's name and ends with your notes.
Query a workbook with SQL
query runs one DuckDB SQL SELECT over the workbook, where each sheet is a view named after it, as describe_workbook lists. A sheet whose table was found under its header row reads as that table's columns, so an agent can filter, sum and group them as it would a database table. A sheet without one reads as its cells, one row per cell: its row, column, type, value and formula.
A query answers at most the connection's Rows per read, and says when more rows exist, so the agent can narrow it.
A query reads only that workbook's prepared data, and writes nothing: each one runs on its own, in memory, within a memory limit and the call's time limit.
What each format keeps
Every format keeps its cells' values. The rest depends on the format:
| What | Kept from |
|---|---|
| Formula text | .xlsx and .xlsm |
| Named ranges | .xlsx and .xlsm |
| Excel tables | .xlsx and .xlsm |
| Merged areas | .xlsx, .xlsm and .xls |
| Hidden sheets | Every format but .csv and .tsv |
In an .xls, .xlsb or .ods file, an error value such as #DIV/0! reads as an empty cell. An agent that asks for something its workbook's format does not keep, such as the formulas of an .ods file, is told the format does not keep it.
What is never done
- Values are as last saved. An agent reads the values the workbook's author last saved.
- Formulas are never recalculated. A formula is kept as its text, and its value is the one saved with the workbook.
- Macros never run.
- External links are never followed, so a cell drawing on another workbook reads as it was saved.
Cells are content, not instructions
A cell can say anything to whoever reads it. Like every tool's answer, what an agent reads from a workbook is content from outside: the agent reads it, and nothing written in a cell is an instruction to it.
A workbook not yet prepared
An agent asked to read a workbook that is still being prepared is told so, and can try again on a later run. A workbook that could not be prepared, because it is too large, holds no cells, or could not be read, says why, as its row on the Workspace tab does. A new version of a workbook is prepared again from the start, and agents read the version that is current.
Grant a connection to an agent
A spreadsheet connection is granted like any other tool server: on the agent's Skills & Tools tab, by someone with Write access to its project, when the project's organization is one the connection is granted to. The agent reads the workbooks of its own project, inside the folders its workspace access lets it read.
Limit how often agents call a connection
Calls per minute caps the calls every agent together makes to the connection in each minute. Once the minute's calls are used up, further calls are refused, and the agent is told the connection is busy and to try again later.
Field reference
| Field | What it holds |
|---|---|
| Rows per read | The most rows one read_range page or one query answers, from 1 to 1,000. 200 by default. A read ends with a cursor for the next page, and a query says when more rows exist |
| Calls per minute | How many calls agents may make to the connection each minute, all of them together, up to 600. 60 by default |
| Notes for agents | What agents should know to read the workbooks, up to 2,000 characters |
| Simulated | Off unless you switch it on. Marks the connection and its calls as a stand-in for a real system: see Simulated systems |
Troubleshooting
| What you see | What it means |
|---|---|
| An agent is told a workbook is not found | No file is at that path, or it lies outside the folders the agent may read, or in another project. Check the path on the Workspace tab, and the agent's workspace access |
| An agent is told a workbook is being prepared | Preparing has not finished. The agent can read it once the file's row reads Ready for agents |
| An agent is told a workbook could not be prepared | It is too large, holds no cells, or could not be read, as its row on the Workspace tab says. See Uploading files for the limits |
| An agent is told the workbook's format does not keep formulas, named ranges, Excel tables or merged areas | The format holds none: see What each format keeps. Save the workbook as .xlsx and upload it as a new version if agents need them |
| An agent reads a value that differs from what the workbook shows once opened | Formulas are never recalculated, so an agent reads the values as they were last saved. Open the workbook, save it, and upload it as a new version |
| A query answers fewer rows than it matched | A query answers at most Rows per read, and says more exist. Have the agent narrow its query, or raise Rows per read |
| An agent is told the connection is busy | The minute's Calls per minute are used up. Raise the limit if agents need more |
Related
Mailboxes
Let the agents you grant a mailbox connection list the folders of an Outlook archive uploaded to their project, search its messages by sender, recipient, subject, date and attachments, read a message one section at a time, and save its attachments into the workspace when you allow it
Vaults
Keep an organization's secrets in named vaults, entered by name and never shown again, link each vault to the organization's projects, and draw tool credentials from them