Skip to main content

Bedrock tabular search: when RAG runs code over your spreadsheets

Amazon Bedrock Managed Knowledge Base now runs model-written code over CSV and Excel files during agentic retrieval. How tabular search works, its file limits and permissions, and when SQL or BI tools are still the better fit.

Share -
Hands typing on a cyan-lit keyboard below three monitors of charts and data tables in a dark office

Tabular search, new in Amazon Bedrock Managed Knowledge Base, runs model-written code over a whole CSV or Excel table in an isolated sandbox when a question needs it, then combines the result with facts from your documents. Use it for questions that mix a policy with a calculation; keep governed reporting in BI tools.

What AWS released

Tabular search was announced by AWS on 16 November 2026 as a capability of Amazon Bedrock Managed Knowledge Base. It works inside the existing AgenticRetrieveStream request, so applications already using agentic retrieval get it without a new endpoint and without a setting to switch on.

Access needs a managed knowledge base in a supported AWS Region, the AWS SDK for Python (Boto3) 1.43.123 or later for the walkthrough, and the agentic retrieval permissions. For costs, the announcement points to Amazon Bedrock pricing and quotes no separate rate for tabular search.

What actually changed

Plain retrieval splits tables into passages like any other text. Retrieval returns only the passages that most closely match a question, so a total or a threshold check built from them could silently use a handful of rows. AWS now splits the work, as described in the announcement:

  • Retrieval finds the file, code reads it. Retrieval only has to return one passage from the right table file. The agent then decides whether to run code, copies the original file into a sandbox with no network access, runs code over every row and gets back only what the code prints.
  • Supported files. CSV, XLSX and XLS. Tables inside PDF or Word documents are not read this way; AWS advises exporting them first.
  • Size limits. Code runs over CSV files up to 500 MB, the ingestion limit, but over Excel sheets only up to 200 MB. Larger Excel files can still be ingested, so a full-table calculation is not guaranteed for them.
  • Any connector. It works the same whether files arrive from Amazon S3, Microsoft SharePoint, Atlassian Confluence or another connector.
  • No schema to define. Tables are read where they sit next to your documents.
  • Caller's credentials. The agent reads the original table file with the calling identity's credentials, which needs bedrock:GetDocumentContent alongside Retrieve and AgenticRetrieveStream.
  • Trace, not code. The stream reports Planning and CodeExecution events naming each file the code read. The generated code itself is not returned, by design, because it can echo cell values.
  • Plain Retrieve is unchanged. The Retrieve API still returns passages and never runs code. Setting generateResponse to false on agentic retrieval also skips code execution.

What it means for teams building on Bedrock

The practical gain is for assistants over mixed folders: a SharePoint site with budget workbooks beside the policies that give the numbers meaning. Until now, teams either accepted partial answers or built a separate text-to-SQL path and a router in front of it. The following is CodeDTX's advice on using it well.

  • Check file types after the first sync. AWS notes tabular search starts only when table passages carry a _file_type of CSV or MS_EXCEL. Add that check to your ingestion tests, next to the retrieval tests in test RAG retrieval before the model.
  • Control which files the code may read. Use metadata filters under retrievalOverrides, for example on document title, so a draft workbook can't answer instead of the final one. AWS's own example shows a draft and a final workbook looking almost identical to search.
  • Review permissions per caller. Because the file is read with the caller's credentials, a user who can retrieve a passage from a workbook can have code run over all of it. Make sure document-level access matches who may see whole tables, not just snippets.
  • Log the trace. Keep the Planning and CodeExecution events, including the file names, in your agent audit trail. Without the generated code, the trace is your only record of which data produced a figure.
  • Budget for latency and tokens. Running code adds at least one extra agent turn, so table answers are slower than text answers. Keep plain Retrieve for quick lookups and watch the extra model calls in your agent running costs.
  • Teach users to name sources. AWS's guidance is to pair one rule with one table, name the file when versions differ, and say "calculate" when a summary sheet might otherwise be quoted.

When not to use it

  • Governed metrics and recurring dashboards. AWS itself says these, warehouse-scale joins and reporting controls still belong in BI tools. A figure that goes into a board pack needs a defined calculation, not one a model writes per question.
  • Data that lives in a database. If the source of truth is a warehouse, query it with SQL and its own permissions instead of exporting spreadsheets into a knowledge base.
  • Large Excel workbooks. Sheets above the 200 MB code limit can be ingested but not fully calculated. Convert them to CSV or split them.
  • Retrieval you run yourself. AWS describes tabular search only as part of agentic retrieval in Bedrock Managed Knowledge Base. If your RAG runs on your own vector store, plan a separate path for table questions.

Frequently asked questions

Do we need to turn tabular search on?

No. Tabular search is part of agentic retrieval in Amazon Bedrock Managed Knowledge Base and starts automatically when retrieved passages come from a CSV, XLSX or XLS file and the question needs a calculation or a lookup of specific values. It runs during response generation, which is on by default. If you set generateResponse to false, or use the plain Retrieve API, no code runs.

Can we see the code the model runs over our tables?

No. AWS does not return the generated code, because it can echo cell values into the response. Instead, the stream includes Planning and CodeExecution trace events that name each file the code read and report whether the step succeeded or failed. Store those events with the question and answer so that you can later show which workbook a figure came from.

Is our data safe inside the tabular search sandbox?

According to AWS, the original file is copied into an isolated sandbox with no network access, and only what the code prints goes back to the agent. The file is read with the calling identity's credentials, so access still depends on your IAM policies and document permissions. Review those permissions carefully, because code reads the whole table, not only the passage that matched.

Should tabular search replace our text-to-SQL agent?

Usually not. Tabular search suits spreadsheets that already sit beside your documents, such as finance workbooks next to policies, with no schema to maintain. Data in a warehouse is better queried with SQL, where permissions, joins and definitions are already governed. Use tabular search for questions that combine a document rule with a file-based table, and keep SQL for questions about operational data.

Share this post

Contact us to build the right product

Talk to our engineers about your application, the systems it connects to, and what you want to build next.

Get in touch
Two people discussing work with a laptop