Timestep AI - Durable agent execution framework with DBOS workflows, cross-language state persistence, and multi-model support for OpenAI Agents
Project description
Timestep (Python)
Python bindings for the Timestep Agents SDK. See the root README.md for the full story; this file highlights Python-specific setup.
Install
pip install timestep
Prerequisites (Python)
OPENAI_API_KEY- PostgreSQL: Set
PG_CONNECTION_URI=postgresql://user:pass@host/db
Quick start
from timestep import run_agent, RunStateStore
from agents import Agent, Session
agent = Agent(model="gpt-4.1")
session = Session()
state_store = RunStateStore(agent=agent, session_id=await session._get_session_id())
result = await run_agent(agent, input_items, session, stream=False)
if result.interruptions:
await state_store.save(result.to_state())
Cross-language resume
Save in Python, load in TypeScript with the same session_id and RunStateStore.load().
Model routing
Use MultiModelProvider if you need OpenAI + Ollama routing:
from timestep import MultiModelProvider, MultiModelProviderMap, OllamaModelProvider
provider_map = MultiModelProviderMap()
provider_map.add_provider("ollama", OllamaModelProvider())
model_provider = MultiModelProvider(provider_map=provider_map)
DBOS Workflows
Timestep supports durable agent execution via DBOS workflows. Run agents in workflows that automatically recover from crashes.
Durable Execution
from timestep import run_agent_workflow, configure_dbos, ensure_dbos_launched
from agents import Agent, OpenAIConversationsSession
configure_dbos()
ensure_dbos_launched()
agent = Agent(model="gpt-4.1")
session = OpenAIConversationsSession()
# Run in a durable workflow
result = await run_agent_workflow(
agent=agent,
input_items=input_items,
session=session,
stream=False,
workflow_id="unique-id"
)
Queued Execution
from timestep import queue_agent_workflow
handle = await queue_agent_workflow(
agent=agent,
input_items=input_items,
session=session,
priority=1,
deduplication_id="unique-id"
)
result = await handle.get_result()
Scheduled Execution
from timestep import create_scheduled_agent_workflow
await create_scheduled_agent_workflow(
crontab="0 */6 * * *", # Every 6 hours
agent=agent,
input_items=input_items,
session=session
)
Package Structure
The Python package is organized into clear modules:
core/: Core agent execution functions (run_agent,default_result_processor)core/agent_workflow.py: DBOS workflows for durable agent executionconfig/: Configuration utilities (dbos_config,app_dir)stores/: Data access layeragent_store/: Agent configuration persistencesession_store/: Session data persistencerun_state_store/: Run state persistenceshared/: Shared database utilities (db_connection,schema)guardrail_registry.py: Guardrail registrationtool_registry.py: Tool registration
tools/: Agent tools (e.g.,web_search)model_providers/: Model provider implementations (OllamaModelProvider,MultiModelProvider)models/: Model implementations (OllamaModel)
Documentation
Full docs: https://timestep-ai.github.io/timestep/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timestep-2026.0.34.tar.gz.
File metadata
- Download URL: timestep-2026.0.34.tar.gz
- Upload date:
- Size: 393.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b354312c0f6ba9c3b76b526fe2ff89ed2fc3729910c26f5287056314d9f5030
|
|
| MD5 |
1e28f429c398e6fb756eaaf97826b00d
|
|
| BLAKE2b-256 |
da43e6444fc63a5ab97c71df822d9ebe88f9b7478e4fbe3656cf35eca135e175
|
File details
Details for the file timestep-2026.0.34-py3-none-any.whl.
File metadata
- Download URL: timestep-2026.0.34-py3-none-any.whl
- Upload date:
- Size: 337.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3130720c370c71525b44b87a29d268512f7eb8f702d21f3baff57fa0f65c4bc8
|
|
| MD5 |
d4a77c024c10db1b380f824bec93ed6d
|
|
| BLAKE2b-256 |
db593eef765fd26ebbb2c47427acc08dd482cf4e58f8a6188ab7bc7d74e48eb2
|