orchestrator

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package orchestrator implements Genie's request routing and execution flow: it receives user messages, classifies intent (simple vs complex), runs the appropriate expert(s), and coordinates ReAcTree multi-step workflows.

It solves the problem of connecting the messenger layer to the agent layer: the orchestrator owns the conversation loop, injects skills/memory, applies HITL and clarification flows, and streams AG-UI events to the client. Without this package, there would be no single place that ties config, tools, experts, and execution together.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeQuestion

type CodeQuestion struct {
	Question string `json:"question"`

	// SkipClassification when true skips front-desk classification and runs
	// the request as COMPLEX. Used for internal tasks (e.g. graph learn) that
	// would otherwise be misclassified as REFUSE.
	SkipClassification bool `json:"-"`

	// Attachments holds file/media attachments from the incoming message.
	// Image attachments are passed as multimodal content to the LLM so it
	// can "see" them; other types are described textually.
	Attachments []messenger.Attachment `json:"-"`

	// BrowserTab is an optional context for a specific browser tab.
	// If provided, browser tools will use this context.
	BrowserTab context.Context `json:"-"`
}

type Orchestrator

type Orchestrator interface {
	Chat(ctx context.Context, req CodeQuestion, outputChan chan<- string) error
	InjectFeedback(ctx context.Context, message string) error
	Close() error
	Resume(ctx context.Context) string
}

Orchestrator is an expert that can answer users questions

func NewOrchestrator

func NewOrchestrator(
	ctx context.Context,
	modelProvider modelprovider.ModelProvider,
	availableTools *tools.Registry,
	vectorStore vector.IStore,
	auditor audit.Auditor,
	approvalStore hitl.ApprovalStore,
	memorySvc memory.Service,
	sessionSvc session.Service,
	agentPersona string,
	extraOpts ...OrchestratorOption,
) (Orchestrator, error)

type OrchestratorOption

type OrchestratorOption func(*orchestratorOpts)

NewOrchestrator creates a new orchestrator with an integrated ReAcTree executor. The working memory persists across chat turns, allowing the agent to share observations from previous interactions. The tree executor enables hierarchical task decomposition for complex queries when activated. The approvalStore enables HITL approval gating for sub-agent tool calls; when nil, sub-agents execute tools without requiring human approval. OrchestratorOption configures optional behaviour on the orchestrator.

func WithDisableResume added in v0.1.7

func WithDisableResume(disable bool) OrchestratorOption

WithDisableResume sets whether to disable the dynamic generation of the agent's resume.

func WithHalGuardConfig added in v0.1.7

func WithHalGuardConfig(cfg halguard.Config) OrchestratorOption

WithHalGuardConfig sets the hallucination guard configuration. When not provided, halguard.DefaultConfig() is used.

func WithSemanticRouter added in v0.1.7

func WithSemanticRouter(router semanticrouter.IRouter) OrchestratorOption

WithSemanticRouter sets the semantic router instance for fast embedding-based routing and caching.

func WithToolwrapOptions

func WithToolwrapOptions(opts ...toolwrap.ServiceOption) OrchestratorOption

WithToolwrapOptions passes per-agent middleware configuration to the underlying toolwrap.Service. Use this to enable rate limiting, tracing, retries, timeouts, etc. on a per-agent basis.

Directories

Path Synopsis
Package orchestratorcontext provides context-scoped access to the running agent's identity.
Package orchestratorcontext provides context-scoped access to the running agent's identity.
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL