Documentation
¶
Index ¶
- Constants
- Variables
- func RebuildMarkdownHierarchy(nodes []*IndexNode)
- type DocSearchCandidate
- type InMemoryIndexStore
- func (s *InMemoryIndexStore) AddNode(ctx context.Context, userID, sourceID string, node *IndexNode, parentID string) error
- func (s *InMemoryIndexStore) CreateIndex(ctx context.Context, userID, sourceID, title string, nodes []*IndexNode) (*IndexTree, error)
- func (s *InMemoryIndexStore) DeleteIndex(ctx context.Context, userID, sourceID string) error
- func (s *InMemoryIndexStore) GetAllIndexes(ctx context.Context, userID string) ([]*IndexTree, error)
- func (s *InMemoryIndexStore) GetIndex(ctx context.Context, userID, sourceID string) (*IndexTree, error)
- func (s *InMemoryIndexStore) RemoveNode(ctx context.Context, userID, sourceID, nodeID string) error
- func (s *InMemoryIndexStore) SearchIndex(ctx context.Context, userID, query string, limit int) (*IndexSearchResult, error)
- func (s *InMemoryIndexStore) UpdateIndex(ctx context.Context, tree *IndexTree) error
- func (s *InMemoryIndexStore) UpdateNode(ctx context.Context, userID, sourceID string, node *IndexNode) error
- type InMemoryKnowledgeStore
- func (s *InMemoryKnowledgeStore) Add(ctx context.Context, entry KnowledgeEntry) error
- func (s *InMemoryKnowledgeStore) Clear(ctx context.Context, userID string) error
- func (s *InMemoryKnowledgeStore) Delete(ctx context.Context, id string) error
- func (s *InMemoryKnowledgeStore) Get(ctx context.Context, id string) (*KnowledgeEntry, error)
- func (s *InMemoryKnowledgeStore) GetByCategory(ctx context.Context, userID, category string) ([]KnowledgeEntry, error)
- func (s *InMemoryKnowledgeStore) GetByTags(ctx context.Context, userID string, tags []string) ([]KnowledgeEntry, error)
- func (s *InMemoryKnowledgeStore) GetStats(ctx context.Context, userID string) (int, error)
- func (s *InMemoryKnowledgeStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
- func (s *InMemoryKnowledgeStore) Update(ctx context.Context, entry KnowledgeEntry) error
- type InMemoryPageIndexStore
- func (s *InMemoryPageIndexStore) CountByUser(ctx context.Context, userID string) (int, error)
- func (s *InMemoryPageIndexStore) Delete(ctx context.Context, userID, id string) error
- func (s *InMemoryPageIndexStore) DeleteByKinds(ctx context.Context, userID string, kinds []PageIndexKind) error
- func (s *InMemoryPageIndexStore) DeleteByUser(ctx context.Context, userID string) error
- func (s *InMemoryPageIndexStore) Search(ctx context.Context, userID, query string, opts *PageIndexSearchOptions) ([]PageIndexHit, error)
- func (s *InMemoryPageIndexStore) Upsert(ctx context.Context, doc PageIndexDoc) error
- type InMemoryPreferenceStore
- func (s *InMemoryPreferenceStore) Clear(ctx context.Context, userID string) error
- func (s *InMemoryPreferenceStore) Delete(ctx context.Context, userID, category, key string) error
- func (s *InMemoryPreferenceStore) Get(ctx context.Context, userID, category, key string) (*Preference, error)
- func (s *InMemoryPreferenceStore) GetAllAsMap(ctx context.Context, userID string) (map[string]string, error)
- func (s *InMemoryPreferenceStore) GetByCategory(ctx context.Context, userID, category string) ([]Preference, error)
- func (s *InMemoryPreferenceStore) GetByUser(ctx context.Context, userID string) ([]Preference, error)
- func (s *InMemoryPreferenceStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
- func (s *InMemoryPreferenceStore) Set(ctx context.Context, pref Preference) error
- type IndexConfig
- type IndexNode
- type IndexSearchResult
- type IndexStore
- type IndexTree
- type KnowledgeEntry
- type MarkdownParser
- type MemoryItem
- type PageIndexDoc
- type PageIndexHit
- type PageIndexKind
- type PageIndexSearchOptions
- type Preference
- type Priority
- type SearchOptions
- type SearchResult
- type TreeSearchResult
Constants ¶
View Source
const ( MemoryTypePreference = typescore.MemoryTypePreference MemoryTypeKnowledge = typescore.MemoryTypeKnowledge MemoryTypeIndex = typescore.MemoryTypeIndex PriorityLow = typescore.PriorityLow PriorityMedium = typescore.PriorityMedium PriorityHigh = typescore.PriorityHigh PageKindPreference = typescore.PageKindPreference PageKindKnowledge = typescore.PageKindKnowledge PageKindLongTerm = typescore.PageKindLongTerm PageKindKnowledgeBase = typescore.PageKindKnowledgeBase )
Variables ¶
View Source
var ( ErrNotFound = errors.New("memory: not found") ErrInvalidInput = errors.New("memory: invalid input") )
View Source
var EstimateTokens = utils.EstimateTokens
View Source
var KindAllowed = utils.KindAllowed
View Source
var NewID = utils.NewID
View Source
var PageKeywordScore = utils.PageKeywordScore
Functions ¶
func RebuildMarkdownHierarchy ¶
func RebuildMarkdownHierarchy(nodes []*IndexNode)
Types ¶
type DocSearchCandidate ¶
type DocSearchCandidate = typescore.DocSearchCandidate
type InMemoryIndexStore ¶
type InMemoryIndexStore struct {
// contains filtered or unexported fields
}
func NewInMemoryIndexStore ¶
func NewInMemoryIndexStore() *InMemoryIndexStore
func (*InMemoryIndexStore) CreateIndex ¶
func (*InMemoryIndexStore) DeleteIndex ¶
func (s *InMemoryIndexStore) DeleteIndex(ctx context.Context, userID, sourceID string) error
func (*InMemoryIndexStore) GetAllIndexes ¶
func (*InMemoryIndexStore) RemoveNode ¶
func (s *InMemoryIndexStore) RemoveNode(ctx context.Context, userID, sourceID, nodeID string) error
func (*InMemoryIndexStore) SearchIndex ¶
func (s *InMemoryIndexStore) SearchIndex(ctx context.Context, userID, query string, limit int) (*IndexSearchResult, error)
func (*InMemoryIndexStore) UpdateIndex ¶
func (s *InMemoryIndexStore) UpdateIndex(ctx context.Context, tree *IndexTree) error
func (*InMemoryIndexStore) UpdateNode ¶
type InMemoryKnowledgeStore ¶
type InMemoryKnowledgeStore struct {
// contains filtered or unexported fields
}
func NewInMemoryKnowledgeStore ¶
func NewInMemoryKnowledgeStore() *InMemoryKnowledgeStore
func (*InMemoryKnowledgeStore) Add ¶
func (s *InMemoryKnowledgeStore) Add(ctx context.Context, entry KnowledgeEntry) error
func (*InMemoryKnowledgeStore) Clear ¶
func (s *InMemoryKnowledgeStore) Clear(ctx context.Context, userID string) error
func (*InMemoryKnowledgeStore) Delete ¶
func (s *InMemoryKnowledgeStore) Delete(ctx context.Context, id string) error
func (*InMemoryKnowledgeStore) Get ¶
func (s *InMemoryKnowledgeStore) Get(ctx context.Context, id string) (*KnowledgeEntry, error)
func (*InMemoryKnowledgeStore) GetByCategory ¶
func (s *InMemoryKnowledgeStore) GetByCategory(ctx context.Context, userID, category string) ([]KnowledgeEntry, error)
func (*InMemoryKnowledgeStore) GetByTags ¶
func (s *InMemoryKnowledgeStore) GetByTags(ctx context.Context, userID string, tags []string) ([]KnowledgeEntry, error)
func (*InMemoryKnowledgeStore) Search ¶
func (s *InMemoryKnowledgeStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
func (*InMemoryKnowledgeStore) Update ¶
func (s *InMemoryKnowledgeStore) Update(ctx context.Context, entry KnowledgeEntry) error
type InMemoryPageIndexStore ¶
type InMemoryPageIndexStore struct {
// contains filtered or unexported fields
}
func NewInMemoryPageIndexStore ¶
func NewInMemoryPageIndexStore() *InMemoryPageIndexStore
func (*InMemoryPageIndexStore) CountByUser ¶
func (*InMemoryPageIndexStore) Delete ¶
func (s *InMemoryPageIndexStore) Delete(ctx context.Context, userID, id string) error
func (*InMemoryPageIndexStore) DeleteByKinds ¶
func (s *InMemoryPageIndexStore) DeleteByKinds(ctx context.Context, userID string, kinds []PageIndexKind) error
func (*InMemoryPageIndexStore) DeleteByUser ¶
func (s *InMemoryPageIndexStore) DeleteByUser(ctx context.Context, userID string) error
func (*InMemoryPageIndexStore) Search ¶
func (s *InMemoryPageIndexStore) Search(ctx context.Context, userID, query string, opts *PageIndexSearchOptions) ([]PageIndexHit, error)
func (*InMemoryPageIndexStore) Upsert ¶
func (s *InMemoryPageIndexStore) Upsert(ctx context.Context, doc PageIndexDoc) error
type InMemoryPreferenceStore ¶
type InMemoryPreferenceStore struct {
// contains filtered or unexported fields
}
func NewInMemoryPreferenceStore ¶
func NewInMemoryPreferenceStore() *InMemoryPreferenceStore
func (*InMemoryPreferenceStore) Clear ¶
func (s *InMemoryPreferenceStore) Clear(ctx context.Context, userID string) error
func (*InMemoryPreferenceStore) Delete ¶
func (s *InMemoryPreferenceStore) Delete(ctx context.Context, userID, category, key string) error
func (*InMemoryPreferenceStore) Get ¶
func (s *InMemoryPreferenceStore) Get(ctx context.Context, userID, category, key string) (*Preference, error)
func (*InMemoryPreferenceStore) GetAllAsMap ¶
func (*InMemoryPreferenceStore) GetByCategory ¶
func (s *InMemoryPreferenceStore) GetByCategory(ctx context.Context, userID, category string) ([]Preference, error)
func (*InMemoryPreferenceStore) GetByUser ¶
func (s *InMemoryPreferenceStore) GetByUser(ctx context.Context, userID string) ([]Preference, error)
func (*InMemoryPreferenceStore) Search ¶
func (s *InMemoryPreferenceStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
func (*InMemoryPreferenceStore) Set ¶
func (s *InMemoryPreferenceStore) Set(ctx context.Context, pref Preference) error
type IndexConfig ¶
type IndexConfig = typescore.IndexConfig
func DefaultIndexConfig ¶
func DefaultIndexConfig() *IndexConfig
type IndexNode ¶
func ThinMarkdownIndexNodes ¶
type IndexSearchResult ¶
type IndexSearchResult = typescore.IndexSearchResult
type IndexStore ¶
type IndexStore = typescore.IndexStore
type KnowledgeEntry ¶
type KnowledgeEntry = typescore.KnowledgeEntry
type MarkdownParser ¶
type MarkdownParser struct {
// contains filtered or unexported fields
}
func NewMarkdownParser ¶
func NewMarkdownParser() *MarkdownParser
func (*MarkdownParser) ExtractNodeContent ¶
func (p *MarkdownParser) ExtractNodeContent(content string, node *IndexNode, nextNode *IndexNode) string
func (*MarkdownParser) Parse ¶
func (p *MarkdownParser) Parse(content string) []*IndexNode
type MemoryItem ¶
type MemoryItem = typescore.MemoryItem
type PageIndexDoc ¶
type PageIndexDoc = typescore.PageIndexDoc
type PageIndexHit ¶
type PageIndexHit = typescore.PageIndexHit
type PageIndexKind ¶
type PageIndexKind = typescore.PageIndexKind
type PageIndexSearchOptions ¶
type PageIndexSearchOptions = typescore.PageIndexSearchOptions
type Preference ¶
type Preference = typescore.Preference
type SearchOptions ¶
type SearchOptions = typescore.SearchOptions
type SearchResult ¶
type SearchResult = typescore.SearchResult
type TreeSearchResult ¶
type TreeSearchResult = typescore.TreeSearchResult
Click to show internal directories.
Click to hide internal directories.