kbsearch: Go implementation with daemon model serving
- New nested module bin/kbsearch with Go implementation of bin/kb/search - Embedding model (potion-multilingual-128M) served by localhost daemon so repeated CLI calls reuse the loaded model - Bash launcher bin/kb/search builds binary on first run, caches to var/bin/ - Hybrid FTS + vector search (RRF k=60) matching Python kblib behavior - YAML output via port of yamlout.py (ordered keys, same format) - JSON output with proper field order - All flags: --root, --repo, -n, --json, --list-model - Root go.mod reverted to 1.25.0 (kbsearch is isolated nested module) - CI passes: go test ./... and go vet ./... unaffected by kbsearch
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// Common types and helpers for kbsearch.
|
||||
package main
|
||||
|
||||
import "os"
|
||||
|
||||
func eps() string { return os.Getenv("KBTEST_EPS") }
|
||||
|
||||
// Hit is one search result, mirroring the python script's dict shape.
|
||||
type Hit struct {
|
||||
ID string `json:"id"`
|
||||
Text string `json:"text"`
|
||||
Root string `json:"root"`
|
||||
Source string `json:"-"` // for repo filtering, not in output
|
||||
Score float64 `json:"score"`
|
||||
Snippet string `json:"snippet,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user