Feat: minimize top commands agent-clip style

This commit is contained in:
Grail Finder
2026-03-14 10:28:04 +03:00
parent 13773bcc97
commit 2901208c80
4 changed files with 1586 additions and 641 deletions

View File

@@ -6,6 +6,7 @@ type Memories interface {
Memorise(m *models.Memory) (*models.Memory, error)
Recall(agent, topic string) (string, error)
RecallTopics(agent string) ([]string, error)
Forget(agent, topic string) error
}
func (p ProviderSQL) Memorise(m *models.Memory) (*models.Memory, error) {
@@ -52,3 +53,13 @@ func (p ProviderSQL) RecallTopics(agent string) ([]string, error) {
}
return topics, nil
}
func (p ProviderSQL) Forget(agent, topic string) error {
query := "DELETE FROM memories WHERE agent = $1 AND topic = $2"
_, err := p.db.Exec(query, agent, topic)
if err != nil {
p.logger.Error("failed to delete memory", "query", query, "error", err)
return err
}
return nil
}