Semantic Drift
Optional telemetry that surfaces whether agent responses are diverging from the conversation trajectory.
Overview
Semantic Drift measures how much the agent's recent outputs have moved away from the semantic trajectory of a conversation. If responses start drifting — picking up irrelevant context or hallucinating — the drift level rises so you can intervene.
Drift levels: unknown, low, medium, high. Requires the optional cyberloop package.
Drift telemetry is observe-only and opt-in for chat sessions. Enable it with /drift on when you intend to use OpenAI Platform API-key mode for embeddings; OpenAI account sign-in is not used for drift embeddings.
What Heddle records
- Assistant output frames are embedded and compared against the recent conversation trajectory.
- Tool outputs are excluded so drift focuses on where the agent's own responses are heading.
- The terminal footer can show drift=unknown|low|medium|high.
- Medium or high drift can be highlighted in the chat status surface.
- Trace records can include cyberloop.annotation events for later review.
When to use it
Drift is most useful during long debugging sessions, research-heavy repository exploration, or conversations where the agent may pick up irrelevant context. It is not a correctness guarantee and does not replace tests, review, or operator judgment.
Setup
npm install -g cyberloop
export OPENAI_API_KEY="your_key"
heddle --prefer-api-key
/drift on
/drift