Documentation
¶
Index ¶
- Constants
- func GenerateItemID(path, name string, line int) string
- type ClearResult
- type Item
- type SearchResult
- type StatusResult
- type Store
- func (s *Store) Add(item *Item) error
- func (s *Store) AddBatch(items []*Item) error
- func (s *Store) Clear(filterPaths []string) (*ClearResult, error)
- func (s *Store) Count() int
- func (s *Store) IsFileIndexed(path string) bool
- func (s *Store) Save() error
- func (s *Store) Search(ctx context.Context, queryEmbedding []float32, limit int, threshold float64, ...) ([]SearchResult, int, error)
- func (s *Store) Status() *StatusResult
- func (s *Store) StorePath() string
Constants ¶
View Source
const ( // DefaultStorePath is the default path for vector storage DefaultStorePath = ".mcp-devtools/embeddings" // CollectionName is the name of the chromem collection CollectionName = "code-search" )
Variables ¶
This section is empty.
Functions ¶
func GenerateItemID ¶
GenerateItemID generates a unique ID for an item
Types ¶
type ClearResult ¶
type ClearResult struct {
Cleared bool `json:"cleared"`
FilesCleared int `json:"files_cleared"`
ItemsCleared int `json:"items_cleared"`
}
ClearResult represents the result of a clear operation
type Item ¶
type Item struct {
ID string `json:"id"`
Path string `json:"path"`
Name string `json:"name"`
Type string `json:"type"`
Signature string `json:"signature"`
Line int `json:"line"`
Embedding []float32 `json:"embedding"`
}
Item represents an indexed item with its embedding
type SearchResult ¶
type SearchResult struct {
Path string `json:"path"`
Name string `json:"name"`
Type string `json:"type"`
Signature string `json:"signature"`
Similarity float64 `json:"similarity"`
Line int `json:"line,omitempty"`
}
SearchResult represents a search result with similarity score
type StatusResult ¶
type StatusResult struct {
Indexed bool `json:"indexed"`
TotalFiles int `json:"total_files"`
TotalItems int `json:"total_items"`
IndexedPaths []string `json:"indexed_paths,omitempty"`
ModelLoaded bool `json:"model_loaded"`
ModelPath string `json:"model_path,omitempty"`
RuntimeLoaded bool `json:"runtime_loaded"`
RuntimeVersion string `json:"runtime_version,omitempty"`
}
StatusResult represents the store status
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides vector storage and similarity search using chromem-go
func (*Store) Clear ¶
func (s *Store) Clear(filterPaths []string) (*ClearResult, error)
Clear removes items from the store
func (*Store) IsFileIndexed ¶
IsFileIndexed checks if a file is already indexed
func (*Store) Search ¶
func (s *Store) Search(ctx context.Context, queryEmbedding []float32, limit int, threshold float64, filterPaths []string) ([]SearchResult, int, error)
Search performs similarity search. Returns results, total matches (before limit), and error.
func (*Store) Status ¶
func (s *Store) Status() *StatusResult
Status returns the current store status
Click to show internal directories.
Click to hide internal directories.