Skip to content

Not-Sarthak/onchain-ai-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onchain AI Agent Starter Kit

A robust starter kit for building AI agents using OpenAI's Assistant API with on-chain capabilities. This toolkit provides a foundation for creating AI assistants that can interact with blockchain networks, execute smart contract functions, and handle various on-chain operations.

🌟 Features

  • Pre-configured OpenAI Assistant API setup
  • Direct blockchain interactions through Viem
  • TypeScript support for type safety

🚀 Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • TypeScript
  • An OpenAI API key
  • A wallet private key for the agent
  • Bun

Setup

  1. Fork this repository
  2. Clone your forked repository:
git clone <your-forked-repo-url>
cd onchain-ai-starter
  1. Copy the environment configuration:
cp .env.example .env
  1. Install dependencies:
bun install
  1. Start the project:
bun run start

📦 Adding New AI Agent Tools

1. Create a New Tool

Create a new tool file under src/tools/<your-tool>.ts. Follow the tool definition template:

2. Register the Tool

Import and register your tool in src/tools/allTools.ts:

import { yourTool } from './<your-tool>';

export const tools: Record<string, ToolConfig> = {
  // ... existing tools
  your_tool_name: yourTool
};

3. Update Assistant Instructions

Add your tool's description and usage instructions in src/const/prompt.ts.

🤝 Contributing

We aim to build the largest open-source on-chain agent toolkit together! Your contributions are welcome and appreciated. Whether it's:

  • Adding new tools and capabilities
  • Improving documentation
  • Fixing bugs
  • Suggesting features
  • Writing tests

Feel free to open issues and submit pull requests!

📱 Connect

Follow me on Twitter: @0xSarthak13

About

Build and deploy onchain AI agents with zero hassle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published