Documentation ¶
Overview ¶
Package localvec is a local vector database for development and testing. The database is stored in a file in the local file system. Production code should use a real vector database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ctx context.Context, dir, name string, embedder ai.Embedder, embedderOptions any) (ai.DocumentStore, error)
New returns a new local vector database. This will register a new retriever with genkit, and also return it. This retriever may only be used by a single goroutine at a time. This is based on js/plugins/dev-local-vectorstore/src/index.ts.
Types ¶
type RetrieverOptions ¶
type RetrieverOptions struct {
K int `json:"k,omitempty"` // number of entries to return
}
RetrieverOptions may be passed in the Options field of ai.RetrieverRequest to pass options to the retriever. The Options field should be either nil or a value of type *RetrieverOptions.
Click to show internal directories.
Click to hide internal directories.