@timestep-ai/timestep
v2026.0.57
Published
Timestep AI - Durable agent execution framework with cross-language state persistence and multi-model support for OpenAI Agents
Readme
@timestep-ai/timestep (TypeScript)
TypeScript bindings for the Timestep Agents SDK. See the root README.md for the full story; this file highlights TypeScript-specific setup.
Install
npm install @timestep-ai/timestep
# or pnpm add @timestep-ai/timestep
# or yarn add @timestep-ai/timestepPrerequisites (TypeScript)
OPENAI_API_KEY- Node 20+.
- PostgreSQL: Set
PG_CONNECTION_URI=postgresql://user:pass@host/db
Quick start
import { runAgent, RunStateStore } from '@timestep-ai/timestep';
import { Agent, Session } from '@openai/agents';
const agent = new Agent({ model: 'gpt-4.1' });
const session = new Session();
const stateStore = new RunStateStore({ agent, sessionId: await session.getSessionId() });
const result = await runAgent(agent, inputItems, session, false);
if (result.interruptions?.length) {
await stateStore.save(result.state);
}Cross-language resume
Load state saved in Python with the same sessionId and continue the run; state format is compatible.
Model routing
Prefix model names (ollama/gpt-oss:20b for local, ollama/gpt-oss:20b-cloud for Ollama Cloud) or provide a custom MultiModelProviderMap to route to your providers. Note: -cloud suffix determines cloud usage.
