Documentation
¶
Index ¶
- func AllowedCategories() []string
- func IsAllowedCategory(head string) bool
- func IsMandatoryCategory(head string) bool
- func WithAdditionalMandatoryCategories(categories []string)
- type Entry
- type HeadInfo
- type NoopStore
- func (s *NoopStore) All(scopes []Scope) ([]Entry, error)
- func (s *NoopStore) AllByCategory(category string, topK int, scopes []Scope) ([]Entry, error)
- func (s *NoopStore) Delete(id string) error
- func (s *NoopStore) Get(id string) (*Entry, error)
- func (s *NoopStore) ListHeads(scopes []Scope) ([]HeadInfo, error)
- func (s *NoopStore) Promote(id string, targetScope Scope) error
- func (s *NoopStore) Query(category string, tags []string) ([]*Entry, error)
- func (s *NoopStore) QueryByCategory(category, query string, topK int, scopes []Scope) ([]Entry, error)
- func (s *NoopStore) Score(id string, delta float64) error
- func (s *NoopStore) Upsert(entry *Entry) error
- type QueryOptions
- type Scope
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedCategories ¶
func AllowedCategories() []string
AllowedCategories returns the list of allowed categories (heads).
func IsAllowedCategory ¶
IsAllowedCategory checks if a category is allowed (i.e. can be used as a head).
func IsMandatoryCategory ¶
func WithAdditionalMandatoryCategories ¶
func WithAdditionalMandatoryCategories(categories []string)
WithAdditionalMandatoryCategories allows extending mandatory categories (heads).
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"id" yaml:"id"`
Content string `json:"content" yaml:"content"`
Tags []string `json:"tags" yaml:"tags"`
Category string `json:"category" yaml:"category"`
Scope string `json:"scope" yaml:"scope"`
Score float64 `json:"score" yaml:"score"`
HitCount int `json:"hit_count" yaml:"hit_count"`
LastHit time.Time `json:"last_hit" yaml:"last_hit"`
Created time.Time `json:"created" yaml:"created"`
Source string `json:"source" yaml:"source"`
}
Entry represents a single knowledge nugget.
type NoopStore ¶
type NoopStore struct {
}
func (*NoopStore) AllByCategory ¶
func (*NoopStore) QueryByCategory ¶
type QueryOptions ¶
type QueryOptions struct {
}
type Scope ¶
type Scope string
Scope represents a logical grouping for entries. Examples of scopes include "global", "team:acme", "project:mnemonic".
const ScopeGlobal Scope = "global"
type Store ¶
type Store interface {
ListHeads(scopes []Scope) ([]HeadInfo, error)
All(scopes []Scope) ([]Entry, error)
AllByCategory(category string, topK int, scopes []Scope) ([]Entry, error)
Get(id string) (*Entry, error)
Query(category string, tags []string) ([]*Entry, error)
QueryByCategory(category, query string, topK int, scopes []Scope) ([]Entry, error)
Upsert(entry *Entry) error
Score(id string, delta float64) error
Delete(id string) error
Promote(id string, targetScope Scope) error
}
Store defines the persistent storage contract (YAML, Chroma, etc.).
Click to show internal directories.
Click to hide internal directories.