memory

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

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

func New

func New() *Memory

func (*Memory) ArchiveKnowledge added in v0.8.0

func (r *Memory) ArchiveKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug) error

func (*Memory) BatchGetAlerts

func (r *Memory) BatchGetAlerts(ctx context.Context, alertIDs []types.AlertID) (alert.Alerts, error)

func (*Memory) BatchGetTickets

func (r *Memory) BatchGetTickets(ctx context.Context, ticketIDs []types.TicketID) ([]*ticket.Ticket, error)

func (*Memory) BatchPutAlerts

func (r *Memory) BatchPutAlerts(ctx context.Context, alerts alert.Alerts) error

func (*Memory) BatchSaveAgentMemories added in v0.8.0

func (r *Memory) BatchSaveAgentMemories(ctx context.Context, memories []*memory.AgentMemory) error

BatchSaveAgentMemories saves multiple agent memories in a batch

func (*Memory) BatchUpdateTicketsStatus

func (r *Memory) BatchUpdateTicketsStatus(ctx context.Context, ticketIDs []types.TicketID, status types.TicketStatus) error

func (*Memory) BindAlertsToTicket

func (r *Memory) BindAlertsToTicket(ctx context.Context, alertIDs []types.AlertID, ticketID types.TicketID) error

func (*Memory) CalculateKnowledgeSize added in v0.8.0

func (r *Memory) CalculateKnowledgeSize(ctx context.Context, topic types.KnowledgeTopic) (int, error)

func (*Memory) CountActivities

func (r *Memory) CountActivities(ctx context.Context) (int, error)

func (*Memory) CountAlertsWithoutTicket

func (r *Memory) CountAlertsWithoutTicket(ctx context.Context) (int, error)

func (*Memory) CountTicketComments

func (r *Memory) CountTicketComments(ctx context.Context, ticketID types.TicketID) (int, error)

func (*Memory) CountTicketsByStatus

func (r *Memory) CountTicketsByStatus(ctx context.Context, statuses []types.TicketStatus) (int, error)

func (*Memory) CreateNotice

func (r *Memory) CreateNotice(ctx context.Context, notice *notice.Notice) error

func (*Memory) CreateTagWithID

func (r *Memory) CreateTagWithID(ctx context.Context, tag *tag.Tag) error

func (*Memory) DeleteAgentMemoriesBatch added in v0.6.2

func (r *Memory) DeleteAgentMemoriesBatch(ctx context.Context, agentID string, memoryIDs []types.AgentMemoryID) (int, error)

DeleteAgentMemoriesBatch deletes multiple agent memories in a batch Returns the number of successfully deleted memories

func (*Memory) DeleteSession added in v0.8.0

func (r *Memory) DeleteSession(ctx context.Context, sessionID types.SessionID) error

func (*Memory) DeleteTagByID

func (r *Memory) DeleteTagByID(ctx context.Context, tagID string) error

func (*Memory) DeleteToken

func (r *Memory) DeleteToken(ctx context.Context, tokenID auth.TokenID) error

func (*Memory) FindNearestAlerts

func (r *Memory) FindNearestAlerts(ctx context.Context, embedding []float32, limit int) (alert.Alerts, error)

func (*Memory) FindNearestTickets

func (r *Memory) FindNearestTickets(ctx context.Context, embedding []float32, limit int) ([]*ticket.Ticket, error)

func (*Memory) FindNearestTicketsWithSpan

func (r *Memory) FindNearestTicketsWithSpan(ctx context.Context, embedding []float32, begin, end time.Time, limit int) ([]*ticket.Ticket, error)

func (*Memory) FindSimilarAlerts

func (r *Memory) FindSimilarAlerts(ctx context.Context, target alert.Alert, limit int) (alert.Alerts, error)

func (*Memory) GetActivities

func (r *Memory) GetActivities(ctx context.Context, offset, limit int) ([]*activity.Activity, error)

func (*Memory) GetAgentMemory

func (r *Memory) GetAgentMemory(ctx context.Context, agentID string, id types.AgentMemoryID) (*memory.AgentMemory, error)

GetAgentMemory retrieves an agent memory record by agentID and memoryID

func (*Memory) GetAlert

func (r *Memory) GetAlert(ctx context.Context, alertID types.AlertID) (*alert.Alert, error)

func (*Memory) GetAlertList

func (r *Memory) GetAlertList(ctx context.Context, listID types.AlertListID) (*alert.List, error)

func (*Memory) GetAlertListByThread

func (r *Memory) GetAlertListByThread(ctx context.Context, thread slack.Thread) (*alert.List, error)

func (*Memory) GetAlertListsInThread

func (r *Memory) GetAlertListsInThread(ctx context.Context, thread slack.Thread) ([]*alert.List, error)

func (*Memory) GetAlertWithoutEmbedding

func (r *Memory) GetAlertWithoutEmbedding(ctx context.Context) (alert.Alerts, error)

func (*Memory) GetAlertWithoutTicket

func (r *Memory) GetAlertWithoutTicket(ctx context.Context, offset, limit int) (alert.Alerts, error)

func (*Memory) GetAlertsBySpan

func (r *Memory) GetAlertsBySpan(ctx context.Context, begin, end time.Time) (alert.Alerts, error)

func (*Memory) GetAlertsByThread

func (r *Memory) GetAlertsByThread(ctx context.Context, thread slack.Thread) (alert.Alerts, error)

func (*Memory) GetAlertsWithInvalidEmbedding

func (r *Memory) GetAlertsWithInvalidEmbedding(ctx context.Context) (alert.Alerts, error)

func (*Memory) GetAllCallCounts

func (r *Memory) GetAllCallCounts() map[string]int

GetAllCallCounts returns a copy of all call counts

func (*Memory) GetCallCount

func (r *Memory) GetCallCount(methodName string) int

GetCallCount returns the number of times a method has been called

func (*Memory) GetKnowledge added in v0.8.0

func (r *Memory) GetKnowledge(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug) (*knowledge.Knowledge, error)

func (*Memory) GetKnowledgeByCommit added in v0.8.0

func (r *Memory) GetKnowledgeByCommit(ctx context.Context, topic types.KnowledgeTopic, slug types.KnowledgeSlug, commitID string) (*knowledge.Knowledge, error)

func (*Memory) GetKnowledges added in v0.8.0

func (r *Memory) GetKnowledges(ctx context.Context, topic types.KnowledgeTopic) ([]*knowledge.Knowledge, error)

func (*Memory) GetLatestAlertByThread

func (r *Memory) GetLatestAlertByThread(ctx context.Context, thread slack.Thread) (*alert.Alert, error)

func (*Memory) GetLatestAlertListInThread

func (r *Memory) GetLatestAlertListInThread(ctx context.Context, thread slack.Thread) (*alert.List, error)

func (*Memory) GetLatestHistory

func (r *Memory) GetLatestHistory(ctx context.Context, ticketID types.TicketID) (*ticket.History, error)

func (*Memory) GetNotice

func (r *Memory) GetNotice(ctx context.Context, id types.NoticeID) (*notice.Notice, error)

func (*Memory) GetOrCreateTagByName

func (r *Memory) GetOrCreateTagByName(ctx context.Context, name, description, color, createdBy string) (*tag.Tag, error)

GetOrCreateTagByName atomically gets an existing tag or creates a new one

func (*Memory) GetSession added in v0.8.0

func (r *Memory) GetSession(ctx context.Context, sessionID types.SessionID) (*session.Session, error)

func (*Memory) GetSessionMessages added in v0.8.0

func (r *Memory) GetSessionMessages(ctx context.Context, sessionID types.SessionID) ([]*session.Message, error)

func (*Memory) GetSessionsByTicket added in v0.8.0

func (r *Memory) GetSessionsByTicket(ctx context.Context, ticketID types.TicketID) ([]*session.Session, error)

func (*Memory) GetTagByID

func (r *Memory) GetTagByID(ctx context.Context, tagID string) (*tag.Tag, error)

func (*Memory) GetTagByName

func (r *Memory) GetTagByName(ctx context.Context, name string) (*tag.Tag, error)

func (*Memory) GetTagsByIDs

func (r *Memory) GetTagsByIDs(ctx context.Context, tagIDs []string) ([]*tag.Tag, error)

func (*Memory) GetTicket

func (r *Memory) GetTicket(ctx context.Context, ticketID types.TicketID) (*ticket.Ticket, error)

func (*Memory) GetTicketByThread

func (r *Memory) GetTicketByThread(ctx context.Context, thread slack.Thread) (*ticket.Ticket, error)

func (*Memory) GetTicketComments

func (r *Memory) GetTicketComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)

func (*Memory) GetTicketCommentsPaginated

func (r *Memory) GetTicketCommentsPaginated(ctx context.Context, ticketID types.TicketID, offset, limit int) ([]ticket.Comment, error)

func (*Memory) GetTicketUnpromptedComments

func (r *Memory) GetTicketUnpromptedComments(ctx context.Context, ticketID types.TicketID) ([]ticket.Comment, error)

func (*Memory) GetTicketsBySpan

func (r *Memory) GetTicketsBySpan(ctx context.Context, start, end time.Time) ([]*ticket.Ticket, error)

func (*Memory) GetTicketsByStatus

func (r *Memory) GetTicketsByStatus(ctx context.Context, statuses []types.TicketStatus, offset, limit int) ([]*ticket.Ticket, error)

func (*Memory) GetTicketsByStatusAndSpan

func (r *Memory) GetTicketsByStatusAndSpan(ctx context.Context, status types.TicketStatus, begin, end time.Time) ([]*ticket.Ticket, error)

func (*Memory) GetTicketsWithInvalidEmbedding

func (r *Memory) GetTicketsWithInvalidEmbedding(ctx context.Context) ([]*ticket.Ticket, error)

func (*Memory) GetToken

func (r *Memory) GetToken(ctx context.Context, tokenID auth.TokenID) (*auth.Token, error)

func (*Memory) IsTagNameExists

func (r *Memory) IsTagNameExists(ctx context.Context, name string) (bool, error)

func (*Memory) ListAgentMemories added in v0.6.2

func (r *Memory) ListAgentMemories(ctx context.Context, agentID string) ([]*memory.AgentMemory, error)

ListAgentMemories lists all memories for an agent Results are ordered by CreatedAt DESC

func (*Memory) ListAgentMemoriesWithOptions added in v0.8.0

func (r *Memory) ListAgentMemoriesWithOptions(ctx context.Context, agentID string, opts interfaces.AgentMemoryListOptions) ([]*memory.AgentMemory, int, error)

ListAgentMemoriesWithOptions lists memories with filtering, sorting, and pagination

func (*Memory) ListAllAgentIDs added in v0.8.0

func (r *Memory) ListAllAgentIDs(ctx context.Context) ([]*interfaces.AgentSummary, error)

ListAllAgentIDs returns all agent IDs that have memories with their counts

func (*Memory) ListAllTags

func (r *Memory) ListAllTags(ctx context.Context) ([]*tag.Tag, error)

func (*Memory) ListKnowledgeSlugs added in v0.8.0

func (r *Memory) ListKnowledgeSlugs(ctx context.Context, topic types.KnowledgeTopic) ([]*knowledge.SlugInfo, error)

func (*Memory) ListKnowledgeTopics added in v0.8.0

func (r *Memory) ListKnowledgeTopics(ctx context.Context) ([]*knowledge.TopicSummary, error)

func (*Memory) PutActivity

func (r *Memory) PutActivity(ctx context.Context, activity *activity.Activity) error

Activity related methods

func (*Memory) PutAlert

func (r *Memory) PutAlert(ctx context.Context, alert alert.Alert) error

func (*Memory) PutAlertList

func (r *Memory) PutAlertList(ctx context.Context, list *alert.List) error

func (*Memory) PutHistory

func (r *Memory) PutHistory(ctx context.Context, ticketID types.TicketID, history *ticket.History) error

func (*Memory) PutKnowledge added in v0.8.0

func (r *Memory) PutKnowledge(ctx context.Context, k *knowledge.Knowledge) error

func (*Memory) PutSession added in v0.8.0

func (r *Memory) PutSession(ctx context.Context, sess *session.Session) error

func (*Memory) PutSessionMessage added in v0.8.0

func (r *Memory) PutSessionMessage(ctx context.Context, message *session.Message) error

func (*Memory) PutTicket

func (r *Memory) PutTicket(ctx context.Context, t ticket.Ticket) error

func (*Memory) PutTicketComment

func (r *Memory) PutTicketComment(ctx context.Context, comment ticket.Comment) error

func (*Memory) PutTicketCommentsPrompted

func (r *Memory) PutTicketCommentsPrompted(ctx context.Context, ticketID types.TicketID, commentIDs []types.CommentID) error

func (*Memory) PutToken

func (r *Memory) PutToken(ctx context.Context, token *auth.Token) error

Token related methods

func (*Memory) RemoveTagFromAllAlerts

func (r *Memory) RemoveTagFromAllAlerts(ctx context.Context, name string) error

func (*Memory) RemoveTagFromAllTickets

func (r *Memory) RemoveTagFromAllTickets(ctx context.Context, name string) error

func (*Memory) RemoveTagIDFromAllAlerts

func (r *Memory) RemoveTagIDFromAllAlerts(ctx context.Context, tagID string) error

func (*Memory) RemoveTagIDFromAllTickets

func (r *Memory) RemoveTagIDFromAllTickets(ctx context.Context, tagID string) error

func (*Memory) ResetCallCounts

func (r *Memory) ResetCallCounts()

ResetCallCounts clears all call counters

func (*Memory) SaveAgentMemory

func (r *Memory) SaveAgentMemory(ctx context.Context, mem *memory.AgentMemory) error

SaveAgentMemory saves an agent memory record

func (*Memory) SearchAlerts

func (r *Memory) SearchAlerts(ctx context.Context, path, op string, value any, limit int) (alert.Alerts, error)

func (*Memory) SearchMemoriesByEmbedding

func (r *Memory) SearchMemoriesByEmbedding(ctx context.Context, agentID string, embedding []float32, limit int) ([]*memory.AgentMemory, error)

SearchMemoriesByEmbedding searches for agent memories by embedding similarity

func (*Memory) UnbindAlertFromTicket

func (r *Memory) UnbindAlertFromTicket(ctx context.Context, alertID types.AlertID) error

func (*Memory) UpdateMemoryScore added in v0.6.2

func (r *Memory) UpdateMemoryScore(ctx context.Context, agentID string, memoryID types.AgentMemoryID, score float64, lastUsedAt time.Time) error

UpdateMemoryScore updates the quality score and last used timestamp of an agent memory

func (*Memory) UpdateMemoryScoreBatch added in v0.6.2

func (r *Memory) UpdateMemoryScoreBatch(ctx context.Context, agentID string, updates map[types.AgentMemoryID]struct {
	Score      float64
	LastUsedAt time.Time
}) error

UpdateMemoryScoreBatch updates quality scores and last used timestamps for multiple agent memories

func (*Memory) UpdateNotice

func (r *Memory) UpdateNotice(ctx context.Context, notice *notice.Notice) error

func (*Memory) UpdateTag

func (r *Memory) UpdateTag(ctx context.Context, tag *tag.Tag) error

Jump to

Keyboard shortcuts

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