Skip to main content

What are functions?

Functions are connections between your AI agent and your app’s API endpoints. They let the agent read and write data: looking up records, filtering lists, creating entries, and performing actions on behalf of users.
Functions are how agents interact with your app’s live data. Without functions, an agent can only chat and reference knowledge base documents. With functions, it can answer questions like “Show me all deals closing this month” by querying your data.

How it works

1

Build your app with data models

Create your application with the data models and features you need. Each data model gets API endpoints automatically.
2

Describe what the agent needs

When creating or updating your agent, describe what data it should access: “Give it access to deals and contacts data.”
3

Agent Builder discovers endpoints

The Agent Builder examines your app’s API endpoints and creates functions that map to them.
4

Functions are ready

The agent can now query, filter, and modify data through these functions during conversations.
Functions can query data synced from external sources via data connectors. Connect a source like HubSpot or Google Sheets, sync the data into a data model, and your agent’s functions can access it just like any other app data.

Automatic endpoint discovery

When you ask the Agent Builder to give an agent access to your data, it automatically discovers your app’s available API endpoints. You don’t need to manually configure routes or write API code. The builder reads your app’s data models and creates the appropriate function mappings. This means the agent learns what data exists, what fields are available, and what operations are possible.

Prompt examples

Give the Sales Coach agent access to deals and contacts
so it can look up pipeline data and find contact information.
Add functions to the support agent so it can look up
orders by order number and check order status.
Let the HR assistant query employee records and
time-off requests.
Your app must be built with data models before you can add functions. The agent needs existing API endpoints to connect to. Build your app first, then create the agent and add functions.

Query capabilities

Agents with functions can perform sophisticated data queries:
CapabilityExample questionWhat happens
Filter”Show deals with status won”Filters records by field value
Sort”Show deals sorted by amount, highest first”Orders results by a field
Search”Find contacts at Acme Corp”Searches text fields
Date ranges”Deals closing this month”Filters by date ranges
Numeric ranges”Deals over $10,000”Filters by numeric thresholds
Limits”Show the top 5 deals”Limits result count
Combined filters”Open deals over $10k closing this quarter”Applies multiple filters at once

Managing functions

You can add, update, or remove functions through prompts:

Adding functions

Give the Sales Coach access to the products data model
so it can answer questions about pricing.

Updating function scope

Update the support agent's functions to also include
access to the returns data.

Removing functions

Remove the Sales Coach's access to employee data.
It should only see deals and contacts.

Best practices

Begin by giving agents the ability to read and query data. Add write capabilities (creating or updating records) only when needed.
Instead of “give it access to everything,” specify the data models: “Give it access to deals, contacts, and companies.” This keeps the agent focused and reduces confusion.
A sales agent needs deals and contacts. A support agent needs orders and tickets. Don’t give agents access to data they don’t need.
Functions handle live data queries. Knowledge bases handle static reference material. Together, an agent can look up a customer’s order and reference your return policy to answer a question.

Learn more