Agent tools
What are Agent Tools?
Agent Tools let you define specific actions and functions for your Duckie agents to perform. They are API endpoints that can be embedded into the Duckie response process to perform company-specific tasks.
Common tools include connecting to internal logging systems, gathering user data from dashboards and databasaes, creating engineering tickets, and more.
Adding Agent Tools to Duckie
Steps
To create an Agne Tool:
- Create an API endpoing – Define endpoints for data retrieval and processing (i.e. using FastAPI).
- Deploy the API – Use Docker, Railway, Fly.io, or AWS to make it publicly accessible.
- Add it to Duckie’s Agent Tool – Input the APIs to Duckie’s agent tools, and give it detailed description on when this API/tool shall be invoked.
For a live demonstration of creating a new Agent Tool, see the following Loom Video
Example: Build and Deploy an API Wrapper for Datadog
- Create the API wrappers
- Retrieve a container ID using a
caller_id
. - Fetch logs based on the container ID, filtering with specific keywords.
- Retrieve a container ID using a
- Deploy the API for external use and expose it publicly.
1. Setup and Prerequisites
Install Dependencies
Ensure you have Python installed, then install the required packages:
3. Deploying the API
Option 1: Deploy with Docker
Create a Dockerfile
:
Build and run locally:
Option 2: Deploy on Railway or Fly.io (Easiest)
For Railway:
For Fly.io:
Option 3: Deploy on AWS with API Gateway for Public Access
- Deploy FastAPI as an AWS Lambda function with API Gateway.
- Use
Mangum
to convert FastAPI into an AWS Lambda-compatible app. - Open API Gateway settings and enable public access.
Modify api.py:
Then deploy using AWS SAM or Terraform.
4. Add it to Duckie’s Agent Tool
Next, you will input the APIs to Duckie’s agent tools, and give it detailed description on when this API/tool shall be invoked.
Here’s a loom video on the setup: https://www.loom.com/share/d189881c1dc34b388697ae60e6948134?sid=acdefd34-59d2-4cf0-a57f-028754d21b9a