from ai_infra.replay import WorkflowRecorderRecords agent workflow steps for later replay. The recorder captures: - LLM calls (messages sent to model) - Tool calls (tool name and arguments) - Tool results (return values from tools) - Final agent responses
from ai_infra.replay import WorkflowRecorder, MemoryStorage
storage = MemoryStorage()
recorder = WorkflowRecorder("workflow_123", storage)
# Record steps as agent runs
recorder.record_llm_call([{"role": "user", "content": "Hello"}])
recorder.record_tool_call("get_weather", {"city": "NYC"})
recorder.record_tool_result("get_weather", {"temp": 72})
recorder.record_agent_response("The weather in NYC is 72°F")
# Save to storage
recorder.save()