Documentation
¶
Index ¶
- type SqliteStore
- func (s *SqliteStore) Close() error
- func (s *SqliteStore) DB() *sql.DB
- func (s *SqliteStore) ReplaceProject(ctx context.Context, tenantID, projectKey string, docs []knowledge.Document) error
- func (s *SqliteStore) Search(ctx context.Context, queryEmbedding []float32, f knowledge.Filter, topK int) ([]knowledge.Hit, error)
- func (s *SqliteStore) Stats(ctx context.Context, tenantID, projectKey string) (int, error)
- func (s *SqliteStore) Upsert(ctx context.Context, docs []knowledge.Document) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SqliteStore ¶
type SqliteStore struct {
// contains filtered or unexported fields
}
SqliteStore persists and queries knowledge documents using SQLite + sqlite-vec.
func New ¶
func New(_ context.Context, path string) (*SqliteStore, error)
New creates a new SqliteStore at the given file path. Parent directories are created automatically.
func (*SqliteStore) Close ¶
func (s *SqliteStore) Close() error
Close closes the underlying database connection.
func (*SqliteStore) DB ¶
func (s *SqliteStore) DB() *sql.DB
DB returns the underlying *sql.DB for use in migrations (e.g. from cmd/mcp-issues-index).
func (*SqliteStore) ReplaceProject ¶
func (s *SqliteStore) ReplaceProject(ctx context.Context, tenantID, projectKey string, docs []knowledge.Document) error
ReplaceProject atomically removes all documents for tenantID+projectKey and inserts docs in a single transaction.
func (*SqliteStore) Search ¶
func (s *SqliteStore) Search(ctx context.Context, queryEmbedding []float32, f knowledge.Filter, topK int) ([]knowledge.Hit, error)
Search returns the topK nearest documents to queryEmbedding filtered by f. Score is cosine similarity (1 - distance), ranging from 0 to 1.
Click to show internal directories.
Click to hide internal directories.