Database operations

Overview

Use a flow that executes any database operation in your connected database.

This requires a GraphQL connection setting, as SQL is not directly supported, and current LLMs do not work correctly with this sort of prompts.

Database operations

CRUD Operations: Create, Read, Update, Delete data.

  • Transactions: Ensure data integrity with ACID properties.

  • Indexes: Improve query performance.

  • Joins: Combine data from multiple tables.

  • Backup and Recovery: Safeguard and restore data.

  • Data Security: Protect data through

Prompt Engineering

Specific props will be matched, while new props or collections will be created.

create a new post for the user

Here there can be 3 possible outcomes:

  1. The collection post exists and the data is matched with the parameters in the flow

  2. The collection post doesnt exists and is created with the data parameters as props

  3. The collection exists but the data parameters doesnt and they are added as props to the existing collection

Usage

Leverage Base to easily design your API and prototype apps, UX, or screens. To experiment with different outcomes, set "cached" to false

Using /base with "cached" is equivalent to direclty calling the function after is creation, all none neccesary params will be ignored.

POST /base

Creates a new flow with one or more actions, installs dependencies, builds tests and executes the resulting code.

Actions can be agents, backend functions, or cloud functions.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

name

string

Name of the flow to summarize the actions

prompt

string

The instructions for AgentBase to transform in to code

data

object

The data example or parameters for your function to work

schedule

string

The cron calendar for the function to run automatically

return

object

The data example of your expected return

model

string

The model to run for your prompt

errors

array

List or possible errors your function needs to catch

cached

boolean

It will use the last version of the function whenever is available to save time and tokens

Response

{
  "run_id": 1,
  "return": {
    "post_id":"id"
  },
  "error": null
}

Body Example


{
    "function": "crate_post",
    "prompt": "create a new post for the user",
    "data" : {
        "email": "email",
        "message": "message example"
    },
    "return" : {
        "post_id":"id"
    }
}

Last updated

Was this helpful?