decisions

package
v0.0.0-...-d59b4eb Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package decisions reads and writes the agent's memory journal (the `decisions` table) in CockroachDB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

type Decision struct {
	ID              uuid.UUID
	ActionType      string
	TriggerSource   string
	ReasoningText   string
	Embedding       []float32 // len 1536, produced by node-orchestrator via Bedrock Titan
	Confidence      float64
	MCPContext      []byte // raw JSON
	SkillsConsulted []string
	CcloudCommand   string
	Status          string
}

type Store

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

func NewStore

func NewStore(ctx context.Context, connString string) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) MarkExecuted

func (s *Store) MarkExecuted(ctx context.Context, id uuid.UUID, outcome string) error

MarkExecuted updates a decision after a human approves it and the ccloud command has actually run.

func (*Store) RecordDecision

func (s *Store) RecordDecision(ctx context.Context, d Decision) (uuid.UUID, error)

RecordDecision inserts a new row with status='proposed'. The embedding is expected to already be computed (node-orchestrator calls Bedrock for this before invoking this method) — this package doesn't call Bedrock itself to keep the Go service focused on CockroachDB + ccloud + MCP.

func (*Store) SimilarDecisions

func (s *Store) SimilarDecisions(ctx context.Context, queryEmbedding []float32, limit int) ([]Decision, error)

SimilarDecisions is the heart of the "why journal" — semantic search over past reasoning using CockroachDB's distributed vector index. queryEmbedding is the embedding of the user's question (e.g. "why did you scale up last week"), also computed via Bedrock in node-orchestrator.

Jump to

Keyboard shortcuts

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