intent

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package intent classifies a user prompt into a coarse development intent so the auto-recall hook can pick a relevant retrieval plan (debugging pulls error context, planning pulls decisions, etc). It is deliberately cheap: lowercased keyword/substring matching over a bilingual (PT+EN) signal table, no LLM and no network, so it can run inline in a pre-prompt hook.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Intent

type Intent struct {
	Kind       Kind
	Confidence float64
	Signals    []string
}

Intent is the classification result. Confidence is a rough 0..1 score based on how many distinct signals matched (saturating), useful for gating noisy injection on weak matches. Signals lists the matched cues for debuggability.

func Detect

func Detect(prompt string) Intent

Detect classifies a prompt. Empty/whitespace or no-cue prompts return KindUnknown with zero confidence so callers can suppress noisy injection.

type Kind

type Kind string

Kind is the detected intent category.

const (
	KindPlanning      Kind = "planning"
	KindArchitecture  Kind = "architecture_decision"
	KindCodeChange    Kind = "code_change"
	KindDebugging     Kind = "debugging"
	KindTestExecution Kind = "test_execution"
	KindRelease       Kind = "release"
	KindSecurity      Kind = "security_sensitive"
	KindMemoryOp      Kind = "memory_operation"
	KindUnknown       Kind = "unknown"
)

Jump to

Keyboard shortcuts

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