createAgent
createAgent is the high-level entrypoint for chat orchestration.
Minimal usage
Pass sessionId per request when you want analytics/tracing correlation across requests.
Workflow source resolution
createAgent can resolve workflows from:
workflowRegistryworkflowsworkflowsDir- fallback default:
./src/workflows
Only one of workflowRegistry, workflows, or workflowsDir is allowed in the same config.
Config knobs
Useful fields in CreateAgentArgs:
workflows/workflowRegistry/workflowsDirdefaultWorkflowIdframeworkAdaptergetProvider(advanced: custom provider registry lookup)
Good to know:
createAgent(...)does not manage business/data persistence for your app. Use your own DB or service clients inside node code, and use framework adapters only for runtime persistence such as interrupt/resume.
Result object:
agent.streamChat(...): returnsAsyncIterable<StreamChunk>(best for custom route handling)