This template provides a starting point for creating AI agents using the Bitte Protocol with Next.js. It includes pre-configured endpoints and tools that demonstrate common agent functionalities.
- 🤖 Pre-configured AI agent setup
- 🛠️ Built-in tools and endpoints:
- Blockchain information retrieval
- NEAR transaction generation
- Reddit frontpage fetching
- Twitter share intent generation
- Coin flip functionality
- ⚡ Next.js 14 with App Router
- 🎨 Tailwind CSS for styling
- 📝 TypeScript support
- 🔄 Hot reload development environment
- Clone this repository
- Configure environment variables (create a
.envor.env.localfile)
# Get your API key from https://key.bitte.ai
BITTE_API_KEY='your-api-key'
ACCOUNT_ID='your-account.near'- Install dependencies:
pnpm install- Start the development server:
pnpm run devThis will:
- Start your Next.js application
- Launch make-agent
- Prompt you to sign a message in Bitte wallet to create an API key
- Launch your agent in the Bitte playground
- Allow you to freely edit and develop your code in the playground environment
- Build the project locally:
pnpm run build:devThis will build the project and not trigger make-agent deploy
- using just
buildwill trigger make-agent deploy and not work unless you provide your deployed plugin url using the-uflag.
The template includes several pre-built tools:
- Endpoint:
/api/tools/get-blockchains - Returns a randomized list of blockchain networks
- Endpoint:
/api/tools/create-near-transaction - Creates NEAR transaction payloads for token transfers
- Endpoint:
/api/tools/create-evm-transaction - Creates EVM transaction payloads for native eth transfers
- Endpoint:
/api/tools/twitter - Generates Twitter share intent URLs
- Endpoint:
/api/tools/coinflip - Simple random coin flip generator
- Endpoint:
/api/tools/get-user - Returns the user's account ID
The template includes a pre-configured AI agent manifest at /.well-known/ai-plugin.json. You can customize the agent's behavior by modifying the configuration in /api/ai-plugins/route.ts. This route generates and returns the manifest object.
- Push your code to GitHub
- Deploy to Vercel or your preferred hosting platform
- Add your
BITTE_API_KEYto the environment variables - The
make-agent deploycommand will automatically run during build
Whether you want to add a tool to this boilerplate or make your own standalone agent tool, here's you'll need:
- Make sure
make-agentis installed in your project:
pnpm install --D make-agent- Set up a manifest following the OpenAPI specification that describes your agent and its paths.
- Have an api endpoint with the path
GET /api/ai-pluginthat returns your manifest
Follow the OpenAPI Specification to add the following fields in the manifest object:
openapi: The OpenAPI specification version that your manifest is following. Usually this is the latest version.info: Object containing information about the agent, namely its 'title', 'description' and 'version'.servers: Array of objects containing the urls for the deployed instances of the agent.paths: Object containing all your agent's paths and their operations."x-mb": Our custom field, containing the account id of the owner and an 'assistant' object with the agent's metadata, namely the tools it uses, and additional instructions to guide it.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License