- models/agentdecision.go: AgentDecision GORM model (context/decision as jsonb, reasoning as text) - migrations/migrate.go: AutoMigrate AgentDecision then ALTER TABLE to add vector(1536) column and CREATE ivfflat index via raw SQL - controllers/agentDecisionController.go: CreateAgentDecision, FindSimilarDecisions (cosine distance), UpdateDecisionOutcome - routes/routes.go: three routes under /api/v1/internal (InternalKeyAuth applied at group level) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
470 B
Go
16 lines
470 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type AgentDecision struct {
|
|
ID uint64 `gorm:"primaryKey"`
|
|
DecisionType string `gorm:"size:50;index"`
|
|
BookingID *uint64 `gorm:"index"`
|
|
Context string `gorm:"type:jsonb"`
|
|
Decision string `gorm:"type:jsonb"`
|
|
Reasoning string `gorm:"type:text"`
|
|
Outcome *string `gorm:"size:30;index"`
|
|
OutcomeRecordedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|