@agentprodready/agent-framework
v1.7.0
Published
TypeScript agent orchestration entrance (createAgent, createTeam) — durable memory/HITL/stream replay when you need them. Production-oriented architecture, young ecosystem — not a graph DSL.
Maintainers
Readme
@agentprodready/agent-framework
TypeScript agents you can ship this week — with a clean path to production controls when you need them.
Production-oriented architecture with a young ecosystem.
Simple Agent API: createAgent · createTeam · createWorkflow · createOrchestrator · handoff · reference() · openai() · openaiCompatible() · anthropic() · gemini() · tool() · inMemory() · fileMemory() · postgresMemory() · invoke() · stream() · replayStream() · approve() · reject() · resume() · close()
What this package is: an agent + team + Runtime execution entrance — not a graph DSL. Full evaluator FAQ: What is AgentProdReady?.
| Question | Short answer |
|---|---|
| Core abstraction | createAgent / createTeam over Runtime — not LangGraph-style graphs |
| Durable state | Runtime checkpoints; fileMemory / postgresMemory; HITL park/resume; stream replay (memory: true stays ephemeral) |
| Retries / idempotency / HITL | Runtime owns retries; tool idempotency + ledger; approve / reject / resume |
| Provider routing | Simple helpers pick one model; hosts use Capability Resolution failover |
| “Production ready” | Architecture for production controls; young ecosystem — not a huge-fleet claim |
Guides: What is AgentProdReady? · Getting Started · Simple Diagnostics · Anthropic · Gemini · OpenAI-compatible · Simple Tools · Simple Memory · Durable Memory · HITL Approval · Stream Replay
Star / contribute: ameenmari/agentprodready
Install
npm install @agentprodready/agent-frameworkRequires Node.js >=22 <25 and an ESM project.
Scaffold:
npm create agentprodready@latest my-agentQuick start (zero secrets)
import { createAgent, reference } from "@agentprodready/agent-framework";
const agent = createAgent({
model: reference(),
instructions: "You are a helpful assistant.",
});
const result = await agent.invoke("Hello");
console.log(result.text);
await agent.close();No API key. No database. No Docker.
OpenAI
npm install @agentprodready/agent-framework @agentprodready/ai-provider-openaiimport { createAgent, openai } from "@agentprodready/agent-framework";
const agent = createAgent({
model: openai("gpt-4o-mini"),
instructions: "You are a helpful assistant.",
});
const result = await agent.invoke("Hello");
console.log(result.text);
await agent.close();Set OPENAI_API_KEY in the environment (the library does not load .env files).
OpenAI-compatible
import { createAgent, openaiCompatible } from "@agentprodready/agent-framework";
const agent = createAgent({
model: openaiCompatible({
baseUrl: "https://api.example.com/v1",
model: "llama-3.1-70b",
}),
instructions: "You are a helpful assistant.",
});Capability id openai-compatible-ai. Credentials: OPENAI_COMPATIBLE_API_KEY (never silent OPENAI_API_KEY fallback).
Anthropic
npm install @agentprodready/agent-framework @agentprodready/ai-provider-anthropicimport { createAgent, anthropic } from "@agentprodready/agent-framework";
const agent = createAgent({
model: anthropic("claude-sonnet-4-20250514"),
instructions: "You are a helpful assistant.",
});Set ANTHROPIC_API_KEY. Messages API — not openaiCompatible().
Gemini
npm install @agentprodready/agent-framework @agentprodready/ai-provider-geminiimport { createAgent, gemini } from "@agentprodready/agent-framework";
const agent = createAgent({
model: gemini("gemini-2.0-flash"),
instructions: "You are a helpful assistant.",
});Set GEMINI_API_KEY. Native Generative Language API — not openaiCompatible().
Tools
import { createAgent, reference, tool } from "@agentprodready/agent-framework";
const agent = createAgent({
model: reference(),
instructions: "You are helpful.",
tools: [
tool({
name: "getWeather",
description: "Get weather for a city",
parameters: {
type: "object",
properties: { city: { type: "string" } },
required: ["city"],
},
execute: async ({ city }) => ({ city, forecast: "sunny" }),
}),
],
});
const result = await agent.invoke('USE_TOOL:getWeather:{"city":"Paris"}');
console.log(result.text);
await agent.close();Defaults are conservative (mutating / non-idempotent). See the Simple Tools guide.
Memory
Ephemeral: memory: true ≡ inMemory() — process-local, cleared on exit.
Durable (v1.6): fileMemory({ directory }), postgresMemory({ connectionString }) — survives restart.
The reference provider is deterministic and does not perform natural-language reasoning over recalled memory. Use openai() for NL recall demos. See Simple Memory and Durable Memory.
Streaming & replay
for await (const event of agent.stream("Hello", { resumeFrom: 0 })) {
if (event.type === "text") process.stdout.write(event.text);
}
for await (const event of agent.replayStream(executionId)) {
// log-only replay
}Embedded library stream — not HTTP SSE. See Stream Replay.
HITL
approve(approvalId), reject(approvalId), resume(executionId) for approval-required tools. See HITL Approval.
Diagnostics
Successful invoke results include result.metadata (provider, modelId, durationMs, tools counts, optional memory). See Simple Diagnostics.
Production path
When you outgrow the weekend path: embed deployment · production deployment · adopting.
Simple/embedded mode is not production HTTP authentication.
Advanced APIs
This package also exports the advanced Agent Framework. Simple helpers do not deprecate it. Production multi-tenant hosts should use advanced Security, Runtime, Composition, and durable Memory/Persistence as documented in the repository.
