smartquery

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classification

type Classification struct {
	Raw        string   // original user query
	Intent     Intent   // inferred high-level intent
	IsQuestion bool     // true if the query looks like a question
	HasURL     bool     // true if the query appears to contain a URL
	Keywords   []string // optional list of detected intent keywords
}

Classification is the internal result of query analysis.

func Classify

func Classify(query string) Classification

Classify analyzes a natural-language query and returns an internal classification. It uses simple heuristics and keyword patterns and does not perform any network calls.

type Intent

type Intent string

Intent represents the high-level intent of a query.

const (
	IntentUnknown       Intent = "unknown"
	IntentGeneralSearch Intent = "general_search"
	IntentLookup        Intent = "lookup"
	IntentNews          Intent = "news"
	IntentDocs          Intent = "docs"
	IntentCodeHelp      Intent = "code_help"
	IntentRSS           Intent = "rss"
	IntentHackerNews    Intent = "hackernews"
	IntentGitHub        Intent = "github"
)

type Route

type Route struct {
	Intent          Intent
	PrimarySources  []string
	FallbackSources []string
	UseLookup       bool
	UseSearchIndex  bool
	UseOpenAPIs     bool
	UseFeeds        bool
	UsePlugins      bool
}

Route describes which logical Aether sources should be consulted to answer a query. The names here are abstract and correspond to internal modules or plugins (e.g. "lookup", "wikipedia", "rss").

func BuildRoute

func BuildRoute(c Classification) Route

BuildRoute constructs a routing plan based on the classification.

Jump to

Keyboard shortcuts

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