AgentEngine.TrendHints (agent_engine v0.2.0)

Copy Markdown View Source

Tracks response-quality trajectory within a session.

The public engine keeps this generic: it scores recent iterations and produces lightweight corrective hints when quality appears to be slipping or oscillating.

Summary

Functions

Analyze recent quality trajectory.

Build a contextual hint entry from the current trend pattern.

Add a quality score to the session history.

Derive a score from tool results.

Functions

analyze(session)

@spec analyze(map()) :: {atom(), map()}

Analyze recent quality trajectory.

hint_entry(session, content_fn \\ nil)

@spec hint_entry(map(), (atom(), map() -> String.t() | nil) | nil) ::
  CommBus.Entry.t() | nil

Build a contextual hint entry from the current trend pattern.

record(session, score)

@spec record(map(), integer()) :: map()

Add a quality score to the session history.

Convention:

  • 1 positive iteration
  • 0 neutral iteration
  • -1 negative iteration

score_iteration(results)

@spec score_iteration(list()) :: integer()

Derive a score from tool results.