Table Structure
Each smart table has:- A schema of typed columns you define (
text,integer,bigint,numeric,boolean,date,timestamp,text_array). - A slug used to reference it in API calls.
- Optional searchable fields: the text columns used for semantic search.
- An optional label field used as the row’s name in agent answers and in the admin interface.
external_id you control, so upserts replace existing rows with the same id.
Creating a Smart Table
Navigate to Developer > Data > Smart tables and click Create, then:- Set a name and optional description.
- Add columns (name + type). After creation, you can add columns but not change or remove existing ones.
- Choose which columns are searchable.
- Pick a label field.
external_id and any required column. Adding a row checks for an existing external ID before saving and reports missing fields or save errors.
Adding a Row from a PDF
From the rows view of any smart table, click Add file and pick a PDF. AGO reads the document, fills in the table’s columns based on the schema, and inserts a new row with the extracted values. To steer how AGO reads your documents, set the table’s Extraction prompt on its schema page, for example “Extract values from a sales invoice”. Leave it blank to use a generic default.Clearing All Rows
From the rows view, click Clear table in the header and confirm. Every row in the table is permanently deleted. The schema, columns, and extraction prompt are kept — only the data is removed. This action cannot be undone.Browsing Rows
The rows view offers three ways to narrow down the data you see:- Semantic search — type into the search box to rank rows by meaning.
- Filters — click More filters to pick a column (external_id, created_at, updated_at, or any of your custom columns). The input that appears depends on the column type: text boxes for text or numeric columns, true/false for booleans, date range pickers for dates. Active filters stay visible until you clear them.
- Sort — click any column header to sort ascending, click again for descending, click a third time to clear.
Pushing Data via API
From the rows view of any smart table, click Push via API to see a ready-to-copycurl example pre-filled with the table slug and a sample row matching your schema.
Authentication
Push endpoints use scoped API key authentication. Create an API key under Developer > API Keys with thecustom_data_sources:write scope (or custom_data_sources:read for read-only access). See Public API v1 for auth details.
Upsert Rows
external_id: existing rows are replaced, new ones are inserted. The data keys must match the table schema.
To control exactly what semantic search matches against, set searchable_text on the row. It replaces the combination of the table’s searchable fields for that row.
content on the row: free-form text, typically markdown, shown on the row’s viewer page. PDF uploads fill content automatically with the document’s text.
Upload a PDF
Send a PDF asmultipart/form-data. AGO runs the extraction described in Adding a Row from a PDF, and inserts the resulting row.
201 Created with the inserted row:
- One PDF per request, one row inserted per call.
- The
external_iddefaults to<filename>:<sha256-prefix>, so uploading the same file again overwrites the same row instead of creating a duplicate. - The original filename is exposed on the response at
data.__metadata__.source_file. - To steer the extraction, set the smart table’s extraction prompt on its schema page (see Adding a Row from a PDF).
Other Endpoints
Using Smart Tables in Agents
Agents search smart tables through a tool. In AI Studio → Tools, create a tool of typecustom_data_source_search, select the table in Datasource, and assign the tool to an agent. See Tools.
When you configure the tool, you choose:
- Filterable columns — columns the agent may filter on (it picks the operator at call time:
eq,gt,lt,contains, etc.). - Sortable columns — columns the agent may sort by. Enable these so the agent can answer “top/largest” or “smallest/lowest” questions, like “give me the 5 invoices with the largest amount”. The agent automatically picks the direction (descending for “largest/highest/top”, ascending for “smallest/lowest”). Sort is ignored when the agent runs a semantic search, since results are already ranked by relevance.
content, the full content is included in the search results so the agent can read the whole document. If the content is large, check Exclude full row content in the tool configuration: the results then keep each row’s column values and a link to the full content, without the content text itself.