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:
- edge-pi — The SDK. A TypeScript library built on the Vercel AI SDK that provides a
CodingAgentclass, file system tools, session persistence, and context compaction. - edge-pi-cli — The CLI. An interactive terminal application (
epi) that wraps the SDK with multi-provider support, authentication, skills, and both interactive and non-interactive modes.
Key Features
- Vercel AI SDK integration — Works with any Vercel AI
LanguageModel(Anthropic, OpenAI, Google, and more) - 7 built-in tools — read, write, edit, bash, grep, find, ls
- Session management — Tree-structured JSONL sessions with branching support
- Context compaction — Automatic summarization of old messages to stay within context limits
- Streaming and non-streaming — Both
stream()andgenerate()execution modes - Skills system — Extend the agent with custom instructions via Markdown files
- Multi-provider auth — API keys and OAuth for Anthropic, OpenAI, and Google
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 compactionPackages
| Package | Description | Install |
|---|---|---|
edge-pi | SDK — agent, tools, sessions, compaction | npm install edge-pi |
edge-pi-cli | CLI — interactive terminal agent | npm install -g edge-pi-cli |