stores

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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) AddNode

func (s *InMemoryIndexStore) AddNode(ctx context.Context, userID, sourceID string, node *IndexNode, parentID string) error

func (*InMemoryIndexStore) CreateIndex

func (s *InMemoryIndexStore) CreateIndex(ctx context.Context, userID, sourceID, title string, nodes []*IndexNode) (*IndexTree, error)

func (*InMemoryIndexStore) DeleteIndex

func (s *InMemoryIndexStore) DeleteIndex(ctx context.Context, userID, sourceID string) error

func (*InMemoryIndexStore) GetAllIndexes

func (s *InMemoryIndexStore) GetAllIndexes(ctx context.Context, userID string) ([]*IndexTree, error)

func (*InMemoryIndexStore) GetIndex

func (s *InMemoryIndexStore) GetIndex(ctx context.Context, userID, sourceID string) (*IndexTree, error)

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

func (s *InMemoryIndexStore) UpdateNode(ctx context.Context, userID, sourceID string, node *IndexNode) error

type InMemoryKnowledgeStore

type InMemoryKnowledgeStore struct {
	// contains filtered or unexported fields
}

func NewInMemoryKnowledgeStore

func NewInMemoryKnowledgeStore() *InMemoryKnowledgeStore

func (*InMemoryKnowledgeStore) Add

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 (*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) GetStats

func (s *InMemoryKnowledgeStore) GetStats(ctx context.Context, userID string) (int, error)

func (*InMemoryKnowledgeStore) Search

func (s *InMemoryKnowledgeStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)

func (*InMemoryKnowledgeStore) Update

type InMemoryPageIndexStore

type InMemoryPageIndexStore struct {
	// contains filtered or unexported fields
}

func NewInMemoryPageIndexStore

func NewInMemoryPageIndexStore() *InMemoryPageIndexStore

func (*InMemoryPageIndexStore) CountByUser

func (s *InMemoryPageIndexStore) CountByUser(ctx context.Context, userID string) (int, error)

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

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 (s *InMemoryPreferenceStore) GetAllAsMap(ctx context.Context, userID string) (map[string]string, error)

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

type IndexConfig

type IndexConfig = typescore.IndexConfig

func DefaultIndexConfig

func DefaultIndexConfig() *IndexConfig

type IndexNode

type IndexNode = typescore.IndexNode

func ThinMarkdownIndexNodes

func ThinMarkdownIndexNodes(nodes []*IndexNode, minTokens int) []*IndexNode

type IndexSearchResult

type IndexSearchResult = typescore.IndexSearchResult

type IndexStore

type IndexStore = typescore.IndexStore

type IndexTree

type IndexTree = typescore.IndexTree

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 Priority

type Priority = typescore.Priority

type SearchOptions

type SearchOptions = typescore.SearchOptions

type SearchResult

type SearchResult = typescore.SearchResult

type TreeSearchResult

type TreeSearchResult = typescore.TreeSearchResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL