Skip to content

Observability

import { SqliteTracer } from '@polymatx/weave';
const tracer = new SqliteTracer('./weave.sqlite');
await flow.run({
initialState,
onEvent: (e) => tracer.record(e),
});

Every emitted TraceEvent is written to the SQLite file. The trace UI reads from the same file:

Terminal window
npx @polymatx/weave-ui --db ./weave.sqlite --port 4321
# open http://localhost:4321
EventWhen it fires
run.startGraph run begins
node.startNode entered
node.endNode returned a patch
agent.callAn LLM call completed (carries token usage, cost USD)
tool.callAn agent tool was invoked
token.deltaA streaming agent emitted a chunk
run.endGraph reached END
run.errorRun aborted or threw
const runs = tracer.listRuns(50);
const events = tracer.getEvents(runId);

Useful for building custom dashboards or wiring weave traces into your own ETL.