Documentation
¶
Index ¶
- Constants
- Variables
- func IngestGetCursor(ctx context.Context, db *sql.DB, sessionID string) (int64, error)
- func IngestIncStat(ctx context.Context, db *sql.DB, sessionID, ruleName string) error
- func IngestSetCursor(ctx context.Context, db *sql.DB, sessionID string, lastMessageID int64) error
- type IndexNode
- type IndexSearchResult
- type IndexTree
- type KnowledgeEntry
- type MemoryItem
- type PageIndexDoc
- type PageIndexHit
- type PageIndexKind
- type PageIndexSearchOptions
- type Preference
- type Priority
- type SQLiteIndexStore
- func (s *SQLiteIndexStore) AddNode(ctx context.Context, userID, sourceID string, node *IndexNode, parentID string) error
- func (s *SQLiteIndexStore) CreateIndex(ctx context.Context, userID, sourceID, title string, nodes []*IndexNode) (*IndexTree, error)
- func (s *SQLiteIndexStore) DeleteIndex(ctx context.Context, userID, sourceID string) error
- func (s *SQLiteIndexStore) GetAllIndexes(ctx context.Context, userID string) ([]*IndexTree, error)
- func (s *SQLiteIndexStore) GetIndex(ctx context.Context, userID, sourceID string) (*IndexTree, error)
- func (s *SQLiteIndexStore) RemoveNode(ctx context.Context, userID, sourceID, nodeID string) error
- func (s *SQLiteIndexStore) SearchIndex(ctx context.Context, userID, query string, limit int) (*IndexSearchResult, error)
- func (s *SQLiteIndexStore) UpdateIndex(ctx context.Context, tree *IndexTree) error
- func (s *SQLiteIndexStore) UpdateNode(ctx context.Context, userID, sourceID string, node *IndexNode) error
- type SQLiteKnowledgeStore
- func (s *SQLiteKnowledgeStore) Add(ctx context.Context, entry KnowledgeEntry) error
- func (s *SQLiteKnowledgeStore) Clear(ctx context.Context, userID string) error
- func (s *SQLiteKnowledgeStore) Delete(ctx context.Context, id string) error
- func (s *SQLiteKnowledgeStore) Get(ctx context.Context, id string) (*KnowledgeEntry, error)
- func (s *SQLiteKnowledgeStore) GetByCategory(ctx context.Context, userID, category string) ([]KnowledgeEntry, error)
- func (s *SQLiteKnowledgeStore) GetByTags(ctx context.Context, userID string, tags []string) ([]KnowledgeEntry, error)
- func (s *SQLiteKnowledgeStore) GetStats(ctx context.Context, userID string) (int, error)
- func (s *SQLiteKnowledgeStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
- func (s *SQLiteKnowledgeStore) Update(ctx context.Context, entry KnowledgeEntry) error
- type SQLitePageIndexStore
- func (s *SQLitePageIndexStore) CountByUser(ctx context.Context, userID string) (int, error)
- func (s *SQLitePageIndexStore) Delete(ctx context.Context, userID, id string) error
- func (s *SQLitePageIndexStore) DeleteByKinds(ctx context.Context, userID string, kinds []PageIndexKind) error
- func (s *SQLitePageIndexStore) DeleteByUser(ctx context.Context, userID string) error
- func (s *SQLitePageIndexStore) Search(ctx context.Context, userID, query string, opts *PageIndexSearchOptions) ([]PageIndexHit, error)
- func (s *SQLitePageIndexStore) Upsert(ctx context.Context, doc PageIndexDoc) error
- type SQLitePreferenceStore
- func (s *SQLitePreferenceStore) Clear(ctx context.Context, userID string) error
- func (s *SQLitePreferenceStore) Delete(ctx context.Context, userID, category, key string) error
- func (s *SQLitePreferenceStore) Get(ctx context.Context, userID, category, key string) (*Preference, error)
- func (s *SQLitePreferenceStore) GetAllAsMap(ctx context.Context, userID string) (map[string]string, error)
- func (s *SQLitePreferenceStore) GetByCategory(ctx context.Context, userID, category string) ([]Preference, error)
- func (s *SQLitePreferenceStore) GetByUser(ctx context.Context, userID string) ([]Preference, error)
- func (s *SQLitePreferenceStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
- func (s *SQLitePreferenceStore) Set(ctx context.Context, pref Preference) error
- type SQLiteStore
- type SearchOptions
- type SearchResult
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 EstimateTokens = utils.EstimateTokens
View Source
var NewID = utils.NewID
View Source
var PageKeywordScore = utils.PageKeywordScore
Functions ¶
func IngestGetCursor ¶
func IngestIncStat ¶
Types ¶
type IndexSearchResult ¶
type IndexSearchResult = typescore.IndexSearchResult
type KnowledgeEntry ¶
type KnowledgeEntry = typescore.KnowledgeEntry
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 SQLiteIndexStore ¶
type SQLiteIndexStore struct {
// contains filtered or unexported fields
}
func NewSQLiteIndexStore ¶
func NewSQLiteIndexStore(store *SQLiteStore) *SQLiteIndexStore
func (*SQLiteIndexStore) CreateIndex ¶
func (*SQLiteIndexStore) DeleteIndex ¶
func (s *SQLiteIndexStore) DeleteIndex(ctx context.Context, userID, sourceID string) error
func (*SQLiteIndexStore) GetAllIndexes ¶
func (*SQLiteIndexStore) RemoveNode ¶
func (s *SQLiteIndexStore) RemoveNode(ctx context.Context, userID, sourceID, nodeID string) error
func (*SQLiteIndexStore) SearchIndex ¶
func (s *SQLiteIndexStore) SearchIndex(ctx context.Context, userID, query string, limit int) (*IndexSearchResult, error)
func (*SQLiteIndexStore) UpdateIndex ¶
func (s *SQLiteIndexStore) UpdateIndex(ctx context.Context, tree *IndexTree) error
func (*SQLiteIndexStore) UpdateNode ¶
type SQLiteKnowledgeStore ¶
type SQLiteKnowledgeStore struct {
// contains filtered or unexported fields
}
func NewSQLiteKnowledgeStore ¶
func NewSQLiteKnowledgeStore(store *SQLiteStore) *SQLiteKnowledgeStore
func (*SQLiteKnowledgeStore) Add ¶
func (s *SQLiteKnowledgeStore) Add(ctx context.Context, entry KnowledgeEntry) error
func (*SQLiteKnowledgeStore) Clear ¶
func (s *SQLiteKnowledgeStore) Clear(ctx context.Context, userID string) error
func (*SQLiteKnowledgeStore) Delete ¶
func (s *SQLiteKnowledgeStore) Delete(ctx context.Context, id string) error
func (*SQLiteKnowledgeStore) Get ¶
func (s *SQLiteKnowledgeStore) Get(ctx context.Context, id string) (*KnowledgeEntry, error)
func (*SQLiteKnowledgeStore) GetByCategory ¶
func (s *SQLiteKnowledgeStore) GetByCategory(ctx context.Context, userID, category string) ([]KnowledgeEntry, error)
func (*SQLiteKnowledgeStore) GetByTags ¶
func (s *SQLiteKnowledgeStore) GetByTags(ctx context.Context, userID string, tags []string) ([]KnowledgeEntry, error)
func (*SQLiteKnowledgeStore) Search ¶
func (s *SQLiteKnowledgeStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
func (*SQLiteKnowledgeStore) Update ¶
func (s *SQLiteKnowledgeStore) Update(ctx context.Context, entry KnowledgeEntry) error
type SQLitePageIndexStore ¶
type SQLitePageIndexStore struct {
// contains filtered or unexported fields
}
func NewSQLitePageIndexStore ¶
func NewSQLitePageIndexStore(store *SQLiteStore) *SQLitePageIndexStore
func (*SQLitePageIndexStore) CountByUser ¶
func (*SQLitePageIndexStore) Delete ¶
func (s *SQLitePageIndexStore) Delete(ctx context.Context, userID, id string) error
func (*SQLitePageIndexStore) DeleteByKinds ¶
func (s *SQLitePageIndexStore) DeleteByKinds(ctx context.Context, userID string, kinds []PageIndexKind) error
func (*SQLitePageIndexStore) DeleteByUser ¶
func (s *SQLitePageIndexStore) DeleteByUser(ctx context.Context, userID string) error
func (*SQLitePageIndexStore) Search ¶
func (s *SQLitePageIndexStore) Search(ctx context.Context, userID, query string, opts *PageIndexSearchOptions) ([]PageIndexHit, error)
func (*SQLitePageIndexStore) Upsert ¶
func (s *SQLitePageIndexStore) Upsert(ctx context.Context, doc PageIndexDoc) error
type SQLitePreferenceStore ¶
type SQLitePreferenceStore struct {
// contains filtered or unexported fields
}
func NewSQLitePreferenceStore ¶
func NewSQLitePreferenceStore(store *SQLiteStore) *SQLitePreferenceStore
func (*SQLitePreferenceStore) Clear ¶
func (s *SQLitePreferenceStore) Clear(ctx context.Context, userID string) error
func (*SQLitePreferenceStore) Delete ¶
func (s *SQLitePreferenceStore) Delete(ctx context.Context, userID, category, key string) error
func (*SQLitePreferenceStore) Get ¶
func (s *SQLitePreferenceStore) Get(ctx context.Context, userID, category, key string) (*Preference, error)
func (*SQLitePreferenceStore) GetAllAsMap ¶
func (*SQLitePreferenceStore) GetByCategory ¶
func (s *SQLitePreferenceStore) GetByCategory(ctx context.Context, userID, category string) ([]Preference, error)
func (*SQLitePreferenceStore) GetByUser ¶
func (s *SQLitePreferenceStore) GetByUser(ctx context.Context, userID string) ([]Preference, error)
func (*SQLitePreferenceStore) Search ¶
func (s *SQLitePreferenceStore) Search(ctx context.Context, userID string, opts *SearchOptions) (*SearchResult, error)
func (*SQLitePreferenceStore) Set ¶
func (s *SQLitePreferenceStore) Set(ctx context.Context, pref Preference) error
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
func NewSQLiteStore ¶
func NewSQLiteStore(dbPath string) (*SQLiteStore, error)
func NewSQLiteStoreFromDB ¶
func NewSQLiteStoreFromDB(db *sql.DB) (*SQLiteStore, error)
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) DB ¶
func (s *SQLiteStore) DB() *sql.DB
type SearchOptions ¶
type SearchOptions = typescore.SearchOptions
type SearchResult ¶
type SearchResult = typescore.SearchResult
Click to show internal directories.
Click to hide internal directories.