- Instrument: The SDK hooks into your LLM client libraries and captures every call, tool call, input, and output as an OpenTelemetry span.
- Collect: Spans are batched and sent to the Belvedir platform via the OTLP HTTP protocol, tagged with the session id from
withSession. - Segment: Once a session goes quiet, an LLM reads the full transcript and splits it into the discrete tasks the agent performed, each with a title, summary, tool calls, and outcome.
- Gather: Each task is embedded and gathered with other tasks of the same type into a training set, so you can see how often each kind of task runs and how it performs over time.
- Clean: A periodic pass keeps your training sets clean: it merges duplicates, splits overbroad ones, and renames unclear labels. Every operation it considers is recorded on the platform’s Cleaning log.
- Optimize: Run Analysis on a project evolves your agent’s code against its own production traces. By default the proposed changes wait for your review: inspect the per-file diff on Training History, then approve to open a GitHub PR or reject. Autonomy is chosen per loop in the Training section’s setup wizard; switch a loop to Auto-PR to skip the review step for that loop. See Optimization Loops for how the loops work, and connect the Belvedir GitHub App under Account settings → Integrations so the optimizer can open PRs on your repos.
Get Started
How Belvedir Works
The six-stage pipeline Belvedir uses: instrument, collect, segment, gather, clean, and optimize.