Tech News
← Back to articles

Show HN: Pickaxe – A TypeScript library for building AI agents

read original related products more articles

Pickaxe: A Typescript library for building AI agents that scale

Pickaxe is a simple Typescript library for building AI agents that are fault-tolerant and scalable. It handles the complexities of durable execution, queueing and scheduling, allowing you to focus on writing core business logic. It is not a framework.

Everything in Pickaxe is just a function that you have written, which makes it easy to integrate with your existing codebase and business logic. You can build agents that call tools, other agents, or any other functions you define:

pickaxe.1.mp4

Not sure if Pickaxe is a good fit? Book office hours

Code Example

import { pickaxe } from "@hatchet-dev/pickaxe" ; import z from "zod" ; import { myTool1 , myTool2 } from "@/tools" ; const MyAgentInput = z . object ( { message : z . string ( ) , } ) ; const MyAgentOutput = z . object ( { message : z . string ( ) , } ) ; export const myToolbox = pickaxe . toolbox ( { tools : [ myTool1 , myTool2 ] , } ) ; export const myAgent = pickaxe . agent ( { name : "my-agent" , executionTimeout : "15m" , inputSchema : MyAgentInput , outputSchema : MyAgentOutput , description : "Description of what this agent does" , fn : async ( input , ctx ) => { const result = await myToolbox . pickAndRun ( { prompt : input . message , } ) ; switch ( result . name ) { case "myTool1" : return { message : `Result: ${ result . output } ` , } ; case "myTool2" : return { message : `Another result: ${ result . output } ` , } ; default : return myToolbox . assertExhaustive ( result ) ; } } , } ) ;

Get started

Getting started is as easy as two commands:

pnpm i -g @hatchet-dev/pickaxe-cli pickaxe create first-agent

... continue reading