Files
claude-mnemonic/internal/vector/interface.go
T
lukaszraczylo 1ae8035470 feat(graph): add observation graph with hybrid vector storage
- [x] Add golangci.yml configuration with fieldalignment linter
- [x] Implement observation graph structure with edge detection
- [x] Add LEANN-inspired hybrid vector storage with hub threshold
- [x] Implement graph-aware search with selective recomputation
- [x] Add auto-tuner for dynamic hub threshold adjustment
- [x] Add graph and vector metrics tracking and reporting
- [x] Extend configuration for graph parameters
- [x] Add graph rebuild background service with periodic updates
- [x] Add HTTP endpoints for graph stats and vector metrics
- [x] Update UI with advanced metrics sidebar panel
- [x] Implement AST-aware code chunking for Go, Python, TypeScript
2026-01-07 18:51:40 +00:00

43 lines
1.5 KiB
Go

// Package vector provides common interfaces for vector storage implementations
package vector
import (
"context"
"github.com/lukaszraczylo/claude-mnemonic/internal/vector/sqlitevec"
)
// Client defines the interface for vector storage operations.
// Both sqlitevec.Client and hybrid.Client implement this interface.
type Client interface {
// AddDocuments adds documents with their embeddings to the vector store
AddDocuments(ctx context.Context, docs []sqlitevec.Document) error
// DeleteDocuments removes documents by their IDs
DeleteDocuments(ctx context.Context, ids []string) error
// Query performs a vector similarity search
Query(ctx context.Context, query string, limit int, where map[string]any) ([]sqlitevec.QueryResult, error)
// IsConnected checks if the vector store is available
IsConnected() bool
// Close releases resources
Close() error
// Count returns the total number of vectors in the store
Count(ctx context.Context) (int64, error)
// ModelVersion returns the current embedding model version
ModelVersion() string
// NeedsRebuild checks if vectors need to be rebuilt due to model version change
NeedsRebuild(ctx context.Context) (bool, string)
// GetStaleVectors returns doc_ids of vectors with mismatched or null model versions
GetStaleVectors(ctx context.Context) ([]sqlitevec.StaleVectorInfo, error)
// DeleteVectorsByDocIDs removes vectors by their doc_ids
DeleteVectorsByDocIDs(ctx context.Context, docIDs []string) error
}