Versions in this module Expand all Collapse all v0 v0.4.0 Oct 8, 2026 v0.3.0 Oct 7, 2026 Changes in this version + const EmbeddingDimension + const EmbeddingModel + const RerankerImage + const RerankerModel + const RerankerRecordFile + const SearchImage + const SearchIndex + const SearchRecordFile + const TriggerRefresh + var ErrGPUBusy = errors.New("knowledge: another model holds the GPU; indexing yields") + var ErrInvalidOption = errors.New("knowledge: invalid option") + var ErrMissingCapability = errors.New("knowledge: the knowledge service and the index are required") + func Endpoint(location docker.OwnedLocation) string + func NewOllamaEmbedder(model IEmbeddingModel) csf.Embedder + func NewOwnedReranker(state string, options ...docker.OwnedServiceOption) (*docker.OwnedService[RerankerSettings], error) + func NewOwnedSearch(state string, options ...docker.OwnedServiceOption) (*docker.OwnedService[SearchSettings], error) + type Evaluation struct + Fused map[int]float64 + Queries int + Reranked map[int]float64 + func Evaluate(ctx context.Context, index IIndex, lookups []Lookup) (Evaluation, error) + type Feeder struct + func NewFeeder(options ...FeederOption) (*Feeder, error) + func (feeder *Feeder) Measured() *Measured + func (feeder *Feeder) Refresh(ctx context.Context) (*Measured, error) + func (feeder *Feeder) Trigger() cronservice.Option + type FeederOption func(feeder *Feeder) error + func WithClock(now func() time.Time) FeederOption + func WithGitHub(slug string) FeederOption + func WithHarnessState(root string, files iofs.IFiles) FeederOption + func WithIndex(index IIndex) FeederOption + func WithKnowledge(knowledge IKnowledge) FeederOption + func WithLauncher(launcher proc.ILauncher) FeederOption + func WithLogger(logger *slog.Logger) FeederOption + func WithRepository(directory string, slug string, load func() (string, error), ...) FeederOption + type IEmbeddingModel interface + Embed func(ctx context.Context, inputs []string, stay time.Duration) ([][]float32, error) + Loaded func(ctx context.Context) ([]ollama.LoadedModel, error) + Model func() string + type IIndex interface + Compare func(ctx context.Context, request *pb.SearchRequest) (*pb.SearchResult, *pb.SearchResult, error) + Forget func(ctx context.Context, sourceID string) error + type IKnowledge interface + GetDocument func(ctx context.Context, request *pb.GetDocumentRequest) (*pb.GetDocumentResponse, error) + IngestDocument func(ctx context.Context, request *pb.IngestDocumentRequest) (*pb.IngestDocumentResponse, error) + type Lookup struct + Paths []string + Query string + func Lookups() []Lookup + type Measured struct + At time.Time + Evaluation Evaluation + Failed map[string]int64 + Forgotten int64 + Ingested map[string]int64 + type RerankerSettings struct + Model string + type SearchSettings struct + Index string