model

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const FallbackCategory = "notes"

FallbackCategory is used when the LLM returns a category not in the predefined set. "notes" is intentionally chosen as the catch-all.

Variables

View Source
var Categories = []Category{
	{Name: "credentials", Description: "API keys, tokens, passwords, secrets, access keys"},
	{Name: "commands", Description: "CLI commands, bash one-liners, terminal shortcuts you'd reuse"},
	{Name: "snippets", Description: "Code, config, queries, and other small reusable text blocks"},
	{Name: "decisions", Description: "Architecture / tech / process decisions and the reasoning behind them"},
	{Name: "runbooks", Description: "Multi-step procedures, how-tos, deploy / incident playbooks"},
	{Name: "learnings", Description: "TILs, gotchas, debugging insights, lessons from incidents"},
	{Name: "references", Description: "URLs, documentation links, dashboards, resource pointers"},
	{Name: "contacts", Description: "People, emails, Slack handles, on-call rotations"},
	{Name: "notes", Description: "General notes, todos, reminders, anything that doesn't fit above"},
}

Categories is the strict, predefined set of note categories. The LLM must pick from this list — values outside it are rejected by the classifier and fall back to FallbackCategory.

Adding a category here is a deliberate act: existing notes don't get reclassified, and a category that overlaps too much with another one produces noise in retrieval.

Functions

func IsValidCategory

func IsValidCategory(name string) bool

IsValidCategory reports whether name is one of the predefined categories. The check is case-insensitive but exact otherwise — partial matches are rejected (e.g. "credential" → false).

Types

type Category

type Category struct {
	Name        string
	Description string
}

type Note

type Note struct {
	ID           string
	UserID       string // empty in Phase 1 (local, single-user)
	ContentEnc   []byte // iv[12] + gcm_sealed[N]; nil if not sensitive
	ContentPlain string // empty if sensitive
	Summary      string // LLM-generated one-liner
	Category     string // see Categories below — strict, validated via IsValidCategory
	Tags         []string
	IsSensitive  bool
	Embedding    []float32 // voyage-3: 1024 dims
	CreatedAt    time.Time
	UpdatedAt    time.Time

	// Distance is the L2 distance from the query vector when this note was
	// returned by a similarity search. 0 if not from a search. Not persisted.
	Distance float32
}

Jump to

Keyboard shortcuts

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