mirror of
https://github.com/docker/docker-agent.git
synced 2026-11-06 15:07:58 +00:00
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
860 B
Go
27 lines
860 B
Go
package database
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
ErrEmptyID = errors.New("memory ID cannot be empty")
|
|
ErrMemoryNotFound = errors.New("memory not found")
|
|
)
|
|
|
|
type UserMemory struct {
|
|
ID string `json:"id" description:"The ID of the memory"`
|
|
CreatedAt string `json:"created_at" description:"The creation timestamp of the memory"`
|
|
Memory string `json:"memory" description:"The content of the memory"`
|
|
Category string `json:"category,omitempty" description:"The category of the memory"`
|
|
}
|
|
|
|
type Database interface {
|
|
AddMemory(ctx context.Context, memory UserMemory) error
|
|
GetMemories(ctx context.Context) ([]UserMemory, error)
|
|
DeleteMemory(ctx context.Context, memory UserMemory) error
|
|
SearchMemories(ctx context.Context, query, category string) ([]UserMemory, error)
|
|
UpdateMemory(ctx context.Context, memory UserMemory) error
|
|
}
|