Versions in this module Expand all Collapse all v0 v0.5.3 Sep 1, 2026 v0.5.2 Aug 27, 2026 v0.5.1 Aug 26, 2026 Changes in this version + func RemoveCJKDict() error + func SetCJKDictDir(dir string) + func SetEmbeddedCJKDict(fn func() *gse.Segmenter) + type CJKDictName string + const CJKDictJP + const CJKDictZH + const CJKDictZHS + const CJKDictZHT + type CJKDictStatus struct + Available bool + Bytes int64 + Dir string + Source string + Variant CJKDictName + Version string + func CJKDictStatusNow() CJKDictStatus + func DownloadCJKDict() (CJKDictStatus, error) + func DownloadCJKDictTo(dict CJKDictName, dir string, mirrorBase string) (CJKDictStatus, error) + type CJKVariantInfo struct + Bytes int64 + Desc string + Name CJKDictName + func CJKDictVariants() []CJKVariantInfo v0.5.0 Aug 25, 2026 v0.4.0 Aug 20, 2026 Changes in this version + const Edition + var ErrIndexLockHeld = errors.New("code indexing is already running") + type PostgresStore struct + func NewPostgresStore(dsn string, dim int) (*PostgresStore, error) + func (s *PostgresStore) Close() error + func (s *PostgresStore) Count(workspace string) (map[string]int, error) + func (s *PostgresStore) CountCodeSymbols() (int, error) + func (s *PostgresStore) CountEdges() (int, error) + func (s *PostgresStore) DeleteMemoriesByTypeSource(typ, source, workspace string) error + func (s *PostgresStore) DeleteMemory(id string) error + func (s *PostgresStore) DeleteSymbolMemories(qualifiedName, workspace string) error + func (s *PostgresStore) DeleteUser(username string) error + func (s *PostgresStore) EpisodicContentsSince(workspace string, since float64) ([]string, error) + func (s *PostgresStore) FindByHash(contentHash, workspace string) (*schema.Memory, error) + func (s *PostgresStore) GetIndexedHash(filePath string) (string, error) + func (s *PostgresStore) GetMemory(id string) (*schema.Memory, error) + func (s *PostgresStore) GetMeta(key string) (string, error) + func (s *PostgresStore) GetUser(username string) (*schema.User, error) + func (s *PostgresStore) InvalidateEdge(edgeID string, t float64) error + func (s *PostgresStore) IterMemories(workspace, layer, typ string) ([]*schema.Memory, error) + func (s *PostgresStore) ListUsers() ([]*schema.User, error) + func (s *PostgresStore) NeighborCounts() (map[string]int, error) + func (s *PostgresStore) Neighbors(memID, relation string) ([]*schema.Edge, error) + func (s *PostgresStore) Ping() error + func (s *PostgresStore) PutCodeRefs(refs []*schema.CodeRef) error + func (s *PostgresStore) PutCodeSymbol(sym *schema.CodeSymbol) error + func (s *PostgresStore) PutEdge(e *schema.Edge) error + func (s *PostgresStore) PutMemory(mem *schema.Memory, vector []float32) error + func (s *PostgresStore) PutUser(u *schema.User) error + func (s *PostgresStore) RebuildVectorIndex(newDim int) + func (s *PostgresStore) RefsForSymbol(qualifiedName, direction string) ([]*schema.CodeRef, error) + func (s *PostgresStore) SetIndexed(filePath, bodyHash string, now float64) error + func (s *PostgresStore) SetMeta(key, value string) error + func (s *PostgresStore) SymbolsForFile(filePath string) ([]*schema.CodeSymbol, error) + func (s *PostgresStore) TouchMemories(ids []string, now float64) error + func (s *PostgresStore) TryAcquireIndexLock() (func(), error) + func (s *PostgresStore) UpdateMemoryContent(id, content, summary string, tags []string, vector []float32, now float64) error + func (s *PostgresStore) VectorSearch(queryVec []float32, topK int) []SearchHit + func (s *PostgresStore) Workspaces() ([]string, error) type SQLiteStore + func (s *SQLiteStore) CountCodeSymbols() (int, error) + func (s *SQLiteStore) DeleteMemoriesByTypeSource(typ, source, workspace string) error + func (s *SQLiteStore) DeleteSymbolMemories(qualifiedName, workspace string) error + func (s *SQLiteStore) DeleteUser(username string) error + func (s *SQLiteStore) GetUser(username string) (*schema.User, error) + func (s *SQLiteStore) InvalidateEdge(edgeID string, t float64) error + func (s *SQLiteStore) ListUsers() ([]*schema.User, error) + func (s *SQLiteStore) Ping() error + func (s *SQLiteStore) PutUser(u *schema.User) error + func (s *SQLiteStore) TouchMemories(ids []string, now float64) error + func (s *SQLiteStore) TryAcquireIndexLock() (func(), error) + func (s *SQLiteStore) UpdateMemoryContent(id, content, summary string, tags []string, vector []float32, now float64) error + func (s *SQLiteStore) VectorSearch(queryVec []float32, topK int) []SearchHit + type Store interface + Close func() error + Count func(workspace string) (map[string]int, error) + CountCodeSymbols func() (int, error) + CountEdges func() (int, error) + DeleteMemoriesByTypeSource func(typ, source, workspace string) error + DeleteMemory func(id string) error + DeleteSymbolMemories func(qualifiedName, workspace string) error + DeleteUser func(username string) error + EpisodicContentsSince func(workspace string, since float64) ([]string, error) + FindByHash func(contentHash, workspace string) (*schema.Memory, error) + GetIndexedHash func(filePath string) (string, error) + GetMemory func(id string) (*schema.Memory, error) + GetMeta func(key string) (string, error) + GetUser func(username string) (*schema.User, error) + InvalidateEdge func(edgeID string, t float64) error + IterMemories func(workspace, layer, typ string) ([]*schema.Memory, error) + ListUsers func() ([]*schema.User, error) + NeighborCounts func() (map[string]int, error) + Neighbors func(memID, relation string) ([]*schema.Edge, error) + Ping func() error + PutCodeRefs func(refs []*schema.CodeRef) error + PutCodeSymbol func(sym *schema.CodeSymbol) error + PutEdge func(e *schema.Edge) error + PutMemory func(mem *schema.Memory, vector []float32) error + PutUser func(u *schema.User) error + RebuildVectorIndex func(newDim int) + RefsForSymbol func(qualifiedName, direction string) ([]*schema.CodeRef, error) + SetIndexed func(filePath, bodyHash string, now float64) error + SetMeta func(key, value string) error + SymbolsForFile func(filePath string) ([]*schema.CodeSymbol, error) + TouchMemories func(ids []string, now float64) error + TryAcquireIndexLock func() (func(), error) + UpdateMemoryContent func(id, content, summary string, tags []string, vector []float32, now float64) error + VectorSearch func(queryVec []float32, topK int) []SearchHit + Workspaces func() ([]string, error) + func OpenStore(cfg *config.Config, dim int) (Store, error) v0.3.1 Aug 15, 2026 v0.3.0 Aug 15, 2026 Changes in this version + func AssertDimMatches(stored, configured int) error + func CosineSimilarity(a, b []float32) float64 + func RegisterCallable(name string, fn func(string) ([]float32, error)) + func Tokenize(text string) []string + type CachedEmbedding struct + func NewCachedEmbedding(inner EmbeddingProvider, size int) *CachedEmbedding + func (c *CachedEmbedding) Dim() int + func (c *CachedEmbedding) Embed(text string) ([]float32, error) + func (c *CachedEmbedding) EmbedBatch(texts []string) ([][]float32, error) + func (c *CachedEmbedding) HealthCheck() (bool, string) + type CallableEmbedding struct + func NewCallableEmbedding(fn func(string) ([]float32, error), dim int) *CallableEmbedding + func (c *CallableEmbedding) Dim() int + func (c *CallableEmbedding) Embed(text string) ([]float32, error) + func (c *CallableEmbedding) EmbedBatch(texts []string) ([][]float32, error) + func (c *CallableEmbedding) HealthCheck() (bool, string) + type EmbeddingDimensionMismatch struct + Configured int + Stored int + func (e *EmbeddingDimensionMismatch) Error() string + type EmbeddingProvider interface + Dim func() int + Embed func(text string) ([]float32, error) + EmbedBatch func(texts []string) ([][]float32, error) + HealthCheck func() (bool, string) + func MakeProvider(cfg *config.Config) (EmbeddingProvider, error) + type EmbeddingProviderError struct + Msg string + func (e *EmbeddingProviderError) Error() string + type FakeHTTPPoster struct + ExpectedPath string + LastPayload any + LastURL string + Responder func(payload any) (any, error) + func (f *FakeHTTPPoster) Post(url string, payload any, headers map[string]string) (any, error) + type HTTPEmbedding struct + func NewHTTPEmbedding(opts HTTPEmbeddingOptions) *HTTPEmbedding + func (h *HTTPEmbedding) Dim() int + func (h *HTTPEmbedding) Embed(text string) ([]float32, error) + func (h *HTTPEmbedding) EmbedBatch(texts []string) ([][]float32, error) + func (h *HTTPEmbedding) HealthCheck() (bool, string) + type HTTPEmbeddingOptions struct + BaseURL string + Dim int + Model string + Poster HTTPPoster + Request string + ResponsePath string + TimeoutS float64 + type HTTPPoster interface + Post func(url string, payload any, headers map[string]string) (any, error) + type HashingEmbedding struct + func NewHashingEmbedding(dim int) *HashingEmbedding + func (h *HashingEmbedding) Dim() int + func (h *HashingEmbedding) Embed(text string) ([]float32, error) + func (h *HashingEmbedding) EmbedBatch(texts []string) ([][]float32, error) + func (h *HashingEmbedding) HealthCheck() (bool, string) + type InMemoryVectorIndex struct + func NewInMemoryVectorIndex(dim int) *InMemoryVectorIndex + func (ix *InMemoryVectorIndex) Delete(itemID string) + func (ix *InMemoryVectorIndex) Len() int + func (ix *InMemoryVectorIndex) Search(query []float32, topK int) []SearchHit + func (ix *InMemoryVectorIndex) Upsert(itemID string, vector []float32) error + type OllamaEmbedding struct + func NewOllamaEmbedding(baseURL, model string, timeoutS float64, client HTTPPoster) *OllamaEmbedding + func (o *OllamaEmbedding) Dim() int + func (o *OllamaEmbedding) Embed(text string) ([]float32, error) + func (o *OllamaEmbedding) EmbedBatch(texts []string) ([][]float32, error) + func (o *OllamaEmbedding) HealthCheck() (bool, string) + type OpenAIEmbedding struct + func NewOpenAIEmbedding(model, baseURL, apiKey string, timeoutS float64) *OpenAIEmbedding + func (o *OpenAIEmbedding) Dim() int + func (o *OpenAIEmbedding) Embed(text string) ([]float32, error) + func (o *OpenAIEmbedding) EmbedBatch(texts []string) ([][]float32, error) + func (o *OpenAIEmbedding) HealthCheck() (bool, string) + type RealHTTPPoster struct + Timeout time.Duration + func NewRealHTTPPoster(timeoutS float64) *RealHTTPPoster + func (c *RealHTTPPoster) Post(url string, payload any, headers map[string]string) (any, error) + type SQLiteStore struct + DBPath string + Dim int + func NewStore(dbPath string, dim int, preferSQLiteVec bool, enableWAL bool) (*SQLiteStore, error) + func (s *SQLiteStore) Close() error + func (s *SQLiteStore) Count(workspace string) (map[string]int, error) + func (s *SQLiteStore) CountEdges() (int, error) + func (s *SQLiteStore) DB() *sql.DB + func (s *SQLiteStore) DeleteMemory(id string) error + func (s *SQLiteStore) EpisodicContentsSince(workspace string, since float64) ([]string, error) + func (s *SQLiteStore) FindByHash(contentHash, workspace string) (*schema.Memory, error) + func (s *SQLiteStore) GetIndexedHash(filePath string) (string, error) + func (s *SQLiteStore) GetMemory(id string) (*schema.Memory, error) + func (s *SQLiteStore) GetMeta(key string) (string, error) + func (s *SQLiteStore) IterMemories(workspace, layer, typ string) ([]*schema.Memory, error) + func (s *SQLiteStore) NeighborCounts() (map[string]int, error) + func (s *SQLiteStore) Neighbors(memID, relation string) ([]*schema.Edge, error) + func (s *SQLiteStore) PutCodeRefs(refs []*schema.CodeRef) error + func (s *SQLiteStore) PutCodeSymbol(sym *schema.CodeSymbol) error + func (s *SQLiteStore) PutEdge(e *schema.Edge) error + func (s *SQLiteStore) PutMemory(mem *schema.Memory, vector []float32) error + func (s *SQLiteStore) RebuildVectorIndex(newDim int) + func (s *SQLiteStore) RefsForSymbol(qualifiedName, direction string) ([]*schema.CodeRef, error) + func (s *SQLiteStore) SetIndexed(filePath, bodyHash string, now float64) error + func (s *SQLiteStore) SetMeta(key, value string) error + func (s *SQLiteStore) SymbolsForFile(filePath string) ([]*schema.CodeSymbol, error) + func (s *SQLiteStore) TouchMemory(id string, now float64) error + func (s *SQLiteStore) UsingSQLiteVec() bool + func (s *SQLiteStore) VectorIndex() VectorIndex + func (s *SQLiteStore) Workspaces() ([]string, error) + type SearchHit struct + ID string + Similarity float64 + type VectorIndex interface + Delete func(itemID string) + Len func() int + Search func(query []float32, topK int) []SearchHit + Upsert func(itemID string, vector []float32) error