Building Agents
We've implemented support for plugins in our AI wallet. Plugins enable connecting tools and AI agents specifically designed for language models.
Ref Finance Tool Example
The Ref Finance Tool is a powerful example of a plugin designed to work seamlessly with our AI wallet. This tool allows users to directly interact with Decentralized Finance (DeFi) services from within the wallet interface.
Quickstart
Fork / deploy our Ref DeFi Swap Agent
With the Ref Finance Tool, users can perform swaps all without leaving the AI wallet environment.
How to add your plugin to Bitte Registry?
1. Prepare Your OpenAPI Specification
Ensure your AI plugin follows the OpenAPI Specification. See the Ref Finance Agent example here.
Here's an example of a well-structured OpenAPI Specification.
⚠️ Make sure to include the Bitte Extension.
2. Deploy Your Service
Deploy your service with a cloud provider such as Vercel, Google Cloud Platform (GCP), Amazon Web Services (AWS), or any other provider you are comfortable with. Ensure your service is publicly accessible.
Optional: Deploy Your Service During development with using make-agent (recommended) ngrok or localtunnel
Instead of deploying your service to a cloud provider, you can use ngrok or localtunnel to expose your local development server to the internet. This is particularly useful for testing and development purposes. Using make-agent
Install make-agent: install our cli tool to test you agent live on the Bitte Playground.
Set up Dynamic Plugin Manifest: server you plugin-manifest with a dynamic server URL using the url from
bitte.dev.json
(you can use next rewrites on nextjs)Add dev script:
Run dev script: run
pnpm dev:make-agent
to live test your agent on the Bitte Plyground.
Using ngrok
Install ngrok: If you haven't installed ngrok yet, you can download it from ngrok's official website.
Expose Your Local Server: Start your local server (e.g., on port 3000), then use ngrok to expose it.
This command will generate a public URL (e.g.,
https://<random-id>.ngrok.io
) that you can use to access your service over the internet.Update Plugin Manifest: Ensure that the plugin manifest file (
ai-plugin.json
) points to the ngrok URL:
Using localtunnel
Install localtunnel: You can install localtunnel globally using npm:
Expose Your Local Server: Start your local server, then use localtunnel to expose it:
This command will generate a public URL (e.g.,
https://<subdomain>.loca.lt
) for your service.Update Plugin Manifest: Make sure the plugin manifest file (
ai-plugin.json
) uses the localtunnel URL:
3. Host the Plugin Manifest
Make sure the plugin manifest file is accessible at /.well-known/ai-plugin.json
on your domain. The URL should be similar to:
4. Register Your Plugin
Register your plugin using the ai-plugins
API Reference UI.
Make sure to save the apiKey returned for managing your plugin.
To manage your plugin use the ai-plugins/PLUGIN_ID
endpoint. PLUGIN_ID
is your plugin's url without the protocol https://
i.e. ref-finance-agent.vercel.app
Pass your apiKey using the bitte-api-key
header in your request.
If not using the API Reference UI
5. Debug and Test Your Plugin
Once registered, you will receive a debug URL that will take you to the Playground to test your agent.
6. Verification
When agents are registered they will not be immediately available in the production registry. The verification process is manual for now.
Contact our team on Telegram to start the verification process when you're ready.
OpenAPI Bitte Extension
We have created an extension for the OpenAPI specification that allows you to include additional metadata.
Account ID (account-id)
• Description: Specifies the account ID associated with the plugin. This is typically the account ID on the NEAR blockchain that identifies the owner or operator of the API.
• Example: bitte.near
Assistant Configuration (assistant)
Provides the configuration for the assistant that will guide the user in interacting with the API. This section includes details about its behavior, and the tools it can use.
name
Instructions provided to the assistant define its role or behavior. This helps tailor the assistant’s responses according to specific requirements.
Example: "Weather Agent"
description
A general summary of the assistant's functionalities and tools / endpoints.
instructions
Instructions provided to the assistant define its role or behavior. This helps tailor the assistant’s responses according to specific requirements.
Example: "You are a helpful assistant. When using the get-weather tool make sure to know or ask for the user's location."
tools
A list of tools that the assistant can use. Each tool is defined by its type and possibly other configurations.
Tool Type The type of tool that the assistant can use. This can vary based on the functionality required by the API.
Tool Type | Description |
---|---|
generate-transaction | Creates a transaction based on the user request |
submit-query | Creates a GraphQL query based on Mintbase's Indexer, submits it and returns the result |
generate-image | Creates an image, uploads it to Arweave and returns a transaction hash |
create-drop | Creates an NFT drop |
Last updated