indexer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package indexer syncs the knowledge file store into the SQLite index. Files are truth: the sync is one-directional and idempotent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbedMissing

func EmbedMissing(ctx context.Context, s *store.Store, e embed.Embedder, model string) (int, error)

EmbedMissing computes vectors for every card lacking a fresh one (new card, changed content, or model switch). Returns the number embedded. A dead Ollama is an error for the CALLER to classify: `culi index` prints it, SessionStart logs and moves on — BM25 keeps working either way.

Types

type Result

type Result struct {
	Upserted int
	Deleted  int
	Skipped  []string // relPaths that failed to parse (logged, not fatal)
}

Result summarizes one sync run.

func Full

func Full(ctx context.Context, s *store.Store, knowledgeDir string) (Result, error)

Full drops the index and re-syncs everything from files.

func Sync

func Sync(ctx context.Context, s *store.Store, knowledgeDir string) (Result, error)

Sync walks knowledgeDir and reconciles the index: changed files (by mtime/size, then content hash) are re-parsed and upserted; vanished files are deleted. A single bad card is skipped, never fatal.

Jump to

Keyboard shortcuts

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