Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunSearchCLI ¶
RunSearchCLI handles the "kiseki search" CLI command.
func RunSearchMessagesCLI ¶
RunSearchMessagesCLI handles the "kiseki search-msg" CLI command.
Types ¶
type MultiLayerConfig ¶
type MultiLayerConfig struct {
MinPerLayer int // floor per layer (default 50)
VecThreshold float64 // max vec distance to include (default 1.5)
FTSRankThreshold float64 // unused for now, reserved for future rank filtering
AsOf string // optional date filter for chunks (ISO date string)
}
MultiLayerConfig holds tuning knobs for the pipeline.
func DefaultMultiLayerConfig ¶
func DefaultMultiLayerConfig() MultiLayerConfig
DefaultMultiLayerConfig returns sensible defaults.
type MultiLayerResult ¶
type MultiLayerResult struct {
Type string `json:"type"` // "chunk", "message", "stone"
ID string `json:"id"` // chunk ID (as string) or message ID or stone ID
Text string `json:"text"`
SourceFile string `json:"source_file,omitempty"`
SectionTitle string `json:"section_title,omitempty"`
ParentTitle string `json:"parent_title,omitempty"`
HeaderLevel int `json:"header_level,omitempty"`
ValidAt string `json:"valid_at,omitempty"`
SessionID string `json:"session_id,omitempty"`
Role string `json:"role,omitempty"`
Timestamp int64 `json:"timestamp,omitempty"`
Importance string `json:"importance"`
Distance float64 `json:"distance"` // lower = better; 0 for exact/stone
Layers int `json:"layers"` // how many search layers found this (1, 2, or 3)
LayerSources []string `json:"layer_sources"` // e.g. ["fts5","vec_messages"]
IsStone bool `json:"is_stone,omitempty"`
StoneID string `json:"stone_id,omitempty"`
StoneTitle string `json:"stone_title,omitempty"`
StoneCategory string `json:"stone_category,omitempty"`
}
MultiLayerResult is the unified result type — can be chunk, message, or stone.
func MultiLayerSearch ¶
func MultiLayerSearch(db *sql.DB, embedder ollama.Embedder, query string, cfg MultiLayerConfig) ([]MultiLayerResult, error)
MultiLayerSearch runs the 3-layer parallel search pipeline: entity expansion → stones → (FTS5 + vec_chunks + vec_messages in parallel) → merge + rank.
Click to show internal directories.
Click to hide internal directories.