Versions in this module Expand all Collapse all v0 v0.3.0 Jun 11, 2026 Changes in this version + const AttrActionName + const AttrActionType + const AttrAttempt + const AttrDecisionType + const AttrLabels + const AttrOutcome + const AttrPolicyName + const AttrPolicyType + const AttrRuleID + const DecisionHalt + const DecisionProceed + const DecisionRetry + const DecisionRoute + const EntityInput + const EntityOutput + const KeyContext + const KeyDecision + const KeyFeedback + const KeyHistory + const KeyLatencyMs + const KeyModel + const KeyNextStep + const KeyPrevFeedback + const KeyRiskScore + const KeySummary + const KeyTraceID + const OutcomeHalt + const OutcomeProceed + const OutcomeSuccess + const PredHalt + const PredRetry + const PredRoute + const PredViolation + const PrefixPromptConfig + const SpanMemory + const SpanPostCheck + const SpanPreCheck + var ErrAlignment = errors.New("alignment error") + var ErrInputValidation = errors.New("input validation error") + var ErrPolicyViolation = errors.New("policy violation") + var ErrSupervisorFailure = errors.New("supervisor failure") + var ErrSystemError = errors.New("system error") + func ContextFacts(ctx context.Context) map[string]string + func ContextWithLogger(ctx context.Context, l Logger) context.Context + func GetParentID(ctx context.Context) (string, bool) + func IsAlignmentError(err error) bool + func IsInputError(err error) bool + func IsPolicyViolationError(err error) bool + func IsSupervisorError(err error) bool + func WithFact(ctx context.Context, key, value string) context.Context + func WithParentID(ctx context.Context, id string) context.Context + type Action interface + Execute func(ctx context.Context, input Envelope) (Envelope, error) + Metadata func() ActionMetadata + type ActionEnvelope struct + Arguments map[string]interface{} + Name string + SessionID string + func NewActionEnvelope(name string, args map[string]interface{}) *ActionEnvelope + func (a *ActionEnvelope) WithSessionID(sessionID string) *ActionEnvelope + type ActionMetadata struct + InputContentType ContentType + InputType string + IsDynamic bool + Name string + OutputType string + Type string + type AgentMemory interface + Append func(ctx context.Context, sessionID string, msgs []Message) error + Init func(ctx context.Context) error + Memorize func(ctx context.Context, query string, answer string) error + Read func(ctx context.Context, sessionID string) ([]Message, error) + Recall func(ctx context.Context, query string) (string, error) + type AgentMemoryWithFacts interface + RecallWithFacts func(ctx context.Context, query string) (string, map[string]any, error) + type AlignmentError struct + Message string + RuleID string + func NewAlignmentError(message, ruleID string) *AlignmentError + func (e *AlignmentError) Error() string + func (e *AlignmentError) Is(target error) bool + func (e *AlignmentError) Unwrap() error + type Answer struct + Meta map[string]any + Text string + type Atom struct + Object string + OriginIntent IntentStr + Predicate string + Subject string + Weight float64 + type AuditRecord struct + FactCount int + LatencyMs int64 + MatchedCount int + Outcome string + Rules []RuleSnapshot + Step int + Timestamp string + func NewAuditRecordFromTrail(trail *AuditTrail, step int, outcome string) AuditRecord + type AuditTrail struct + EngineID string + FactCount int + LatencyMs int64 + MatchedCount int + MatchedRules []RuleInference + Query string + Timestamp time.Time + func NewAuditTrail(engineID, query string) *AuditTrail + func (a *AuditTrail) AddRule(ruleName, definition, sourceFile, predicate string, tier Tier, ...) + func (a *AuditTrail) Summary() string + type Breaker interface + Execute func(req func() (any, error)) (any, error) + Name func() string + type ConfigEvent struct + Content []byte + Key string + Type string + type ContentType string + const TypeJSON + const TypeStruct + type ConversationHistory struct + Messages []Message + type Decision struct + Action *ActionEnvelope + AuditTrail *AuditTrail + Meta map[string]string + Outcome string + Reasons []string + Target string + type Document struct + Content string + ID string + Metadata map[string]any + Score float32 + Vector []float32 + type EdgeDef struct + Condition string + From string + To string + type Embedder interface + Dimension func() int + Embed func(ctx context.Context, text string) ([]float32, error) + EmbedBatch func(ctx context.Context, texts []string) ([][]float32, error) + type Envelope struct + ContentType ContentType + ContextFacts []Quad + Error error + Facts []string + ID uuid.UUID + Metadata map[string]any + Payload any + SecurityLabels []string + Violations []ViolationRule + func NewEnvelope(payload any) Envelope + func (e *Envelope) AddLabel(label string) + func (e *Envelope) GetFeedback() string + func (e *Envelope) GetMeta(k string) string + func (e *Envelope) HasLabel(label string) bool + func (e *Envelope) MergeLabels(other []string) + func (e *Envelope) SetFeedback(msg string) + func (e *Envelope) SetHistory(msgs []Message) + func (e *Envelope) SetMeta(k string, v any) + type Evaluator interface + Assess func(ctx context.Context, actionMeta ActionMetadata, input Envelope) error + AssessPlan func(ctx context.Context, input Envelope) (Decision, error) + CheckRequirement func(ctx context.Context, input Envelope, reqName string) (bool, error) + EvaluateSteering func(ctx context.Context, input Envelope) (string, map[string]string, error) + GetActionConfig func(ctx context.Context, input Envelope) (map[string]string, error) + LoadFacts func(facts []string) error + LoadGherkinPolicy func(ctx context.Context, featureContent string) error + LoadPolicy func(ctx context.Context, source string) error + Logger func() Logger + Query func(ctx context.Context, facts []string, queryStr string) ([]map[string]string, error) + Reflect func(ctx context.Context, actionMeta ActionMetadata, output Envelope) (Envelope, error) + RegisterAction func(meta ActionMetadata) error + type ExecutionContext struct + CurrentHistory []Message + FeedbackHistory []string + RetryCount int + type Extractor interface + Extract func(ctx context.Context, input string, schema any) error + type FactLoader interface + LoadFacts func(ctx context.Context, source string) ([]string, error) + type GenerateOption func(o *GenerationConfig) + type GenerationConfig struct + JSONMode bool + MaxTokens int + Metadata map[string]any + Model string + OutputType any + StopSequences []string + Temperature float64 + TopP float64 + type HistoryStore interface + Append func(ctx context.Context, sessionID string, msgs []Message) error + Read func(ctx context.Context, sessionID string) ([]Message, error) + type InputError struct + Err error + func WrapInputError(err error) *InputError + func (e *InputError) Error() string + func (e *InputError) Is(target error) bool + func (e *InputError) Unwrap() error + type IntentStr string + type LLMResponse struct + Text string + Usage map[string]int + type Logger interface + Debug func(msg string, fields ...any) + Error func(msg string, fields ...any) + Info func(msg string, fields ...any) + Warn func(msg string, fields ...any) + With func(fields ...any) Logger + func LoggerFromContext(ctx context.Context) Logger + type MemoryMode string + const MemoryModeNone + const MemoryModePersist + const MemoryModeTransient + type Message struct + Content string + Role string + type Meter interface + Counter func(name string, val int64, tags map[string]string) + Histogram func(name string, val float64, tags map[string]string) + type NodeDef struct + AgentRole string + Config map[string]interface{} + ID string + TaskType string + type NodeResult struct + AgentID string + Duration time.Duration + Error error + Input interface{} + NodeID string + Output interface{} + RetryCount int + StartTime time.Time + type NopEmbedder struct + func (n NopEmbedder) Dimension() int + func (n NopEmbedder) Embed(_ context.Context, _ string) ([]float32, error) + func (n NopEmbedder) EmbedBatch(_ context.Context, _ []string) ([][]float32, error) + type NopLogger struct + func (NopLogger) Debug(msg string, fields ...any) + func (NopLogger) Error(msg string, fields ...any) + func (NopLogger) Info(msg string, fields ...any) + func (NopLogger) Warn(msg string, fields ...any) + func (n NopLogger) With(fields ...any) Logger + type NopSpan struct + func (n *NopSpan) End() + func (n *NopSpan) RecordError(err error) + func (n *NopSpan) SetAttributes(attributes map[string]any) + func (n *NopSpan) SetStatus(code string, msg string) + type NopStore struct + func (n NopStore) Append(_ context.Context, _ string, _ []Message) error + func (n NopStore) Read(_ context.Context, _ string) ([]Message, error) + type NopTracer struct + func (n *NopTracer) Start(ctx context.Context, name string) (context.Context, Span) + type NopVectorStore struct + func (n NopVectorStore) Get(_ context.Context, _ string) (string, error) + func (n NopVectorStore) Search(_ context.Context, _ string, _ int) ([]string, error) + func (n NopVectorStore) Upsert(_ context.Context, _ string, _ string) error + type PolicyViolationError struct + RuleID string + Suggestion string + Tier string + Violation string + func NewPolicyViolationError(tier, ruleID, violation, suggestion string) *PolicyViolationError + func (e *PolicyViolationError) Error() string + func (e *PolicyViolationError) Is(target error) bool + func (e *PolicyViolationError) Unwrap() error + type PreProcessor interface + Process func(ctx context.Context, input Envelope) (map[string]any, error) + type Quad struct + Graph string + Object string + Predicate string + Subject string + type Query struct + Meta map[string]any + Text string + type ResourceMonitor interface + CheckBudget func(ctx context.Context, key string, cost int) (bool, error) + CountTokens func(ctx context.Context, text string) (int, error) + type RiskEngine interface + CalculateRisk func(ctx context.Context, input Envelope) (float64, error) + type RuleInference struct + Bindings map[string]string + Definition string + Predicate string + RuleName string + SourceFile string + Tier Tier + type RuleSnapshot struct + Bindings map[string]string + Definition string + Predicate string + RuleName string + SourceFile string + Tier string + type SessionState struct + ActiveEnvelope Envelope + AuditRecords []AuditRecord + ExecutionCtx ExecutionContext + LogicalFacts []string + PayloadType string + SessionID string + func (s *SessionState) Clone() *SessionState + func (s *SessionState) MarshalJSON() ([]byte, error) + func (s *SessionState) UnmarshalJSON(data []byte) error + func (s *SessionState) Validate() error + type Span interface + End func() + RecordError func(err error) + SetAttributes func(attributes map[string]any) + SetStatus func(code string, msg string) + type StateManager interface + Checkpoint func(ctx context.Context, state *SessionState) error + ExtractFacts func(ctx context.Context, envelope Envelope) ([]string, error) + Hydrate func(ctx context.Context, sessionID string) (*SessionState, error) + type StateProvider interface + Close func(ctx context.Context) error + Delete func(ctx context.Context, sessionID string) error + Get func(ctx context.Context, sessionID string) (any, error) + Set func(ctx context.Context, sessionID string, state any) error + type StreamChunk struct + Err error + Text string + type SupervisorError struct + Reason error + func (e *SupervisorError) Error() string + func (e *SupervisorError) Is(target error) bool + func (e *SupervisorError) Unwrap() error + type TextGenerator interface + Complete func(ctx context.Context, prompt string) (string, error) + Generate func(ctx context.Context, prompt string, opts ...GenerateOption) (*LLMResponse, error) + Stream func(ctx context.Context, prompt string) (<-chan StreamChunk, error) + type Tier string + const TierT0_Axiom + const TierT1_Governance + const TierT2_Playbook + const TierT3_User + const TierUnknown + type Tracer interface + Start func(ctx context.Context, name string) (context.Context, Span) + type ValidationError struct + Field string + Message string + func (e *ValidationError) Error() string + type VectorStore interface + Get func(ctx context.Context, id string) (string, error) + Search func(ctx context.Context, query string, topK int) ([]string, error) + Upsert func(ctx context.Context, id string, content string) error + type ViolationRule struct + Description string + RuleID string + Severity int + type WorkflowDef struct + Edges []EdgeDef + ID string + Name string + Nodes map[string]NodeDef + RootNodeID string + Version string + func (w *WorkflowDef) FindStartNode() *NodeDef + func (w *WorkflowDef) GetNode(nodeID string) *NodeDef + func (w *WorkflowDef) GetOutgoingEdges(nodeID string) []EdgeDef + func (w *WorkflowDef) Validate() error + type WorkflowInstance struct + CompletedNodes []string + CurrentNodeID string + FailedNodes []string + LoopCounters map[string]int + Metadata map[string]string + SessionID string + StartedAt time.Time + Status WorkflowInstanceStatus + UpdatedAt time.Time + Variables map[string]interface{} + WorkflowID string + func NewWorkflowInstance(workflowID, sessionID string) *WorkflowInstance + func (wi *WorkflowInstance) GetCounter(name string) int + func (wi *WorkflowInstance) GetVariable(key string) interface{} + func (wi *WorkflowInstance) IncrementCounter(name string) int + func (wi *WorkflowInstance) IsNodeCompleted(nodeID string) bool + func (wi *WorkflowInstance) MarkNodeCompleted(nodeID string) + func (wi *WorkflowInstance) MarkNodeFailed(nodeID string) + func (wi *WorkflowInstance) SessionKey() string + func (wi *WorkflowInstance) SetCurrentNode(nodeID string) + func (wi *WorkflowInstance) SetVariable(key string, value interface{}) + type WorkflowInstanceStatus string + const WorkflowInstanceStatusCompleted + const WorkflowInstanceStatusFailed + const WorkflowInstanceStatusPaused + const WorkflowInstanceStatusPending + const WorkflowInstanceStatusRunning + type WorkflowResult struct + EndTime time.Time + Error error + NodeResults map[string]*NodeResult + Output interface{} + StartTime time.Time + Status WorkflowStatus + WorkflowID string + type WorkflowStatus string + const WorkflowStatusCancelled + const WorkflowStatusCompleted + const WorkflowStatusFailed + const WorkflowStatusPending + const WorkflowStatusRunning