Skip to content

This repository demonstrates how to build a functional AI coding agent using Claude and the Anthropic API. Following Thorsten Ball's original Go implementation, this TypeScript version shows how agents are just LLMs with the right tools in a conversation loop.

Notifications You must be signed in to change notification settings

ivanleomk/building-an-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building An Agent

Accompanying code for Building An Agent - implementing a coding agent in TypeScript.

This repository demonstrates how to build a functional AI coding agent using Claude and the Anthropic API.

Following Thorsten Ball's original Go implementation, this TypeScript version shows how agents are just LLMs with the right tools in a conversation loop.

What's Included

Article 1: Building An Agent - We build a complete coding agent in around 200 lines of TypeScript that can read, create, edit, and list files by giving Claude four simple tools with clear descriptions. The agent maintains conversation context and naturally combines tools to solve complex tasks like refactoring code or creating new projects. (Commit 3c9b2c2)

Article 2: Migrating to React Ink - We migrate our basic coding agent to use React Ink for an interactive CLI with streaming responses and real-time updates. This enhances the user experience with a richer terminal interface while integrating file system tools for reading, writing, editing, and listing files. (Commit 4e9f0ac)

Article 3: Agentic Search : This is on the way! We show how to use things like grep and glob to search for files and code in the agent's file system so that our model can find relevant information quickly and efficiently.

Getting Started

git clone https://github.com/ivanleomk/building-an-agent
cd building-an-agent
bun install
export ANTHROPIC_API_KEY="your-key-here"
bun agent.ts

About

This repository demonstrates how to build a functional AI coding agent using Claude and the Anthropic API. Following Thorsten Ball's original Go implementation, this TypeScript version shows how agents are just LLMs with the right tools in a conversation loop.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published