Documentation
¶
Overview ¶
Package decision implements the research decision layer. It owns intent, query planning, gap detection, follow-up planning, and the bounded research loop while delegating retrieval and evidence processing to lower layers.
Index ¶
- type AdvisedQuery
- type Advisor
- type AdvisorUsage
- type Agent
- type Budget
- type Claim
- type ClaimReview
- type ClaimVerification
- type ClaimVerificationRequest
- type DefaultFollowUpPlanner
- type DefaultGapDetector
- type DefaultIntentAnalyzer
- type DefaultKnowledgeSynthesizer
- type DefaultQueryPlanner
- type EvidencePipeline
- type FollowUpPlanner
- type Gap
- type GapDetector
- type Intent
- type IntentAnalyzer
- type KnowledgeSynthesizer
- type Outcome
- type Plan
- type PlanAdvice
- type PlanAdviceRequest
- type Progress
- type QueryPlanner
- type ResearchCache
- type RunOptions
- type SearchSystem
- type Source
- type StructuredResult
- type Task
- type Usage
- type ValuablePage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvisedQuery ¶
type Advisor ¶
type Advisor interface {
RefinePlan(context.Context, PlanAdviceRequest) (PlanAdvice, error)
VerifyClaims(context.Context, ClaimVerificationRequest) (ClaimVerification, error)
}
Advisor adds model-assisted planning and verification to the deterministic research loop. Its output is always validated against runtime budgets and collected source IDs before it can affect execution.
type AdvisorUsage ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func NewAgent ¶
func NewAgent(search SearchSystem, pipeline EvidencePipeline, cache ResearchCache) *Agent
func (*Agent) Run ¶
Run executes an adaptive search loop. Runtime limits, rather than an LLM, are authoritative for cancellation, timeouts, and maximum work.
func (*Agent) RunWithOptions ¶
func (a *Agent) RunWithOptions(ctx context.Context, task Task, budget Budget, options RunOptions) (Outcome, error)
RunWithOptions executes V3 model-assisted research while keeping the deterministic planner, evidence pipeline, and runtime budget authoritative.
type Budget ¶
type Budget struct {
MaxQueries int
MaxPages int
MaxRounds int
ResultsPerQuery int
MaxContextChars int
MaxDuration time.Duration
CacheTTL time.Duration
NewsCacheTTL time.Duration
}
func DefaultBudget ¶
func DefaultBudget() Budget
type ClaimReview ¶
type ClaimVerification ¶
type ClaimVerification struct {
Reviews []ClaimReview `json:"reviews"`
Usage AdvisorUsage `json:"-"`
}
type DefaultFollowUpPlanner ¶
type DefaultFollowUpPlanner struct{}
type DefaultGapDetector ¶
type DefaultGapDetector struct{}
type DefaultIntentAnalyzer ¶
type DefaultIntentAnalyzer struct{}
func (DefaultIntentAnalyzer) Analyze ¶
func (DefaultIntentAnalyzer) Analyze(task Task) Intent
type DefaultKnowledgeSynthesizer ¶
type DefaultKnowledgeSynthesizer struct{}
func (DefaultKnowledgeSynthesizer) Synthesize ¶
func (DefaultKnowledgeSynthesizer) Synthesize(report evidence.Report, gaps []Gap, usage Usage, stopReason string) StructuredResult
type DefaultQueryPlanner ¶
type DefaultQueryPlanner struct{}
type EvidencePipeline ¶
type EvidencePipeline interface {
Merge(evidence.Request, evidence.Report, searchsystem.RoundResult, int) evidence.Report
}
type FollowUpPlanner ¶
type Intent ¶
type Intent struct {
Kind string
Topic string
NeedsFreshness bool
NeedsAuthority bool
NeedsComparison bool
PreferredSource []searchsystem.SourceKind
}
type IntentAnalyzer ¶
type KnowledgeSynthesizer ¶
type Outcome ¶
type Outcome struct {
Plan Plan
Report evidence.Report
Result StructuredResult
Attempted []searchsystem.Query
Observations []searchsystem.Observation
Failures []string
FromCache bool
}
type Plan ¶
type Plan struct {
Intent Intent
Queries []searchsystem.Query
}
type PlanAdvice ¶
type PlanAdvice struct {
Queries []AdvisedQuery `json:"queries"`
Usage AdvisorUsage `json:"-"`
}
type PlanAdviceRequest ¶
type ResearchCache ¶
type RunOptions ¶
type SearchSystem ¶
type SearchSystem interface {
ExecuteRound(context.Context, []searchsystem.Query, []string, int, int, int) (searchsystem.RoundResult, error)
}
type StructuredResult ¶
type ValuablePage ¶
type ValuablePage struct {
ID string
Rank int
Title string
URL string
Domain string
Provider string
Kind string
Snippet string
ValueSignals []string
Authority float64
Relevance float64
Freshness float64
EvidenceScore float64
Fetched bool
PublishedAt string
}
ValuablePage is the bounded, UI-safe description of a page that contributed evidence. Raw page content never crosses the progress protocol boundary.