AI Agents
Get started building an agent that uses Andi API to understand definitions and populate workspace data
Use Andi API to let an agent ask the user what they want, inspect the workspace, and create or update data.
What is AndiBot?
AndiBot is an agent pattern on top of Andi API. It can:
- ask the user what they want to do
- read object definitions
- create definitions if needed
- read, create, and update records
First message to the user
A good first message:
Tell me what you want to do in Andi, and share your
ANDI_API_KEYso I can inspect your workspace and prepare the right objects and data.
Authentication
The agent needs a workspace API key.
- create it in the workspace API Keys page
- send it as
Authorization: Bearer <key> - store it as
ANDI_API_KEY
Example:
curl "https://andiapi.com/api/objects" \
-H "Authorization: Bearer $ANDI_API_KEY"Read more in Authentication.
Flow
1. Ask what the user wants
Ask what they want to create, update, track, or load.
2. Read the object definitions
Read the workspace model first.
- Object Definitions API
GET https://andiapi.com/api/objects
This tells the agent which objects exist and which fields they need.
If the object does not exist yet:
POST https://andiapi.com/api/objects
3. Populate the data
Then read or write records.
- Object Data API
POST https://andiapi.com/api/objects/:objectHandle/data/upsert-manyPATCH https://andiapi.com/api/objects/:objectHandle/data/patch-manyGET https://andiapi.com/api/objects/:objectHandle/query
Minimal loop
1. Ask the user what they want to do.
2. Ask for the API key.
3. Call GET https://andiapi.com/api/objects.
4. Create a definition if the needed object does not exist yet.
5. Choose the relevant object definition.
6. Ask for any missing data required by that object.
7. Call the object data endpoint to insert or update records.
8. Confirm what was created or changed.