Documentation
¶
Overview ¶
Package orchestration implements the deterministic statistics-research workflow as two composed loops, following the org's Loop Engineering REAL/VEAL patterns (see productbuildershq.github.io's loop-engineering framework doc):
REAL (Read -> Evaluate -> Act -> Loop): the outer discovery loop. Mission-driven — "find at least MinVerifiedStats statistics about Topic" — with a single actor per round (search, then extract). It reads how many verified statistics exist so far, evaluates the shortfall against the target, acts by running a discovery round (excluding domains that previous rounds already rejected), and loops until the mission is complete or realMaxAttempts is exhausted.
VEAL (Validate -> Evaluate -> Act -> Loop): the inner verification loop, run on each batch the REAL loop produces. A read-only validator (the verification agent, plus a local aggregator-source check) checks each candidate and reports GO/NO-GO with a reason. For fixable NO-GO reasons, a separate actor attempts a targeted correction — never a blind retry — before the batch is re-validated. Bounded by vealMaxAttempts; whatever doesn't converge is explicitly rejected, never silently kept or silently dropped from the count.
REAL creates the candidate pool; VEAL converges it to verified-or-rejected. If VEAL rejects enough that the round falls short, that shortfall is what drives the next REAL iteration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EinoOrchestrationAgent ¶
type EinoOrchestrationAgent struct {
// contains filtered or unexported fields
}
EinoOrchestrationAgent uses the Eino framework for the deterministic discovery step (Research -> Synthesis), with the REAL and VEAL loops implemented as bounded Go control flow around it — Eino's graph gives compile-time-typed steps within a round; the loops decide how many rounds to run and how to react to what a round finds.
func NewEinoOrchestrationAgent ¶
func NewEinoOrchestrationAgent(cfg *config.Config, logger *slog.Logger) *EinoOrchestrationAgent
NewEinoOrchestrationAgent creates a new Eino-based orchestration agent.
func (*EinoOrchestrationAgent) HandleOrchestrationRequest ¶
func (oa *EinoOrchestrationAgent) HandleOrchestrationRequest(w http.ResponseWriter, r *http.Request)
HandleOrchestrationRequest is the HTTP handler for the orchestration endpoint.
func (*EinoOrchestrationAgent) Orchestrate ¶
func (oa *EinoOrchestrationAgent) Orchestrate(ctx context.Context, req *models.OrchestrationRequest) (*models.OrchestrationResponse, error)
Orchestrate runs the REAL discovery loop. Each round produces a batch of candidates via the discovery graph, then hands that batch to the VEAL verification loop before counting anything toward the target.
type ResearchState ¶
type ResearchState struct {
Request *models.OrchestrationRequest
SearchResults []models.SearchResult
}
State types for the discovery graph.
type SynthesisState ¶
type SynthesisState struct {
Request *models.OrchestrationRequest
SearchResults []models.SearchResult
Candidates []models.CandidateStatistic
}