Skip to main content

Building Your Agent

Database Connections

Connect your agent to Nirvai databases so it can read, write, and manage your data

Connecting a database to your agent is like handing it the keys to a spreadsheet (think Excel or Google Sheets) and letting it work the rows for you — it can look up entries, add new ones, update what's there, and remove what's outdated, all by chatting in plain language. Once connected, your agent can answer questions and make changes against your real data instead of guessing.

You can connect one or more Nirvai databases to a single agent.


Before you start​

  • A saved agent (at least the Profile step completed)
  • At least one database created in your workspace — see Creating databases
  • A clear idea of what you want the agent to do with the data (just look things up, or also change them)

How it works​

When you connect a database to an agent, Nirvai automatically sets up a set of tools for that database. The agent uses these tools to work with your data, the same way it uses any other tool.


Step-by-step​

  1. In the builder, choose Databases in the left menu
  2. Click Add table and pick a table from your databases
  3. Choose a permission level (what the agent is allowed to do — see below). The menu shows how many tools that level adds
  4. The database tools are added to your agent automatically, and the table's columns appear as a preview
Agents Support Assistant Set up Back to agentNirvai chat

Databases

Tables this agent can look things up in and, if you allow it, keep up to date.

Complete
Connect database tables
Give your agent direct access to your database tables. Choose permission levels — Read for queries only, Write for data entry and page content, or Full for complete access including delete.
Connected tables 1 Add table
☕ Café Altura 1 table
Orders Full access
Order Status● Pending● Shipped● Delivered Customer Total Ship date

This agent can read the records here, and add, update or delete them.

Full (6 Tools)
tip

You can also start from the database itself. Open a database, click the tools menu in the header, and choose Create AI Tools or Create AI Agent. The full walkthrough is in AI features in Databases.


Permission levels​

When you connect a database, you decide what the agent is allowed to do with it. Pick the lowest level that still does the job.

PermissionTools grantedWhat the agent can do
Read1Look up records
Write5Everything in Read, plus add records, update existing ones, and read/update long-form content fields
Full6Everything in Write, plus delete records

Tools by permission level​

ToolReadWriteFull
Look up recordsYesYesYes
Add records—YesYes
Update records—YesYes
Read long-form content—YesYes
Update long-form content—YesYes
Delete records——Yes
warning

Choose the minimum permission level your agent needs. A FAQ bot that only looks things up should have Read. An agent that manages leads or processes orders needs Write or Full.


How many tools databases add​

All your connected databases share one set of database tools — the agent simply points each action at the right table — so connecting more databases doesn't keep adding tools. What it adds depends on the highest permission among them:

Highest permission among your databasesTools added
Read only1
Write5
Full6

There's no limit on how many tools an agent can have, but pick the lowest permission each database needs — for safety, and because a shorter tool list helps the agent choose well.


How the agent uses database tools​

The agent decides when to use a database tool based on the user's request and your instructions. For example:

User saysAgent does
"Show me all leads from last week"Uses Select records with a date filter
"Add a new contact: John, john@email.com"Uses Insert record with the provided values
"Mark task #42 as complete"Uses Update records to change the status
"Delete the duplicate entry for Acme Corp"Uses Delete records matching the condition
"How many orders did we process this month?"Uses Select records with a count

The agent knows the shape of your data (which columns it has and what kind of value each one holds) and formats values correctly. A currency column receives decimal numbers, a multi-select column receives a list of values, and so on.


Real-time notifications​

When an agent changes your database (adds, updates, or deletes a record), an alert pops up in your browser right away if you have that database open. The alert shows:

  • What operation was performed
  • How many records were affected
  • Which agent made the change

This way you always know when an agent is changing your data, even when you're not in the chat.


Use cases​

ScenarioSetup
Customer lookup botConnect your customers database with Read permission. The agent finds records by email, name, or order number.
Lead management agentConnect your leads database with Write permission. The agent adds new leads from WhatsApp, updates their status, and flags duplicates.
Inventory trackerConnect your products database with Full permission. The agent runs custom look-ups for stock reports and updates quantities in bulk.
Data entry assistantConnect any database with Write permission. The agent reads incoming data (emails, forms, messages) and adds tidy records.

Troubleshooting​

ProblemFix
Agent can't find recordsCheck the permission level — it needs at least Read. Make sure the user's wording matches your column names.
Agent adds data incorrectlyCheck the column types. The agent follows the format hints from your database. If data is consistently wrong, add an instruction like "The status column accepts: Open, In Progress, Done."
Agent changes the wrong recordsAdd clearer instructions about when to update or delete. Consider using Read permission until you've tested how the agent behaves.

What's next​

Next, add routines your agent repeats exactly with Skills.