# pi · Embedding interfaces

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [pi](https://ai-agents-review.com/runtime/pi.md)
- Column: [Embedding interfaces](https://ai-agents-review.com/column/embedding-interfaces.md) (Product integration)
- Mark: 4 s
- Default deployment: 4
- Best supported configuration: 4
- Page: https://ai-agents-review.com/cell/pi/embedding-interfaces

## Rationale

In-process `createAgentSession` (with customTools) plus RPC JSONL with prompt/steer/follow_up/abort/fork; typed events

## Rubric criteria for this column

- 0: Interactive UI only
- 1: Non-interactive CLI with text or JSON output only (scraping)
- 2: One supported programmatic interface (library **or** protocol) with an event stream, marked experimental or covering only part of the session lifecycle
- 3: Supported programmatic interface with typed events **and** session lifecycle control (start, follow-up/steer, interrupt, resume)
- 4: Level 3, plus host callbacks for approvals or host-executed tools **and** two or more transports or bindings (e.g. in-process plus network protocol)

## Review finding

Built in: in-process TypeScript SDK (`createAgentSession`); `--mode rpc` JSONL over stdin/stdout (about 40 commands) plus `json` event mode and print mode; lower-level agent-core and provider libraries. No HTTP, WS, ACP or MCP server in the CLI. [alt: p3 app — HTTP on loopback, unix sockets]. [I106][I107][I108][I109]

## Evidence cited by the mark

- [I106] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/core/sdk.ts#L48-L191 — `createAgentSession` in-process SDK — [S]
- [I107] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/modes/rpc/rpc-mode.ts#L409-L690 — RPC command switch (prompt, steer, follow_up, abort, compact, fork, bash…) — [S]
- [I108] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/cli/args.ts#L140-L143 — `--mode text|json|rpc` — [S]

## Evidence also cited by the review finding

- [I109] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/apps/p3/src/server.ts#L135-L170 — [alt: p3] loopback HTTP server — [S] (per sub-audit)

## Grading record

- Grader A (default / best): 4 / 4
- Grader B (default / best): 4 / 4
