Build a use case

Ready to build your own use case? Let's go over what that entails and then dive deeper into each step.

  1. Decide what to build

  2. Plan it

    1. Map out your desired flow

    2. Translate that flow into business logic

    3. Identify the resources and tools you will need to make that happen

  3. Provision resources and create new ones where necessary

Decide what to build

First, find an operational problem that you want to solve or process to offload to your AI Teammates.

Plan it

It helps to start with the end-user experience that you have in mind. Doing so gives you a clear goal and point-of-reference that can be helpful later on when you're deep in implementation details.

Once you have the end-user experience mapped out, it's time to think practically about what that means from a business logic perspective. In other words, what is the business logic that the end-user experience implies?

Finally, once you have mapped out the business logic, use it to identify the implied entities and break down the business logic into atomic functionalities. Together, these will help inform you of the Kubiya resources and tools you need for your use case.

Provision resources. Create new ones where necessary.

Depending on the resources and tools you identified, you should provision them in Kubiya. For example, if it requires a webhook, then you will need to create one.

Here's how you can do it in Terraform:

terraform {
    required_providers {
      kubiya = {
        source = "kubiya-terraform/kubiya"
      }
    }
}

provider "kubiya" {
  //Your Kubiya API Key will be taken from the 
  //environment variable KUBIYA_API_KEY
  //To set the key, please use export KUBIYA_API_KEY="YOUR_API_KEY"
}

resource "kubiya_webhook" "webhook" {
  //mandatory fields
  //Please specify a unique name to identify this webhook
  name = "tf-webhook"
  //Please specify the source of the webhook - e.g: 'pull request opened on repository foo'
  source = "Github"
  //Provide AI instructions prompt for the agent to follow upon incoming webhook. use {{.event.}} syntax for dynamic parsing of the event
  prompt = "send john.doe@kubiya.ai a summary of all pull requests created in API-GW repo based on the commits and add the link of the pull request to the message"
  //Select an Agent which will perform the task and receive the webhook payload
  agent = kubiya_agent.my_agent.name
  //Please provide a destination that starts with `#` or `@`
  destination = "john.doe@domain.ai"
  //optional fields
  //Insert a JMESPath expression to filter by, for more information reach out to https://jmespath.org
  filter = ""
}

output "webhook" {
  value = kubiya_webhook.webhook
}

Tools

Regarding the tools it requires, first check the Kubiya Community Tools repository to see if there are existing tools that can be used. If there are any other tools you need, you can easily build them yourself using the Kubiya SDK. Be sure to reference the tools in the Kubiya Community Tools repo as examples to help you.

Last updated