edge-pi

edge-pi is a lightweight, Vercel AI SDK-based coding agent library and CLI. It provides the core primitives for building AI-powered coding assistants with tool support, session management, and context compaction.

What is edge-pi?

edge-pi consists of two packages that work together to provide a complete coding agent experience:

Key Features

Quick Example

import { CodingAgent } from "edge-pi";
import { anthropic } from "@ai-sdk/anthropic";

const agent = new CodingAgent({
  model: anthropic("claude-sonnet-4-20250514"),
});

const result = await agent.generate({
  prompt: "Read the README.md and summarize it",
});

console.log(result.text);

See the Quick Start guide to get up and running.

Architecture

edge-pi is designed as a thin, composable layer on top of the Vercel AI SDK. The core CodingAgent class wraps the SDK's tool loop with sensible defaults for coding tasks:

CodingAgent
├── Vercel AI SDK (generateText / streamText)
├── Tool sets (coding, readonly, all)
├── System prompt builder
├── Message steering queue
├── Session persistence (JSONL)
└── Context compaction

Packages

PackageDescriptionInstall
edge-piSDK — agent, tools, sessions, compactionnpm install edge-pi
edge-pi-cliCLI — interactive terminal agentnpm install -g edge-pi-cli