Documentation
¶
Index ¶
- type DBTX
- type GetAssistantMemoryByIDParams
- type GetAssistantMemoryByIDRow
- type GetNearestActiveAssistantMemoryParams
- type GetNearestActiveAssistantMemoryRow
- type InsertAssistantMemoryParams
- type InsertAssistantMemoryRow
- type ListAssistantMemoriesForAdminParams
- type ListAssistantMemoriesForAdminRow
- type ListNearestAssistantMemoriesParams
- type ListNearestAssistantMemoriesRow
- type Queries
- func (q *Queries) BumpAssistantMemoryLastAccess(ctx context.Context, ids []uuid.UUID) error
- func (q *Queries) CountActiveAssistantMemories(ctx context.Context, assistantID uuid.UUID) (int64, error)
- func (q *Queries) GetAssistantMemoryByID(ctx context.Context, arg GetAssistantMemoryByIDParams) (GetAssistantMemoryByIDRow, error)
- func (q *Queries) GetNearestActiveAssistantMemory(ctx context.Context, arg GetNearestActiveAssistantMemoryParams) (GetNearestActiveAssistantMemoryRow, error)
- func (q *Queries) InsertAssistantMemory(ctx context.Context, arg InsertAssistantMemoryParams) (InsertAssistantMemoryRow, error)
- func (q *Queries) ListAssistantMemoriesForAdmin(ctx context.Context, arg ListAssistantMemoriesForAdminParams) ([]ListAssistantMemoriesForAdminRow, error)
- func (q *Queries) ListNearestAssistantMemories(ctx context.Context, arg ListNearestAssistantMemoriesParams) ([]ListNearestAssistantMemoriesRow, error)
- func (q *Queries) LockAssistantForMemoryWrite(ctx context.Context, assistantID string) error
- func (q *Queries) MarkAssistantMemorySuperseded(ctx context.Context, id uuid.UUID) error
- func (q *Queries) ReapSoftDeletedAssistantMemoriesOlderThan(ctx context.Context, cutoff pgtype.Timestamptz) (int64, error)
- func (q *Queries) SoftDeleteAssistantMemory(ctx context.Context, id uuid.UUID) (SoftDeleteAssistantMemoryRow, error)
- func (q *Queries) SoftDeleteAssistantMemoryByProject(ctx context.Context, arg SoftDeleteAssistantMemoryByProjectParams) (SoftDeleteAssistantMemoryByProjectRow, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SoftDeleteAssistantMemoryByProjectParams
- type SoftDeleteAssistantMemoryByProjectRow
- type SoftDeleteAssistantMemoryRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetAssistantMemoryByIDRow ¶
type GetAssistantMemoryByIDRow struct {
ID uuid.UUID
AssistantID uuid.NullUUID
ProjectID uuid.NullUUID
OrganizationID string
Content string
SupersedesID uuid.NullUUID
SupersededAt pgtype.Timestamptz
ValidAt pgtype.Timestamptz
Tags []string
OriginThreadID uuid.NullUUID
OriginChatID uuid.NullUUID
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
LastAccess pgtype.Timestamptz
DeletedAt pgtype.Timestamptz
}
type GetNearestActiveAssistantMemoryParams ¶
type GetNearestActiveAssistantMemoryParams struct {
QueryEmbedding pgvector_go.HalfVector
AssistantID uuid.UUID
}
type InsertAssistantMemoryRow ¶
type InsertAssistantMemoryRow struct {
ID uuid.UUID
CreatedAt pgtype.Timestamptz
}
type ListAssistantMemoriesForAdminRow ¶
type ListAssistantMemoriesForAdminRow struct {
ID uuid.UUID
AssistantID uuid.NullUUID
ProjectID uuid.NullUUID
OrganizationID string
Content string
SupersedesID uuid.NullUUID
SupersededAt pgtype.Timestamptz
ValidAt pgtype.Timestamptz
Tags []string
OriginThreadID uuid.NullUUID
OriginChatID uuid.NullUUID
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
LastAccess pgtype.Timestamptz
DeletedAt pgtype.Timestamptz
}
type ListNearestAssistantMemoriesParams ¶
type ListNearestAssistantMemoriesParams struct {
QueryEmbedding pgvector_go.HalfVector
AssistantID uuid.UUID
Tags []string
ResultLimit int32
}
type ListNearestAssistantMemoriesRow ¶
type ListNearestAssistantMemoriesRow struct {
ID uuid.UUID
Content string
Tags []string
CreatedAt pgtype.Timestamptz
LastAccess pgtype.Timestamptz
Similarity float64
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) BumpAssistantMemoryLastAccess ¶
func (*Queries) CountActiveAssistantMemories ¶
func (*Queries) GetAssistantMemoryByID ¶
func (q *Queries) GetAssistantMemoryByID(ctx context.Context, arg GetAssistantMemoryByIDParams) (GetAssistantMemoryByIDRow, error)
Fetches a row by id scoped to a project, without a soft-delete filter so the management API can expose deleted rows when include_deleted=true; callers filter in Go. Embedding column is omitted to keep payloads small.
func (*Queries) GetNearestActiveAssistantMemory ¶
func (q *Queries) GetNearestActiveAssistantMemory(ctx context.Context, arg GetNearestActiveAssistantMemoryParams) (GetNearestActiveAssistantMemoryRow, error)
Top-1 nearest active memory for an assistant, used by Remember to dedup against the closest existing memory regardless of tag.
func (*Queries) InsertAssistantMemory ¶
func (q *Queries) InsertAssistantMemory(ctx context.Context, arg InsertAssistantMemoryParams) (InsertAssistantMemoryRow, error)
func (*Queries) ListAssistantMemoriesForAdmin ¶
func (q *Queries) ListAssistantMemoriesForAdmin(ctx context.Context, arg ListAssistantMemoriesForAdminParams) ([]ListAssistantMemoriesForAdminRow, error)
Management API listing for an assistant scoped to its project. Returns superseded rows because they are part of the audit trail. Filters:
- tags overlap (skipped when an empty array is passed)
- include_deleted=false restricts to live rows
Cursor pagination is keyset on (created_at DESC, id DESC). Embedding column is omitted to keep payloads small.
func (*Queries) ListNearestAssistantMemories ¶
func (q *Queries) ListNearestAssistantMemories(ctx context.Context, arg ListNearestAssistantMemoriesParams) ([]ListNearestAssistantMemoriesRow, error)
Top-K nearest active memories with an optional tag overlap filter. Caller passes an empty array to skip the tag filter; otherwise rows must overlap.
func (*Queries) LockAssistantForMemoryWrite ¶
Acquire a transaction-scoped advisory lock keyed on the assistant ID so Remember/Forget mutations on the same assistant serialize across processes.
func (*Queries) MarkAssistantMemorySuperseded ¶
func (*Queries) ReapSoftDeletedAssistantMemoriesOlderThan ¶
func (q *Queries) ReapSoftDeletedAssistantMemoriesOlderThan(ctx context.Context, cutoff pgtype.Timestamptz) (int64, error)
Hard-deletes all rows whose deleted_at is older than the cutoff, plus every predecessor reachable via the supersedes_id chain. The recursive CTE walks backwards from each soft-deleted head so historical superseded rows that only existed to support the deleted head also drop on the same schedule.
func (*Queries) SoftDeleteAssistantMemory ¶
func (q *Queries) SoftDeleteAssistantMemory(ctx context.Context, id uuid.UUID) (SoftDeleteAssistantMemoryRow, error)
Returns the deleted row's audit-relevant fields so callers do not need a separate SELECT for the audit log entry.
func (*Queries) SoftDeleteAssistantMemoryByProject ¶
func (q *Queries) SoftDeleteAssistantMemoryByProject(ctx context.Context, arg SoftDeleteAssistantMemoryByProjectParams) (SoftDeleteAssistantMemoryByProjectRow, error)
Project-scoped variant for the management API: filters on (id, project_id) so a delete cannot escape the caller's project boundary.