goncho

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 78 Imported by: 0

Documentation

Overview

Package goncho provides high-trust local memory for Go-native AI agent runtimes.

Goncho is an embedded memory kernel, not a hosted memory service. It stores local evidence, derives scoped recall, assembles context, records review signals, and helps callers verify remembered claims before an agent acts on them. The core operating rule is evidence before belief and verification before action: memory can orient an agent, but current evidence decides whether an action is safe.

Use Goncho when an agent host needs durable local state, auditable recall, scoped peer/session memory, review queues, stale-claim warnings, and deterministic benchmark evidence without a Python service, Docker sidecar, hosted vector database, or always-online memory API.

Install the library with:

go get github.com/TrebuchetDynamics/goncho/service@latest

The service package is a library package, not a root go install target. To install the reproducible retrieval benchmark CLI, use:

go install github.com/TrebuchetDynamics/goncho/cmd/goncho-bench@latest

Import path guide:

  • github.com/TrebuchetDynamics/goncho/service is the service library package for RunMigrations, NewService, service params, and public tool constructors.
  • github.com/TrebuchetDynamics/goncho/memory is the SQLite opener for memory.OpenSqlite when an embedded host wants a local file-backed store.
  • github.com/TrebuchetDynamics/goncho/cmd/goncho-bench is command-only; do not import cmd/goncho-bench into an agent host.

When in doubt, stay on public service and tool APIs before reaching for lower-level storage or benchmark internals.

Trust boundary for host agents:

Goncho can orient the agent by storing evidence, ranking scoped memory, assembling context packs, and warning when remembered claims may be stale. The host remains authoritative for decisions that require current state or external authority.

  • Authorization and policy decisions still belong to the host runtime, gateway, or operator.
  • Live filesystem, API, deployment, and credential state must be checked at action time.
  • Money movement, destructive writes, and external side effects require explicit host-side gates.
  • Treat retrieved memory as evidence to check, not as permission to skip live verification.

Quick start:

store, err := memory.OpenSqlite("goncho.db", 0, nil)
if err != nil {
	return err
}
defer store.Close(ctx)

if err := goncho.RunMigrations(store.DB()); err != nil {
	return err
}

svc := goncho.NewService(store.DB(), goncho.Config{
	WorkspaceID:    "local-agent",
	ObserverPeerID: "agent",
}, nil)

Host integration checklist:

  • Open local SQLite with memory.OpenSqlite and close the store during host shutdown.
  • RunMigrations before NewService on every boot so the database matches the service schema.
  • Set WorkspaceID and ObserverPeerID so memory, reviews, and audits are attributable.
  • Pass ProfileID, Peer, and SessionKey explicitly when the host has profile or session routing.
  • Call Service.Context before tool execution to build orientation, then let the host verify live state.
  • Store evidence-backed conclusions after observations, user-visible decisions, or verified tool results.
  • Verify live state before acting: paths, APIs, credentials, deployments, and services still need current proof.

Primary API path:

  • Service.Conclude records evidence-backed conclusions.
  • Service.Search retrieves scoped memory candidates.
  • Service.Recall returns a scored RecallTrace with provenance, warnings, and selection/rejection reasoning before projection.
  • Service.Context assembles an orientation pack for the next action.
  • Service.Profile stores and reads durable profile facts.
  • Service.ExtractMemoryProposals inspects a bounded session window and returns add/update/supersede/delete/noop proposals with message evidence; review-required proposals are queued without writing active memory.
  • Service.ProviderHealthDiagnostics reports optional extraction, embedding, reranking, and summarization provider state. Semantic provider failures degrade recall with warnings while lexical/local evidence remains usable.
  • Service.PreviewRetention and Service.ApplyRetention provide non-destructive retention planning and audited archive/tombstone application; archived conclusions keep stable IDs but are excluded from active recall.
  • Service.ExportPortableJSONL, Service.PreviewPortableImport, Service.ImportPortableJSONL, and Service.ExportPortableMarkdown provide portable local mirrors with checksummed manifests and preview-first import.
  • Service.RecordEvalFailures and Service.RecordRecallFeedback turn benchmark misses and runtime labels into reviewable improvement evidence without promoting claims; EvaluateRegressionGate enforces deterministic tolerances.
  • Service.AcquireActionLease, Service.RenewActionLease, Service.ExpireActionLeases, and Service.ListActionLeaseAudit provide local server-mode coordination primitives with TTLs, owner checks, and audit-visible allow/deny/expire evidence.
  • Service.RecordActionSignalReceipt, Service.ListActionSignalReceipts, and Service.ListActionSignalReceiptAudit add read receipts to action signals with observable workspace/profile authorization decisions.
  • Service.TeamFeed and Service.ListTeamFeedAudit expose a read-only, paginated team feed over authorized action signals with observable ACL allow/deny evidence.
  • Service.PreviewFilesystemWatcherImport and Service.ImportFilesystemWatcherChanges let local watcher connectors import changed project docs/code as scoped observations only after explicit include/exclude rules select the files.
  • ServerModeSecurityRequirements exposes the requirements-only threat model and RBAC vocabulary future shared/team mode must satisfy without enabling network sharing or weakening local-first SQLite mode.

For host integrations, prefer the public tool constructors such as NewGonchoContextTool, NewGonchoSearchTool, NewGonchoRecallTool, NewGonchoRememberTool, NewReviewTool, and NewGonchoHandoffTool so callers stay on the public boundary instead of database internals.

On pkg.go.dev, use the rendered pkg.go.dev examples as the shortest checked path through the API: ExampleNewService shows setup, ExampleService_Context shows orientation-pack assembly, ExampleService_Search shows scoped retrieval against stored conclusions, and ExampleService_Recall shows auditable recall traces.

go.dev package signals to check before adopting: the public module is currently v0.3.1, has a valid go.mod, a redistributable MIT license, and package documentation. Use make package-doc-smoke for this overview and its examples, make public-module-smoke for external imports, and make install-smoke for the cmd/goncho-bench command path.

Versioning and adoption notes: Goncho is pre-1.0, so read the go.dev Stable version signal as not yet v1-stable. For reproducible builds, pin with go get github.com/TrebuchetDynamics/goncho/service@v0.3.1 or a reviewed commit; @latest is a discovery shortcut, not a deployment lock. pkg.go.dev currently shows Imported by 0, but that reverse-dependency count is adoption context, not a correctness gate. Before upgrading a pinned host, run make ecosystem-smoke from a checkout.

Goncho is pre-1.0. Pin the module version or commit you deploy against, keep live verification in the host, and treat retrieved memory as orientation until current evidence confirms it.

Index

Examples

Constants

View Source
const (
	CrossChatDecisionAllowed       = "allowed"
	CrossChatDecisionDenied        = "denied"
	CrossChatDecisionDegraded      = "degraded"
	CrossChatFallbackSameChat      = "same-chat"
	SearchLineageStatusUnavailable = "unavailable"
)

Cross-chat recall constants.

View Source
const (
	LineageKindPrimary     = "primary"
	LineageKindCompression = "compression"
	LineageKindFork        = "fork"
	LineageStatusOK        = "ok"
	LineageStatusMissing   = "missing"
	LineageStatusOrphan    = "orphan"
	LineageStatusLoop      = "loop"
	LineageStatusError     = "error"
)

Lineage constants (mirrors internal/session).

View Source
const (
	GonchoMemoryV1ContractVersion = "1"
	GonchoMemoryV1MarkdownFormat  = "1"
	GonchoMemoryV1MCPToolContract = "1"
)

Goncho Memory V1 constants.

View Source
const (
	RecallBenchmarkCorpusVersion          = "goncho-recall-benchmark-v1"
	RecallBenchmarkServicePipelineVersion = "goncho-recall-benchmark-service-v1"

	RecallBenchmarkWarningMissingTrace  = "benchmark_missing_trace"
	RecallBenchmarkWarningNoRelevantIDs = "benchmark_no_relevant_ids"
)
View Source
const (
	GraphRelationAccepted = "accepted"
	GraphRelationPending  = "pending"
)
View Source
const (
	RecallStageGenerate = "generate"
	RecallStageScore    = "score"
	RecallStageSelect   = "select"
	RecallStageProject  = "project"

	RecallWarningInfo     = "info"
	RecallWarningDegraded = "degraded"
	RecallWarningError    = "error"

	RecallWarningSemanticUnavailable        = "semantic_unavailable"
	RecallWarningGraphDisabled              = "graph_disabled"
	RecallWarningStaleEmbeddingIndex        = "stale_embedding_index"
	RecallWarningFTSUnavailable             = "fts_unavailable"
	RecallWarningScopeExcludedAllCandidates = "scope_excluded_all_candidates"
	RecallWarningTokenBudgetTruncated       = "token_budget_truncated"
	RecallWarningSupersededEvidenceObserved = "superseded_evidence_observed"
	RecallWarningAgentScopeApplied          = "agent_scope_filter_applied"

	RecallRejectScopeMismatch = "scope_mismatch"
	RecallRejectTokenBudget   = "token_budget"
	RecallRejectNotSelected   = "not_selected"
)
View Source
const (
	RecallReplayStageQuery    = "query"
	RecallReplayStageWarn     = "warn"
	RecallReplayKindQuery     = "recall_query"
	RecallReplayKindCandidate = "candidate_scored"
	RecallReplayKindWarning   = "warning"
	RecallReplayKindSelected  = "selected"
	RecallReplayKindRejected  = "rejected"
	RecallReplayKindProject   = "projection_ready"
)
View Source
const (
	ServerModeLocalOnly   = "local-only"
	ServerModeTeamPreview = "team-preview"
	ServerModeTeamEnabled = "team-enabled"
)
View Source
const (
	EvidenceDefaultWorkspace     = "default_workspace:" + DefaultWorkspaceID
	EvidenceHardIsolation        = "workspace:hard_isolation"
	EvidenceCanonicalUserID      = "peer:session_metadata_user_id"
	EvidenceExternalPeerFallback = "peer:source_prefixed_external_fallback"
	EvidenceCrossPeerOptIn       = "observation:cross_peer_opt_in"
)
View Source
const (
	AgentScopeShared   = "shared"
	AgentScopeIsolated = "isolated"
)
View Source
const (
	MemoryScopeProfile   = "profile"
	MemoryScopeWorkspace = "workspace"
	MemoryScopeShared    = "shared"
	MemoryScopeSession   = "session"
	MemoryScopeGlobal    = "global"
)
View Source
const (
	DefaultRecentMessages               = 4
	DefaultMaxMessageSize               = 25_000
	DefaultMaxFileSize                  = 5_242_880
	DefaultGetContextMaxTokens          = 100_000
	DefaultDeriverWorkers               = 1
	DefaultRepresentationBatchMaxTokens = 1024
	DefaultDreamMinConclusions          = 50
	DefaultDreamCooldown                = 8 * time.Hour
	DefaultDreamIdleTimeout             = time.Hour
)
View Source
const (
	DefaultWebhookWorkspaceLimit = webhookspkg.DefaultWebhookWorkspaceLimit
	MaxWebhookURLLength          = webhookspkg.MaxWebhookURLLength
)
View Source
const (
	DefaultWorkspaceID = workspacepkg.DefaultWorkspaceID
	GlobalWorkspaceID  = workspacepkg.GlobalWorkspaceID
)
View Source
const DefaultObserverPeerID = "gormes"
View Source
const GonchoSQLiteSchemaVersion = "goncho-sqlite-v1"
View Source
const PortableExportSchemaVersion = "goncho-portable-v1"

Variables

View Source
var (
	ErrObservationConflict      = observationlog.ErrObservationConflict
	ErrObservationNotFound      = observationlog.ErrObservationNotFound
	ErrObservationSchemaMissing = observationlog.ErrObservationSchemaMissing
	ErrObservationInvalid       = observationlog.ErrObservationInvalid
)
View Source
var (
	ErrWorkspacePerUser               = errors.New("goncho: workspace-per-user topology is not allowed")
	ErrWorkspaceRequiresHardIsolation = errors.New("goncho: explicit workspace requires hard isolation")
	ErrWorkspaceRequired              = errors.New("goncho: hard-isolation workspace is required")
	ErrPeerIdentityRequired           = errors.New("goncho: peer identity requires user_id or source/chat_id")
	ErrSessionBoundaryRequired        = errors.New("goncho: session boundary is required")
)
View Source
var (
	ErrWebhookWorkspaceRequired = webhookspkg.ErrWebhookWorkspaceRequired
	ErrWebhookInvalidURL        = webhookspkg.ErrWebhookInvalidURL
	ErrWebhookLimitReached      = webhookspkg.ErrWebhookLimitReached
	ErrWebhookNotFound          = webhookspkg.ErrWebhookNotFound
	ErrWebhookSecretMissing     = webhookspkg.ErrWebhookSecretMissing
)
View Source
var ErrMemoryNotFound = errors.New("goncho: memory not found")
View Source
var ErrMemorySlotConflict = errors.New("goncho: memory slot conflict")
View Source
var ErrMemorySlotNotFound = errors.New("goncho: memory slot not found")
View Source
var ErrProviderCircuitOpen = errors.New("goncho: provider circuit open")
View Source
var ErrUserScopeDenied = errors.New("memory: user scope denied")
View Source
var QueueTaskTypes = queuestatus.TaskTypes

QueueTaskTypes are the only Honcho-style reasoning work units that Goncho reports. Delivery, deletion, and vector reconciliation counters are deliberately excluded because queue status is observability, not sync.

Functions

func CanRecallGonchoMemoryV1

func CanRecallGonchoMemoryV1(ctx context.Context, db *sql.DB) (bool, error)

CanRecallGonchoMemoryV1 checks if the V1 memory tables exist.

func DefaultDecayCurve

func DefaultDecayCurve(createdAt time.Time, now time.Time) float64

func DetectWorkspaceFromPath

func DetectWorkspaceFromPath(start string) (workspaceRoot, marker string)

DetectWorkspaceFromPath finds the workspace root by looking for project markers. Returns the directory containing the marker and the marker filename.

func FormatRecallDiagnosticsReport

func FormatRecallDiagnosticsReport(report RecallDiagnosticsReport) string

func FormatRecallReplay

func FormatRecallReplay(replay RecallReplay) string

func GonchoMemoryV1Checksum

func GonchoMemoryV1Checksum(content string) string

GonchoMemoryV1Checksum returns a SHA-256 hex digest of the content.

func GonchoMemoryV1ContractInfo

func GonchoMemoryV1ContractInfo() map[string]any

GonchoMemoryV1ContractInfo returns the V1 contract metadata.

func MemoryEntryRelevance

func MemoryEntryRelevance(entry MemoryToolEntry, query string) float64

func RunMigrations

func RunMigrations(db *sql.DB) error

func SignWebhookPayload

func SignWebhookPayload(payload, secret string) (string, error)

func ValidDialecticLevel

func ValidDialecticLevel(level string) bool

func ValidateGonchoMemoryV1Item

func ValidateGonchoMemoryV1Item(item GonchoMemoryV1Item) error

ValidateGonchoMemoryV1Item checks required fields on a V1 item.

func WorkspaceIDForPath

func WorkspaceIDForPath(path string) string

WorkspaceIDForPath returns a stable workspace ID derived from the project root.

Types

type ActionGraph

type ActionGraph struct {
	WorkspaceID string       `json:"workspace_id"`
	ProfileID   string       `json:"profile_id,omitempty"`
	Peer        string       `json:"peer"`
	Nodes       []ActionNode `json:"nodes"`
	Frontier    []ActionNode `json:"frontier"`
	NextAction  *ActionNode  `json:"next_action,omitempty"`
}

type ActionGraphQuery

type ActionGraphQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id,omitempty"`
}

type ActionLease added in v0.3.0

type ActionLease struct {
	WorkspaceID string `json:"workspace_id"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id"`
	Owner       string `json:"owner"`
	AcquiredAt  int64  `json:"acquired_at"`
	RenewedAt   int64  `json:"renewed_at"`
	ExpiresAt   int64  `json:"expires_at"`
}

type ActionLeaseAuditEvent added in v0.3.0

type ActionLeaseAuditEvent struct {
	ID          int64               `json:"id"`
	WorkspaceID string              `json:"workspace_id"`
	ProfileID   string              `json:"profile_id,omitempty"`
	Peer        string              `json:"peer"`
	ActionID    string              `json:"action_id"`
	Actor       string              `json:"actor"`
	Decision    ActionLeaseDecision `json:"decision"`
	Reason      string              `json:"reason,omitempty"`
	ExpiresAt   int64               `json:"expires_at,omitempty"`
	CreatedAt   int64               `json:"created_at"`
}

type ActionLeaseAuditQuery added in v0.3.0

type ActionLeaseAuditQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type ActionLeaseAuditResult added in v0.3.0

type ActionLeaseAuditResult struct {
	Events []ActionLeaseAuditEvent `json:"events"`
	Count  int                     `json:"count"`
}

type ActionLeaseDecision added in v0.3.0

type ActionLeaseDecision string
const (
	ActionLeaseDecisionAcquired    ActionLeaseDecision = "acquired"
	ActionLeaseDecisionHeldByOther ActionLeaseDecision = "held_by_other"
	ActionLeaseDecisionRenewed     ActionLeaseDecision = "renewed"
	ActionLeaseDecisionExpired     ActionLeaseDecision = "expired"
)

type ActionLeaseExpireParams added in v0.3.0

type ActionLeaseExpireParams struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id,omitempty"`
}

type ActionLeaseExpireResult added in v0.3.0

type ActionLeaseExpireResult struct {
	ExpiredCount int                     `json:"expired_count"`
	Events       []ActionLeaseAuditEvent `json:"events"`
}

type ActionLeaseParams added in v0.3.0

type ActionLeaseParams struct {
	WorkspaceID string        `json:"workspace_id,omitempty"`
	ProfileID   string        `json:"profile_id,omitempty"`
	Peer        string        `json:"peer"`
	ActionID    string        `json:"action_id"`
	Owner       string        `json:"owner"`
	TTL         time.Duration `json:"ttl"`
}

type ActionLeaseResult added in v0.3.0

type ActionLeaseResult struct {
	Acquired bool                `json:"acquired"`
	Decision ActionLeaseDecision `json:"decision"`
	Lease    ActionLease         `json:"lease"`
	Reason   string              `json:"reason,omitempty"`
	AuditID  int64               `json:"audit_id,omitempty"`
}

type ActionNode

type ActionNode struct {
	WorkspaceID string         `json:"workspace_id"`
	ProfileID   string         `json:"profile_id,omitempty"`
	Peer        string         `json:"peer"`
	ActionID    string         `json:"action_id"`
	Title       string         `json:"title"`
	Status      ActionStatus   `json:"status"`
	DependsOn   []string       `json:"depends_on,omitempty"`
	Signals     []ActionSignal `json:"signals,omitempty"`
	CreatedAt   int64          `json:"created_at"`
	UpdatedAt   int64          `json:"updated_at"`
}

type ActionParams

type ActionParams struct {
	WorkspaceID string   `json:"workspace_id,omitempty"`
	ProfileID   string   `json:"profile_id,omitempty"`
	Peer        string   `json:"peer"`
	ActionID    string   `json:"action_id"`
	Title       string   `json:"title"`
	DependsOn   []string `json:"depends_on,omitempty"`
}

type ActionSignal

type ActionSignal struct {
	ID        int64                 `json:"id"`
	ActionID  string                `json:"action_id"`
	Signal    string                `json:"signal"`
	Message   string                `json:"message,omitempty"`
	Actor     string                `json:"actor,omitempty"`
	CreatedAt int64                 `json:"created_at"`
	Receipts  []ActionSignalReceipt `json:"receipts,omitempty"`
}

type ActionSignalParams

type ActionSignalParams struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id"`
	Signal      string `json:"signal"`
	Message     string `json:"message,omitempty"`
	Actor       string `json:"actor,omitempty"`
}

type ActionSignalReceipt added in v0.3.0

type ActionSignalReceipt struct {
	ID          int64  `json:"id"`
	WorkspaceID string `json:"workspace_id"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id"`
	SignalID    int64  `json:"signal_id"`
	Actor       string `json:"actor"`
	ReadAt      int64  `json:"read_at"`
}

type ActionSignalReceiptAuditEvent added in v0.3.0

type ActionSignalReceiptAuditEvent struct {
	ID               int64                       `json:"id"`
	WorkspaceID      string                      `json:"workspace_id"`
	ProfileID        string                      `json:"profile_id,omitempty"`
	Peer             string                      `json:"peer"`
	ActionID         string                      `json:"action_id"`
	SignalID         int64                       `json:"signal_id"`
	Actor            string                      `json:"actor"`
	ActorWorkspaceID string                      `json:"actor_workspace_id,omitempty"`
	ActorProfileID   string                      `json:"actor_profile_id,omitempty"`
	Decision         ActionSignalReceiptDecision `json:"decision"`
	Reason           string                      `json:"reason,omitempty"`
	CreatedAt        int64                       `json:"created_at"`
}

type ActionSignalReceiptAuditQuery added in v0.3.0

type ActionSignalReceiptAuditQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id,omitempty"`
	SignalID    int64  `json:"signal_id,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type ActionSignalReceiptAuditResult added in v0.3.0

type ActionSignalReceiptAuditResult struct {
	Events []ActionSignalReceiptAuditEvent `json:"events"`
	Count  int                             `json:"count"`
}

type ActionSignalReceiptDecision added in v0.3.0

type ActionSignalReceiptDecision string
const (
	ActionSignalReceiptDecisionAllowed ActionSignalReceiptDecision = "allowed"
	ActionSignalReceiptDecisionDenied  ActionSignalReceiptDecision = "denied"
)

type ActionSignalReceiptList added in v0.3.0

type ActionSignalReceiptList struct {
	Receipts []ActionSignalReceipt `json:"receipts"`
	Count    int                   `json:"count"`
}

type ActionSignalReceiptParams added in v0.3.0

type ActionSignalReceiptParams struct {
	WorkspaceID      string `json:"workspace_id,omitempty"`
	ProfileID        string `json:"profile_id,omitempty"`
	Peer             string `json:"peer"`
	ActionID         string `json:"action_id"`
	SignalID         int64  `json:"signal_id"`
	Actor            string `json:"actor"`
	ActorWorkspaceID string `json:"actor_workspace_id,omitempty"`
	ActorProfileID   string `json:"actor_profile_id,omitempty"`
}

type ActionSignalReceiptQuery added in v0.3.0

type ActionSignalReceiptQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id"`
	SignalID    int64  `json:"signal_id,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type ActionSignalReceiptResult added in v0.3.0

type ActionSignalReceiptResult struct {
	Authorized bool                        `json:"authorized"`
	Decision   ActionSignalReceiptDecision `json:"decision"`
	Receipt    ActionSignalReceipt         `json:"receipt,omitempty"`
	Reason     string                      `json:"reason,omitempty"`
	AuditID    int64                       `json:"audit_id,omitempty"`
}

type ActionStatus

type ActionStatus string
const (
	ActionStatusPending ActionStatus = "pending"
	ActionStatusDone    ActionStatus = "done"
)

type AgentScopeEvidence added in v0.3.1

type AgentScopeEvidence struct {
	Mode    string `json:"mode"`
	AgentID string `json:"agent_id,omitempty"`
	Applied bool   `json:"applied"`
	Source  string `json:"source,omitempty"`
}

SearchResultSet is the stable JSON shape for honcho_search.

type AuditAction

type AuditAction = observationlog.AuditAction
const (
	AuditActionObserve AuditAction = observationlog.AuditActionObserve
)

type AuditEvent

type AuditEvent = observationlog.AuditEvent

type AuditQuery

type AuditQuery = observationlog.AuditQuery

type AuditResult

type AuditResult = observationlog.AuditResult

func AuditTrail

func AuditTrail(ctx context.Context, db *sql.DB, q AuditQuery) (AuditResult, error)

type AuditTargetType

type AuditTargetType = observationlog.AuditTargetType
const (
	AuditTargetObservation AuditTargetType = observationlog.AuditTargetObservation
)

type BenchmarkMetricComparison added in v0.3.0

type BenchmarkMetricComparison struct {
	Metric    string  `json:"metric"`
	Baseline  float64 `json:"baseline"`
	Current   float64 `json:"current"`
	Tolerance float64 `json:"tolerance"`
}

type BenchmarkTrendInput added in v0.3.0

type BenchmarkTrendInput struct {
	BaselineID  string                      `json:"baseline_id"`
	CandidateID string                      `json:"candidate_id"`
	Metrics     []BenchmarkMetricComparison `json:"metrics"`
}

type BenchmarkTrendReport added in v0.3.0

type BenchmarkTrendReport struct {
	BaselineID  string                 `json:"baseline_id"`
	CandidateID string                 `json:"candidate_id"`
	Status      string                 `json:"status"`
	Gates       []RegressionGateResult `json:"gates"`
}

func BuildBenchmarkTrendReport added in v0.3.0

func BuildBenchmarkTrendReport(input BenchmarkTrendInput) BenchmarkTrendReport

type ChatCompletionMetadata

type ChatCompletionMetadata struct {
	TokensIn  int `json:"tokens_in,omitempty"`
	TokensOut int `json:"tokens_out,omitempty"`
}

ChatCompletionMetadata carries terminal stream metadata that can be attached after the assistant response is complete.

type ChatParams

type ChatParams struct {
	SessionID      string `json:"session_id,omitempty"`
	Target         string `json:"target,omitempty"`
	Query          string `json:"query"`
	Stream         bool   `json:"stream,omitempty"`
	ReasoningLevel string `json:"reasoning_level,omitempty"`
}

ChatParams mirrors Honcho's DialecticOptions request body for peer.chat(). The peer itself is path/tool context, so it is passed separately to Service.Chat.

type ChatResult

type ChatResult struct {
	Content string `json:"content"`
}

ChatResult is Honcho's non-streaming dialectic response shape.

type ConcludeParams

type ConcludeParams struct {
	ProfileID  string `json:"profile_id,omitempty"`
	Peer       string `json:"peer"`
	Conclusion string `json:"conclusion,omitempty"`
	DeleteID   int64  `json:"delete_id,omitempty"`
	SessionKey string `json:"session_key,omitempty"`
	Scope      string `json:"scope,omitempty"`
}

ConcludeParams controls manual conclusion writes and deletes.

type ConcludeResult

type ConcludeResult struct {
	WorkspaceID string `json:"workspace_id"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ID          int64  `json:"id,omitempty"`
	Status      string `json:"status"`
	Deleted     bool   `json:"deleted,omitempty"`
}

ConcludeResult is the stable JSON shape for honcho_conclude. ConcludeResult represents the outcome of a create/delete conclusion operation.

type Config

type Config struct {
	Enabled                      bool
	WorkspaceID                  string
	ObserverPeerID               string
	RecentMessages               int
	MaxMessageSize               int
	MaxFileSize                  int
	GetContextMaxTokens          int
	ReasoningEnabled             bool
	PeerCardEnabled              bool
	SummaryEnabled               bool
	DreamEnabled                 bool
	DreamIdleTimeout             time.Duration
	DeriverWorkers               int
	RepresentationBatchMaxTokens int
	DialecticDefaultLevel        DialecticLevel
	SessionDirectory             SessionDirectory
	VectorStore                  VectorStore
	SearchReranker               SearchReranker
	QueryAliases                 map[string][]string
	ServerMode                   string
	AgentRoleID                  string
	AgentScopeMode               string
	ProviderFailureThreshold     int
	ProviderCooldown             time.Duration
	ProviderTimeout              time.Duration
	ProviderMaxPayloadBytes      int
}

Config controls the minimal Goncho service defaults for a runtime.

func (Config) Effective

func (c Config) Effective() Config

Effective fills the Go-native Goncho defaults used when older callers still construct Config directly instead of going through internal/config.

type ConsolidatedMemory

type ConsolidatedMemory struct {
	Tier       MemoryConsolidationTier `json:"tier"`
	MemoryID   int64                   `json:"memory_id"`
	Content    string                  `json:"content"`
	Provenance []EvidenceItem          `json:"provenance"`
}

type ContextInclusionReason added in v0.3.1

type ContextInclusionReason struct {
	Section     string `json:"section"`
	Included    bool   `json:"included"`
	Reason      string `json:"reason"`
	TokenBudget int    `json:"token_budget,omitempty"`
	Count       int    `json:"count,omitempty"`
	Source      string `json:"source,omitempty"`
}

type ContextParams

type ContextParams struct {
	ProfileID           string   `json:"profile_id,omitempty"`
	Peer                string   `json:"peer"`
	Query               string   `json:"query,omitempty"`
	SearchQuery         string   `json:"search_query,omitempty"`
	MaxTokens           int      `json:"max_tokens,omitempty"`
	Tokens              int      `json:"tokens,omitempty"`
	Summary             *bool    `json:"summary,omitempty"`
	SessionKey          string   `json:"session_key,omitempty"`
	Scope               string   `json:"scope,omitempty"`
	Sources             []string `json:"sources,omitempty"`
	PeerTarget          string   `json:"peer_target,omitempty"`
	PeerPerspective     string   `json:"peer_perspective,omitempty"`
	LimitToSession      *bool    `json:"limit_to_session,omitempty"`
	SearchTopK          *int     `json:"search_top_k,omitempty"`
	SearchMaxDistance   *float64 `json:"search_max_distance,omitempty"`
	IncludeMostFrequent *bool    `json:"include_most_frequent,omitempty"`
	MaxConclusions      *int     `json:"max_conclusions,omitempty"`
	IncludeDreamStatus  *bool    `json:"include_dream_status,omitempty"`
}

ContextParams controls honcho_context reads.

type ContextResult

type ContextResult struct {
	WorkspaceID       string                       `json:"workspace_id"`
	ProfileID         string                       `json:"profile_id,omitempty"`
	Peer              string                       `json:"peer"`
	ObserverPeerID    string                       `json:"observer_peer_id,omitempty"`
	ObservedPeerID    string                       `json:"observed_peer_id,omitempty"`
	SessionKey        string                       `json:"session_key,omitempty"`
	PeerCard          []string                     `json:"peer_card"`
	Representation    string                       `json:"representation"`
	Summary           *SessionSummary              `json:"summary,omitempty"`
	StructuredSummary *StructuredSummary           `json:"structured_summary,omitempty"`
	Conclusions       []string                     `json:"conclusions,omitempty"`
	SearchResults     []SearchHit                  `json:"search_results,omitempty"`
	ScopeEvidence     *CrossChatRecallEvidence     `json:"scope_evidence,omitempty"`
	RecentMessages    []MessageSlice               `json:"recent_messages,omitempty"`
	InclusionReasons  []ContextInclusionReason     `json:"inclusion_reasons,omitempty"`
	Unavailable       []ContextUnavailableEvidence `json:"unavailable,omitempty"`
}

ContextResult is the stable JSON shape for honcho_context.

type ContextUnavailableEvidence

type ContextUnavailableEvidence struct {
	Field      string `json:"field"`
	Capability string `json:"capability"`
	Reason     string `json:"reason"`
}

ContextUnavailableEvidence names a requested context capability that Goncho accepted but cannot yet fulfill with the current local storage model.

type CreateMessage

type CreateMessage struct {
	ProfileID string         `json:"profile_id,omitempty"`
	Peer      string         `json:"peer_id"`
	Role      string         `json:"role,omitempty"`
	Content   string         `json:"content"`
	Metadata  map[string]any `json:"metadata,omitempty"`
	CreatedAt time.Time      `json:"created_at,omitempty"`
}

type CreateMessagesParams

type CreateMessagesParams struct {
	SessionKey string          `json:"session_key"`
	Messages   []CreateMessage `json:"messages"`
}

CreateMessagesParams mirrors Honcho's session message creation contract at the local Goncho service boundary.

type CreateMessagesResult

type CreateMessagesResult struct {
	WorkspaceID string          `json:"workspace_id"`
	SessionKey  string          `json:"session_key"`
	Messages    []MessageRecord `json:"messages"`
}

type CrossChatRecallEvidence

type CrossChatRecallEvidence struct {
	Decision                  string                     `json:"decision"`
	Scope                     string                     `json:"scope"`
	FallbackScope             string                     `json:"fallback_scope,omitempty"`
	Reason                    string                     `json:"reason,omitempty"`
	UserID                    string                     `json:"user_id,omitempty"`
	CurrentSessionID          string                     `json:"current_session_id,omitempty"`
	CurrentChatKey            string                     `json:"current_chat_key,omitempty"`
	CurrentBinding            *CrossChatSessionEvidence  `json:"current_binding,omitempty"`
	SourceAllowlist           []string                   `json:"source_allowlist,omitempty"`
	SessionsConsidered        int                        `json:"sessions_considered"`
	WidenedSessionsConsidered int                        `json:"widened_sessions_considered"`
	Sessions                  []CrossChatSessionEvidence `json:"sessions,omitempty"`
}

CrossChatRecallEvidence explains why a user-scoped recall/search request was allowed, denied, or degraded.

func DegradedCrossChatRecallEvidence

func DegradedCrossChatRecallEvidence(filter SearchFilter, reason string) CrossChatRecallEvidence

DegradedCrossChatRecallEvidence reports that a caller asked for user scope but the diagnostic path could not inspect the session binding dependency.

func ExplainCrossChatRecall

func ExplainCrossChatRecall(metas []SessionMetadata, filter SearchFilter) CrossChatRecallEvidence

ExplainCrossChatRecall returns evidence for a user-scoped widening decision.

type CrossChatSessionEvidence

type CrossChatSessionEvidence struct {
	SessionID string `json:"session_id"`
	Source    string `json:"source,omitempty"`
	ChatID    string `json:"chat_id,omitempty"`
	ChatKey   string `json:"chat_key,omitempty"`
	Current   bool   `json:"current,omitempty"`
}

CrossChatSessionEvidence is the operator-readable identity for one session.

type CrossSessionKnowledge

type CrossSessionKnowledge struct {
	Query    string
	Memories []MemoryToolEntry
	Sessions map[string]int
	Summary  string
}

type CrossSessionMemory

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

func NewCrossSessionMemory

func NewCrossSessionMemory(store MemoryToolStore) *CrossSessionMemory

func (*CrossSessionMemory) DetectContradictions

func (csm *CrossSessionMemory) DetectContradictions(ctx context.Context, newEntry MemoryToolEntry) ([]MemoryToolEntry, error)

func (*CrossSessionMemory) LoadRelevant

func (csm *CrossSessionMemory) LoadRelevant(ctx context.Context, query string, limit int) ([]MemoryToolEntry, error)

func (*CrossSessionMemory) QueryKnowledge

func (csm *CrossSessionMemory) QueryKnowledge(ctx context.Context, query string, limit int) (CrossSessionKnowledge, error)

type DialecticCaller

type DialecticCaller interface {
	Chat(ctx context.Context, peer string, systemPrompt string, query string) (string, error)
}

type DialecticLevel

type DialecticLevel string
const (
	DialecticLevelMinimal DialecticLevel = "minimal"
	DialecticLevelLow     DialecticLevel = "low"
	DialecticLevelMedium  DialecticLevel = "medium"
	DialecticLevelHigh    DialecticLevel = "high"
	DialecticLevelMax     DialecticLevel = "max"
)

type DiskUsageComponent added in v0.3.0

type DiskUsageComponent struct {
	Path       string `json:"path,omitempty"`
	Bytes      int64  `json:"bytes"`
	LimitBytes int64  `json:"limit_bytes,omitempty"`
	OverBudget bool   `json:"over_budget,omitempty"`
}

type DiskUsageDiagnostics added in v0.3.0

type DiskUsageDiagnostics struct {
	DB      DiskUsageComponent `json:"db"`
	Images  DiskUsageComponent `json:"images"`
	Vectors DiskUsageComponent `json:"vectors"`
}

type DreamQueueStatus

type DreamQueueStatus = dreamscheduler.DreamQueueStatus

type DreamScheduleParams

type DreamScheduleParams = dreamscheduler.DreamScheduleParams

type DreamScheduleResult

type DreamScheduleResult = dreamscheduler.DreamScheduleResult

type DreamStatusEvidence

type DreamStatusEvidence = dreamscheduler.DreamStatusEvidence

type DriftAnchorCheckParams

type DriftAnchorCheckParams struct {
	Prompt string `json:"prompt"`
	Limit  int    `json:"limit,omitempty"`
}

type DriftAnchorDetector

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

func NewDriftAnchorDetector

func NewDriftAnchorDetector(store MemoryToolStore) *DriftAnchorDetector

func (*DriftAnchorDetector) Check

type DriftAnchorWarning

type DriftAnchorWarning struct {
	Warn            bool    `json:"warn"`
	Code            string  `json:"code,omitempty"`
	MatchedMemoryID string  `json:"matched_memory_id,omitempty"`
	MatchedContent  string  `json:"matched_content,omitempty"`
	SimilarityScore float64 `json:"similarity_score,omitempty"`
	Recommendation  string  `json:"recommendation,omitempty"`
}

type EmbeddingDiagnosticsReport added in v0.3.1

type EmbeddingDiagnosticsReport struct {
	Status      string                      `json:"status"`
	Mutates     bool                        `json:"mutates"`
	Preview     ReindexPreviewResult        `json:"preview"`
	VectorIndex LocalVectorIndexDiagnostics `json:"vector_index,omitempty"`
	Warnings    []string                    `json:"warnings,omitempty"`
}

type EvalCandidateKind added in v0.3.0

type EvalCandidateKind string
const (
	EvalCandidateQueryExpansionHint       EvalCandidateKind = "query_expansion_hint"
	EvalCandidateGraphEdgeCandidate       EvalCandidateKind = "graph_edge_candidate"
	EvalCandidateExtractionGap            EvalCandidateKind = "extraction_gap"
	EvalCandidateStaleContradictoryMemory EvalCandidateKind = "stale_contradictory_memory"
	EvalCandidateScopeBug                 EvalCandidateKind = "scope_bug"
)

type EvalCandidateList added in v0.3.0

type EvalCandidateList struct {
	Candidates []EvalImprovementCandidate `json:"candidates"`
}

type EvalCandidateQuery added in v0.3.0

type EvalCandidateQuery struct {
	WorkspaceID   string              `json:"workspace_id,omitempty"`
	BenchmarkName string              `json:"benchmark_name,omitempty"`
	Status        EvalCandidateStatus `json:"status,omitempty"`
	Limit         int                 `json:"limit,omitempty"`
}

type EvalCandidateStatus added in v0.3.0

type EvalCandidateStatus string
const EvalCandidateOpen EvalCandidateStatus = "open"

type EvalFailure added in v0.3.0

type EvalFailure struct {
	QuestionID         string   `json:"question_id"`
	Category           string   `json:"category,omitempty"`
	Query              string   `json:"query"`
	ExpectedMemoryIDs  []string `json:"expected_memory_ids,omitempty"`
	RetrievedMemoryIDs []string `json:"retrieved_memory_ids,omitempty"`
	TopHitPreview      string   `json:"top_hit_preview,omitempty"`
	FailureBucket      string   `json:"failure_bucket,omitempty"`
}

type EvalImprovementCandidate added in v0.3.0

type EvalImprovementCandidate struct {
	ID                 string              `json:"id"`
	WorkspaceID        string              `json:"workspace_id"`
	BenchmarkName      string              `json:"benchmark_name"`
	RunID              string              `json:"run_id,omitempty"`
	QuestionID         string              `json:"question_id"`
	Kind               EvalCandidateKind   `json:"kind"`
	Status             EvalCandidateStatus `json:"status"`
	Query              string              `json:"query"`
	FailureBucket      string              `json:"failure_bucket,omitempty"`
	Rationale          string              `json:"rationale"`
	EvidenceIDs        []string            `json:"evidence_ids"`
	ExpectedMemoryIDs  []string            `json:"expected_memory_ids,omitempty"`
	RetrievedMemoryIDs []string            `json:"retrieved_memory_ids,omitempty"`
	CreatedAt          time.Time           `json:"created_at"`
}

type EvalRegistryInput added in v0.3.0

type EvalRegistryInput struct {
	WorkspaceID   string        `json:"workspace_id,omitempty"`
	BenchmarkName string        `json:"benchmark_name"`
	RunID         string        `json:"run_id,omitempty"`
	Failures      []EvalFailure `json:"failures"`
}

type EvalRegistryResult added in v0.3.0

type EvalRegistryResult struct {
	WorkspaceID   string                     `json:"workspace_id"`
	BenchmarkName string                     `json:"benchmark_name"`
	RunID         string                     `json:"run_id,omitempty"`
	Candidates    []EvalImprovementCandidate `json:"candidates"`
}

type EvictionCandidate added in v0.3.0

type EvictionCandidate struct {
	StableID    string          `json:"stable_id"`
	TargetType  string          `json:"target_type"`
	Action      RetentionAction `json:"action"`
	WorkspaceID string          `json:"workspace_id"`
	PeerID      string          `json:"peer_id,omitempty"`
	SessionKey  string          `json:"session_key,omitempty"`
	CreatedAt   time.Time       `json:"created_at"`
	Bytes       int64           `json:"bytes,omitempty"`
	Reasons     []string        `json:"reasons"`
	Preview     string          `json:"preview,omitempty"`
}

type EvidenceItem

type EvidenceItem struct {
	Kind     string            `json:"kind"`
	Source   string            `json:"source,omitempty"`
	ID       string            `json:"id,omitempty"`
	Note     string            `json:"note,omitempty"`
	Score    float64           `json:"score,omitempty"`
	Metadata map[string]string `json:"metadata,omitempty"`
}

type ExtractMemoryProposalsParams added in v0.3.0

type ExtractMemoryProposalsParams struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer_id"`
	SessionKey  string `json:"session_key"`
	Window      int    `json:"window,omitempty"`
}

type ExtractMemoryProposalsResult added in v0.3.0

type ExtractMemoryProposalsResult struct {
	WorkspaceID        string           `json:"workspace_id"`
	ProfileID          string           `json:"profile_id,omitempty"`
	Peer               string           `json:"peer_id"`
	SessionKey         string           `json:"session_key"`
	Window             ProposalWindow   `json:"window"`
	Proposals          []MemoryProposal `json:"proposals"`
	ActiveMemoryWrites int              `json:"active_memory_writes"`
}

type FacetParams added in v0.3.1

type FacetParams struct {
	StableID string `json:"stable_id"`
	Facet    string `json:"facet"`
	Value    string `json:"value,omitempty"`
}

type FileImportMetadata

type FileImportMetadata = fileimport.Metadata

FileImportMetadata mirrors Honcho's file-related internal metadata attached to every message generated from an uploaded document.

type FileImportResult

type FileImportResult struct {
	WorkspaceID string                       `json:"workspace_id"`
	SessionKey  string                       `json:"session_key"`
	PeerID      string                       `json:"peer_id"`
	FileID      string                       `json:"file_id"`
	Messages    []ImportedFileMessage        `json:"messages"`
	Unavailable []ContextUnavailableEvidence `json:"unavailable,omitempty"`
}

FileImportResult describes the ordinary session messages written from an import plus degraded-mode evidence for reasoning work that cannot be queued.

type FilesystemWatcherCandidate added in v0.3.0

type FilesystemWatcherCandidate struct {
	Path         string `json:"path"`
	RelativePath string `json:"relative_path"`
	ChangeKind   string `json:"change_kind"`
	SizeBytes    int64  `json:"size_bytes"`
	Checksum     string `json:"checksum"`
	Content      string `json:"content,omitempty"`
	Truncated    bool   `json:"truncated,omitempty"`
}

type FilesystemWatcherImportParams added in v0.3.0

type FilesystemWatcherImportParams struct {
	WorkspaceID     string   `json:"workspace_id,omitempty"`
	ProfileID       string   `json:"profile_id,omitempty"`
	PeerID          string   `json:"peer_id"`
	SessionKey      string   `json:"session_key"`
	RootDir         string   `json:"root_dir"`
	Paths           []string `json:"paths"`
	IncludeGlobs    []string `json:"include_globs"`
	ExcludeGlobs    []string `json:"exclude_globs,omitempty"`
	ChangeKind      string   `json:"change_kind,omitempty"`
	MaxPreviewBytes int      `json:"max_preview_bytes,omitempty"`
	AllowBinary     bool     `json:"allow_binary,omitempty"`
}

FilesystemWatcherImportParams describes a bounded batch of changed files from a local filesystem watcher. It intentionally requires explicit include globs so a connector cannot silently ingest an entire project tree.

type FilesystemWatcherImportResult added in v0.3.0

type FilesystemWatcherImportResult struct {
	Mutates       bool                         `json:"mutates"`
	Preview       FilesystemWatcherPreview     `json:"preview"`
	Observations  []ObservationResult          `json:"observations"`
	ImportedCount int                          `json:"imported_count"`
	ReplayedCount int                          `json:"replayed_count"`
	Skipped       []FilesystemWatcherSkipped   `json:"skipped,omitempty"`
	Candidates    []FilesystemWatcherCandidate `json:"candidates,omitempty"`
}

type FilesystemWatcherPreview added in v0.3.0

type FilesystemWatcherPreview struct {
	Mutates         bool                         `json:"mutates"`
	RootDir         string                       `json:"root_dir"`
	IncludeGlobs    []string                     `json:"include_globs"`
	ExcludeGlobs    []string                     `json:"exclude_globs,omitempty"`
	Candidates      []FilesystemWatcherCandidate `json:"candidates"`
	Skipped         []FilesystemWatcherSkipped   `json:"skipped"`
	ImportableCount int                          `json:"importable_count"`
	SkippedCount    int                          `json:"skipped_count"`
}

type FilesystemWatcherSkipped added in v0.3.0

type FilesystemWatcherSkipped struct {
	Path         string `json:"path"`
	RelativePath string `json:"relative_path,omitempty"`
	Reason       string `json:"reason"`
}

type ForgetMemoryTool

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

func NewForgetMemoryTool

func NewForgetMemoryTool(store MemoryToolStore) *ForgetMemoryTool

func (ForgetMemoryTool) Description

func (t ForgetMemoryTool) Description() string

func (ForgetMemoryTool) Execute

func (t ForgetMemoryTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (ForgetMemoryTool) Name

func (t ForgetMemoryTool) Name() string

func (ForgetMemoryTool) Schema

func (t ForgetMemoryTool) Schema() json.RawMessage

func (ForgetMemoryTool) Spec

func (t ForgetMemoryTool) Spec() toolmeta.OperationSpec

func (ForgetMemoryTool) Timeout

func (t ForgetMemoryTool) Timeout() time.Duration

type FourTierConsolidationParams

type FourTierConsolidationParams struct {
	ProfileID  string `json:"profile_id,omitempty"`
	Peer       string `json:"peer"`
	SessionKey string `json:"session_key"`
	Scope      string `json:"scope,omitempty"`
	Limit      int    `json:"limit,omitempty"`
}

type FourTierConsolidationResult

type FourTierConsolidationResult struct {
	WorkspaceID string               `json:"workspace_id"`
	ProfileID   string               `json:"profile_id,omitempty"`
	Peer        string               `json:"peer"`
	SessionKey  string               `json:"session_key"`
	Items       []ConsolidatedMemory `json:"items"`
}

type GonchoContextTool

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

func NewGonchoContextTool

func NewGonchoContextTool(svc *Service) *GonchoContextTool

func (*GonchoContextTool) Description

func (t *GonchoContextTool) Description() string

func (*GonchoContextTool) Execute

func (*GonchoContextTool) Name

func (t *GonchoContextTool) Name() string

func (*GonchoContextTool) Schema

func (t *GonchoContextTool) Schema() json.RawMessage

func (*GonchoContextTool) Spec

func (*GonchoContextTool) Timeout

func (t *GonchoContextTool) Timeout() time.Duration

type GonchoHandoffTool

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

func NewGonchoHandoffTool

func NewGonchoHandoffTool(store MemoryToolStore) *GonchoHandoffTool

func (*GonchoHandoffTool) Description

func (t *GonchoHandoffTool) Description() string

func (*GonchoHandoffTool) Execute

func (*GonchoHandoffTool) Name

func (t *GonchoHandoffTool) Name() string

func (*GonchoHandoffTool) Schema

func (t *GonchoHandoffTool) Schema() json.RawMessage

func (*GonchoHandoffTool) Spec

func (*GonchoHandoffTool) Timeout

func (t *GonchoHandoffTool) Timeout() time.Duration

type GonchoMarkdownStore

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

GonchoMarkdownStore is the markdown-backed memory store.

func NewGonchoMarkdownStore

func NewGonchoMarkdownStore(db *sql.DB, cfg GonchoMarkdownStoreConfig) (*GonchoMarkdownStore, error)

NewGonchoMarkdownStore creates a new markdown-backed memory store.

type GonchoMarkdownStoreConfig

type GonchoMarkdownStoreConfig struct {
	WorkspaceID string
	ObserverID  string
	FilePath    string
}

GonchoMarkdownStoreConfig controls the markdown-backed memory store.

type GonchoMemoryV1Document

type GonchoMemoryV1Document struct {
	FormatVersion   string               `json:"format_version"`
	ContractVersion string               `json:"contract_version"`
	Items           []GonchoMemoryV1Item `json:"items"`
}

GonchoMemoryV1Item is a single memory entry in the V1 contract.

func ParseGonchoMemoryV1Markdown

func ParseGonchoMemoryV1Markdown(raw string) (GonchoMemoryV1Document, error)

ParseGonchoMemoryV1Markdown parses markdown into V1 documents.

type GonchoMemoryV1Item

type GonchoMemoryV1Item struct {
	MemoryID        string   `json:"memory_id" yaml:"memory_id"`
	Revision        int      `json:"revision" yaml:"revision"`
	AgentID         string   `json:"agent_id" yaml:"agent_id"`
	WorkspaceID     string   `json:"workspace_id" yaml:"workspace_id"`
	PeerID          string   `json:"peer_id" yaml:"peer_id"`
	SessionID       string   `json:"session_id" yaml:"session_id"`
	Scope           string   `json:"scope" yaml:"scope"`
	State           string   `json:"state" yaml:"state"`
	SourceKind      string   `json:"source_kind" yaml:"source_kind"`
	SourceTurnID    string   `json:"source_turn_id,omitempty" yaml:"source_turn_id,omitempty"`
	TombstonedAt    string   `json:"tombstoned_at,omitempty" yaml:"tombstoned_at,omitempty"`
	TombstoneReason string   `json:"tombstone_reason,omitempty" yaml:"tombstone_reason,omitempty"`
	Checksum        string   `json:"checksum" yaml:"checksum"`
	Tags            []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	Importance      float64  `json:"importance" yaml:"importance"`
	CreatedAt       string   `json:"created_at" yaml:"created_at"`
	UpdatedAt       string   `json:"updated_at" yaml:"updated_at"`
	ProvenanceJSON  string   `json:"provenance_json,omitempty" yaml:"provenance_json,omitempty"`
	Content         string   `json:"content" yaml:"-"`
}

type GonchoMemoryV1RecallRequest

type GonchoMemoryV1RecallRequest struct {
	WorkspaceID string
	PeerID      string
	Query       string
	Limit       int
	Scope       string
	Sources     []string
	SessionID   string
}

GonchoMemoryV1RecallRequest controls a V1 recall operation.

type GonchoMetaanalysisCoverageInput

type GonchoMetaanalysisCoverageInput struct {
	SourceDocumentPath       string
	SourceDocumentSHA256     string
	ProofMatrix              gonchoProofMatrixReport
	ReviewLoopVerified       bool
	MemoryToolLoopVerified   bool
	LocalOnlyEvaluator       string
	DocsArchitectureKeywords []string
}

GonchoMetaanalysisCoverageInput binds the local proof evidence back to the architecture requirements documented in METAANALYSIS-MEMORY-SYSTEMS.md.

type GonchoMetaanalysisCoverageReport

type GonchoMetaanalysisCoverageReport struct {
	Service                       string   `json:"service"`
	CoverageVersion               string   `json:"coverage_version"`
	SourceDocumentPath            string   `json:"source_document_path"`
	SourceDocumentSHA256          string   `json:"source_document_sha256"`
	DocsArchitectureKeywords      []string `json:"docs_architecture_keywords"`
	PrinciplesCovered             []string `json:"principles_covered"`
	ContextLayersCovered          []string `json:"context_layers_covered"`
	LifecycleStatesCovered        []string `json:"lifecycle_states_covered"`
	CoreEvaluationsCovered        []string `json:"core_evaluations_covered"`
	PublicToolsVerified           []string `json:"public_tools_verified"`
	LocalFeaturesVerified         []string `json:"local_features_verified"`
	DeferredFeatures              []string `json:"deferred_features"`
	CompletionCondition           string   `json:"completion_condition"`
	AllLocalEvaluatorChecksPassed bool     `json:"all_local_evaluator_checks_passed"`
}

type GonchoPublicToolsRestartE2EConfig

type GonchoPublicToolsRestartE2EConfig struct {
	DBPath       string
	MarkdownPath string
	WorkspaceID  string
	ObserverID   string
	PeerID       string
	SessionKey   string
}

type GonchoPublicToolsRestartE2EReport

type GonchoPublicToolsRestartE2EReport struct {
	ToolNames                         []string `json:"tool_names"`
	SQLiteRestartVerified             bool     `json:"sqlite_restart_verified"`
	NetworkRequired                   bool     `json:"network_required"`
	OllamaRequired                    bool     `json:"ollama_required"`
	SearchCountBeforeRestart          int      `json:"search_count_before_restart"`
	SearchCountAfterRestart           int      `json:"search_count_after_restart"`
	RecallSelectedAfterRestart        int      `json:"recall_selected_after_restart"`
	ContextRepresentationAfterRestart string   `json:"context_representation_after_restart"`
	ReviewWarningBeforeResolve        bool     `json:"review_warning_before_resolve"`
	ReviewWarningAfterResolve         bool     `json:"review_warning_after_resolve"`
	HandoffCountAfterRestart          int      `json:"handoff_count_after_restart"`
	CompletionCondition               string   `json:"completion_condition"`
}

type GonchoRecallTool

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

func NewGonchoRecallTool

func NewGonchoRecallTool(svc *Service) *GonchoRecallTool

func (*GonchoRecallTool) Description

func (t *GonchoRecallTool) Description() string

func (*GonchoRecallTool) Execute

func (*GonchoRecallTool) Name

func (t *GonchoRecallTool) Name() string

func (*GonchoRecallTool) Schema

func (t *GonchoRecallTool) Schema() json.RawMessage

func (*GonchoRecallTool) Spec

func (*GonchoRecallTool) Timeout

func (t *GonchoRecallTool) Timeout() time.Duration

type GonchoRememberTool

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

func NewGonchoRememberTool

func NewGonchoRememberTool(svc *Service) *GonchoRememberTool

func (*GonchoRememberTool) Description

func (t *GonchoRememberTool) Description() string

func (*GonchoRememberTool) Execute

func (*GonchoRememberTool) Name

func (t *GonchoRememberTool) Name() string

func (*GonchoRememberTool) Schema

func (t *GonchoRememberTool) Schema() json.RawMessage

func (*GonchoRememberTool) Spec

func (*GonchoRememberTool) Timeout

func (t *GonchoRememberTool) Timeout() time.Duration

type GonchoSearchTool

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

func NewGonchoSearchTool

func NewGonchoSearchTool(svc *Service) *GonchoSearchTool

func (*GonchoSearchTool) Description

func (t *GonchoSearchTool) Description() string

func (*GonchoSearchTool) Execute

func (*GonchoSearchTool) Name

func (t *GonchoSearchTool) Name() string

func (*GonchoSearchTool) Schema

func (t *GonchoSearchTool) Schema() json.RawMessage

func (*GonchoSearchTool) Spec

func (*GonchoSearchTool) Timeout

func (t *GonchoSearchTool) Timeout() time.Duration

type GraphExpansionIndex

type GraphExpansionIndex struct {
	Memories  map[string]RecallCandidate
	Relations []GraphRelation
}

type GraphHealthDiagnostics added in v0.3.1

type GraphHealthDiagnostics struct {
	Status              string `json:"status"`
	RelationCount       int    `json:"relation_count"`
	OrphanRelationCount int    `json:"orphan_relation_count"`
	ParserRejectCount   int    `json:"parser_reject_count"`
	Freshness           string `json:"freshness"`
}

func BuildGraphHealthDiagnostics added in v0.3.1

func BuildGraphHealthDiagnostics(index GraphExpansionIndex) GraphHealthDiagnostics

type GraphRelation

type GraphRelation struct {
	FromMemoryID    string
	ToMemoryID      string
	Relation        string
	QueryTerms      []string
	ActivationTerms []string
	EvidenceID      string
	Score           float64
	State           string
}

type HashTextEmbeddingProvider added in v0.3.1

type HashTextEmbeddingProvider struct {
	Dimensions int
}

HashTextEmbeddingProvider is a deterministic local embedding provider used by the built-in vector-index maintenance commands. It performs no network calls and is intentionally simple; hosts can still inject higher-quality providers through the VectorStore seam.

func (HashTextEmbeddingProvider) EmbedText added in v0.3.1

func (p HashTextEmbeddingProvider) EmbedText(ctx context.Context, text string) ([]float64, error)

type HonchoSDKCompatibilityHarness

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

HonchoSDKCompatibilityHarness is a hermetic adapter for proving Honcho SDK request/response flows against the local Goncho service.

func NewHonchoSDKCompatibilityHarness

func NewHonchoSDKCompatibilityHarness(service *Service) *HonchoSDKCompatibilityHarness

func (*HonchoSDKCompatibilityHarness) ContextPreview

func (*HonchoSDKCompatibilityHarness) Search

func (*HonchoSDKCompatibilityHarness) SeedSession

type HonchoSDKConclusion

type HonchoSDKConclusion struct {
	ID     int64  `json:"id"`
	Status string `json:"status"`
}

type HonchoSDKContextPreview

type HonchoSDKContextPreview struct {
	WorkspaceID    string                     `json:"workspace_id"`
	PeerID         string                     `json:"peer_id"`
	SessionID      string                     `json:"session_id,omitempty"`
	PeerCard       []string                   `json:"peer_card"`
	Representation string                     `json:"representation"`
	Summary        *HonchoSDKContextSummary   `json:"summary,omitempty"`
	SearchResults  []HonchoSDKSearchHit       `json:"search_results,omitempty"`
	RecentMessages []MessageSlice             `json:"recent_messages,omitempty"`
	Unsupported    []HonchoSDKUnsupportedFlow `json:"unsupported,omitempty"`
}

type HonchoSDKContextPreviewRequest

type HonchoSDKContextPreviewRequest struct {
	PeerID    string
	SessionID string
	Query     string
	Tokens    int
}

type HonchoSDKContextSummary

type HonchoSDKContextSummary struct {
	Content    string `json:"content"`
	MessageID  int64  `json:"message_id"`
	Type       string `json:"summary_type"`
	CreatedAt  int64  `json:"created_at"`
	TokenCount int    `json:"token_count"`
}

type HonchoSDKMessage

type HonchoSDKMessage struct {
	ID          int64          `json:"id"`
	WorkspaceID string         `json:"workspace_id"`
	SessionID   string         `json:"session_id"`
	PeerID      string         `json:"peer_id"`
	Role        string         `json:"role"`
	Content     string         `json:"content"`
	Sequence    int            `json:"seq_in_session"`
	CreatedAt   int64          `json:"created_at"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

type HonchoSDKMessageInput

type HonchoSDKMessageInput struct {
	PeerID    string
	Role      string
	Content   string
	Metadata  map[string]any
	CreatedAt time.Time
}

type HonchoSDKPeer

type HonchoSDKPeer struct {
	ID string `json:"id"`
}

type HonchoSDKSearchHit

type HonchoSDKSearchHit struct {
	ID           int64          `json:"id,omitempty"`
	Source       string         `json:"source"`
	OriginSource string         `json:"origin_source,omitempty"`
	Content      string         `json:"content"`
	SessionID    string         `json:"session_id,omitempty"`
	Lineage      *SearchLineage `json:"lineage,omitempty"`
}

type HonchoSDKSearchRequest

type HonchoSDKSearchRequest struct {
	PeerID    string
	SessionID string
	Query     string
	Limit     int
}

type HonchoSDKSearchResponse

type HonchoSDKSearchResponse struct {
	WorkspaceID string               `json:"workspace_id"`
	PeerID      string               `json:"peer_id"`
	Query       string               `json:"query"`
	Results     []HonchoSDKSearchHit `json:"results"`
}

type HonchoSDKSeedResult

type HonchoSDKSeedResult struct {
	Workspace   HonchoSDKWorkspace    `json:"workspace"`
	Peer        HonchoSDKPeer         `json:"peer"`
	Session     HonchoSDKSession      `json:"session"`
	Messages    []HonchoSDKMessage    `json:"messages"`
	Conclusions []HonchoSDKConclusion `json:"conclusions,omitempty"`
}

type HonchoSDKSession

type HonchoSDKSession struct {
	ID string `json:"id"`
}

type HonchoSDKSessionSeed

type HonchoSDKSessionSeed struct {
	PeerID      string
	SessionID   string
	PeerCard    []string
	Conclusions []string
	Messages    []HonchoSDKMessageInput
}

type HonchoSDKUnsupportedFlow

type HonchoSDKUnsupportedFlow struct {
	Code     string   `json:"code"`
	Method   string   `json:"method"`
	Endpoint string   `json:"endpoint"`
	Fields   []string `json:"fields"`
}

func UnsupportedHonchoSDKFlow

func UnsupportedHonchoSDKFlow(method, endpoint string, fields ...string) HonchoSDKUnsupportedFlow

type HonchoSDKWorkspace

type HonchoSDKWorkspace struct {
	ID string `json:"id"`
}

type HookCaptureResult

type HookCaptureResult struct {
	Observations []Observation   `json:"observations"`
	Messages     []MessageRecord `json:"messages"`
	Summary      *SessionSummary `json:"summary,omitempty"`
}

HookCaptureResult reports every durable write performed for a host hook.

type HookReplayDiagnostics added in v0.3.1

type HookReplayDiagnostics struct {
	Status                string `json:"status"`
	Event                 string `json:"event"`
	Project               string `json:"project,omitempty"`
	AbsolutePathRedacted  bool   `json:"absolute_path_redacted"`
	AbsolutePathLeakCount int    `json:"absolute_path_leak_count"`
}

func DiagnoseHookReplay added in v0.3.1

func DiagnoseHookReplay(event HostHookEvent) HookReplayDiagnostics

type HostHookEvent

type HostHookEvent struct {
	Event       HostHookEventName `json:"event"`
	Host        string            `json:"host,omitempty"`
	WorkspaceID string            `json:"workspace_id,omitempty"`
	ProfileID   string            `json:"profile_id,omitempty"`
	PeerID      string            `json:"peer_id,omitempty"`
	SessionKey  string            `json:"session_key,omitempty"`
	ContextID   string            `json:"context_id,omitempty"`
	ToolName    string            `json:"tool_name,omitempty"`
	Content     string            `json:"content,omitempty"`
	Input       string            `json:"input,omitempty"`
	Output      string            `json:"output,omitempty"`
	Error       string            `json:"error,omitempty"`
	Summary     string            `json:"summary,omitempty"`
	Success     *bool             `json:"success,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
	ObservedAt  time.Time         `json:"observed_at,omitempty"`
}

HostHookEvent is the host-neutral automatic capture envelope. It is designed to be small enough for hook scripts and rich enough to route to Observe, CreateMessages, and session-summary persistence without importing a host SDK.

type HostHookEventName

type HostHookEventName string

HostHookEventName is a host-neutral lifecycle/tool event name accepted by CaptureHostHook. Host adapters translate Claude Code, Pi, MCP, or other runtime-specific hooks into this shape before handing them to Goncho.

const (
	HostHookSessionStart      HostHookEventName = "session_start"
	HostHookPrompt            HostHookEventName = "prompt"
	HostHookUserPrompt        HostHookEventName = "user_prompt"
	HostHookPreToolUse        HostHookEventName = "pre_tool_use"
	HostHookPostToolUse       HostHookEventName = "post_tool_use"
	HostHookToolFailure       HostHookEventName = "tool_failure"
	HostHookAssistantResponse HostHookEventName = "assistant_response"
	HostHookCompaction        HostHookEventName = "compaction"
	HostHookCompact           HostHookEventName = "compact"
	HostHookSubagentStart     HostHookEventName = "subagent_start"
	HostHookSubagentStop      HostHookEventName = "subagent_stop"
	HostHookStop              HostHookEventName = "stop"
	HostHookSessionEnd        HostHookEventName = "session_end"
	HostHookFailure           HostHookEventName = "failure"
)

type HostHookEventSchema added in v0.3.0

type HostHookEventSchema struct {
	Event          HostHookEventName `json:"event"`
	Description    string            `json:"description"`
	RequiredFields []string          `json:"required_fields"`
	JSONSchema     map[string]any    `json:"json_schema"`
}

HostHookEventSchema documents the host-neutral JSON event contract adapters should emit before calling CaptureHostHook.

func HostHookEventSchemas added in v0.3.0

func HostHookEventSchemas() []HostHookEventSchema

HostHookEventSchemas returns the P1 automatic-capture lifecycle event catalog.

type ImageEmbeddingStatus

type ImageEmbeddingStatus string
const ImageEmbeddingDeferred ImageEmbeddingStatus = "deferred"

type ImageMemory

type ImageMemory struct {
	ID              int64                `json:"id"`
	WorkspaceID     string               `json:"workspace_id"`
	ProfileID       string               `json:"profile_id,omitempty"`
	Peer            string               `json:"peer"`
	SessionKey      string               `json:"session_key,omitempty"`
	ImageRef        string               `json:"image_ref"`
	Checksum        string               `json:"checksum"`
	AltText         string               `json:"alt_text,omitempty"`
	EmbeddingStatus ImageEmbeddingStatus `json:"embedding_status"`
	Metadata        map[string]string    `json:"metadata,omitempty"`
	CreatedAt       int64                `json:"created_at"`
	UpdatedAt       int64                `json:"updated_at"`
	Replayed        bool                 `json:"replayed,omitempty"`
}

type ImageMemoryList

type ImageMemoryList struct {
	WorkspaceID string        `json:"workspace_id"`
	ProfileID   string        `json:"profile_id,omitempty"`
	Peer        string        `json:"peer"`
	Images      []ImageMemory `json:"images"`
}

type ImageMemoryParams

type ImageMemoryParams struct {
	WorkspaceID string            `json:"workspace_id,omitempty"`
	ProfileID   string            `json:"profile_id,omitempty"`
	Peer        string            `json:"peer"`
	SessionKey  string            `json:"session_key,omitempty"`
	ImageRef    string            `json:"image_ref"`
	Checksum    string            `json:"checksum"`
	AltText     string            `json:"alt_text,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type ImageMemoryQuery

type ImageMemoryQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	Query       string `json:"query,omitempty"`
	SessionKey  string `json:"session_key,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type ImportFileParams

type ImportFileParams = fileimport.Params

ImportFileParams is the local Goncho equivalent of Honcho's multipart file upload request body. Content is consumed in memory and is not persisted as original file bytes.

type ImportanceScorer

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

func NewImportanceScorer

func NewImportanceScorer() *ImportanceScorer

func (*ImportanceScorer) EffectiveImportance

func (s *ImportanceScorer) EffectiveImportance(entry MemoryToolEntry, now time.Time) float64

func (*ImportanceScorer) Rank

func (s *ImportanceScorer) Rank(entries []MemoryToolEntry, relevanceByID map[string]float64, now time.Time) []ScoredMemory

func (*ImportanceScorer) RankByQuery

func (s *ImportanceScorer) RankByQuery(entries []MemoryToolEntry, query string, now time.Time) []ScoredMemory

func (*ImportanceScorer) ReviewRetentionCandidates

func (s *ImportanceScorer) ReviewRetentionCandidates(entries []MemoryToolEntry, policy RetentionPolicy) []RetentionCandidate

func (*ImportanceScorer) Score

func (s *ImportanceScorer) Score(entry MemoryToolEntry, relevanceScore float64, now time.Time) float64

type ImportedFileMessage

type ImportedFileMessage = fileimport.Message

ImportedFileMessage is the stable return shape for each imported chunk.

type LocalMarkdownMemoryConfig

type LocalMarkdownMemoryConfig = localmarkdown.Config

LocalMarkdownMemoryConfig wires the local-first Goncho V1 memory tools to a SQLite database and a Markdown export file.

type LocalMarkdownMemoryStatus

type LocalMarkdownMemoryStatus = localmarkdown.Status

LocalMarkdownMemoryStatus is the operator-facing status for the local memory backend used by Memory V1 MCP tools.

type LocalMarkdownMemoryStore

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

LocalMarkdownMemoryStore persists tool memories into the Goncho V1 SQLite table and mirrors the table to a human-editable Markdown file.

func NewLocalMarkdownMemoryStore

func NewLocalMarkdownMemoryStore(db *sql.DB, cfg LocalMarkdownMemoryConfig) *LocalMarkdownMemoryStore

func (*LocalMarkdownMemoryStore) Forget

func (*LocalMarkdownMemoryStore) Retrieve

func (s *LocalMarkdownMemoryStore) Retrieve(ctx context.Context, query string, limit int) ([]MemoryToolEntry, error)

func (*LocalMarkdownMemoryStore) Status

func (*LocalMarkdownMemoryStore) Store

func (*LocalMarkdownMemoryStore) Update

func (s *LocalMarkdownMemoryStore) Update(ctx context.Context, id string, content string) error

func (*LocalMarkdownMemoryStore) UpdateImportance

func (s *LocalMarkdownMemoryStore) UpdateImportance(ctx context.Context, id string, importance float64) error

type LocalVectorIndex added in v0.3.0

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

func NewLocalVectorIndex added in v0.3.0

func NewLocalVectorIndex(ctx context.Context, opts LocalVectorIndexOptions) (*LocalVectorIndex, error)

func (*LocalVectorIndex) Diagnostics added in v0.3.0

func (*LocalVectorIndex) Search added in v0.3.0

func (*LocalVectorIndex) Upsert added in v0.3.0

func (i *LocalVectorIndex) Upsert(ctx context.Context, memory LocalVectorMemory) error

type LocalVectorIndexDiagnostics added in v0.3.0

type LocalVectorIndexDiagnostics struct {
	Path          string    `json:"path"`
	Dimensions    int       `json:"dimensions"`
	Count         int       `json:"count"`
	Checksum      string    `json:"checksum"`
	StaleRows     int       `json:"stale_rows"`
	LastIndexedAt time.Time `json:"last_indexed_at,omitempty"`
}

type LocalVectorIndexOptions added in v0.3.0

type LocalVectorIndexOptions struct {
	Path     string
	Provider TextEmbeddingProvider
}

type LocalVectorMemory added in v0.3.0

type LocalVectorMemory struct {
	MemoryID    string            `json:"memory_id"`
	WorkspaceID string            `json:"workspace_id"`
	ProfileID   string            `json:"profile_id,omitempty"`
	Peer        string            `json:"peer"`
	SourceType  string            `json:"source_type,omitempty"`
	Content     string            `json:"content"`
	SessionID   string            `json:"session_id,omitempty"`
	AgentID     string            `json:"agent_id,omitempty"`
	ScopeID     string            `json:"scope_id,omitempty"`
	CreatedAt   time.Time         `json:"created_at,omitempty"`
	Importance  float64           `json:"importance,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type MemoryAddParams added in v0.3.0

type MemoryAddParams struct {
	ID          string            `json:"id"`
	UserID      string            `json:"user_id"`
	AgentID     string            `json:"agent_id,omitempty"`
	RunID       string            `json:"run_id,omitempty"`
	SessionKey  string            `json:"session_key,omitempty"`
	WorkspaceID string            `json:"workspace_id,omitempty"`
	ProfileID   string            `json:"profile_id,omitempty"`
	Content     string            `json:"content"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type MemoryConsolidationTier

type MemoryConsolidationTier string
const (
	ConsolidationTierWorking    MemoryConsolidationTier = "working"
	ConsolidationTierEpisodic   MemoryConsolidationTier = "episodic"
	ConsolidationTierSemantic   MemoryConsolidationTier = "semantic"
	ConsolidationTierProcedural MemoryConsolidationTier = "procedural"
)

type MemoryContradiction

type MemoryContradiction struct {
	Existing MemoryToolEntry
	Incoming MemoryToolEntry
	Subject  string
	Relation string
	Reason   string
}

func DetectMemoryContradiction

func DetectMemoryContradiction(existing, incoming MemoryToolEntry) (MemoryContradiction, bool)

type MemoryDeleteParams added in v0.3.0

type MemoryDeleteParams struct {
	ID          string `json:"id"`
	UserID      string `json:"user_id"`
	AgentID     string `json:"agent_id,omitempty"`
	RunID       string `json:"run_id,omitempty"`
	SessionKey  string `json:"session_key,omitempty"`
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
}

type MemoryFacade added in v0.3.0

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

MemoryFacade is a mem0-style tiny API over Goncho's evidence-backed service APIs. It keeps caller-supplied IDs stable by storing each memory as a named memory slot, and records add/update/delete history as observations.

func NewMemoryFacade added in v0.3.0

func NewMemoryFacade(svc *Service) *MemoryFacade

func (*MemoryFacade) Add added in v0.3.0

func (*MemoryFacade) Delete added in v0.3.0

func (*MemoryFacade) Get added in v0.3.0

func (*MemoryFacade) History added in v0.3.0

func (*MemoryFacade) Search added in v0.3.0

func (*MemoryFacade) Update added in v0.3.0

type MemoryGetParams added in v0.3.0

type MemoryGetParams struct {
	ID          string `json:"id"`
	UserID      string `json:"user_id"`
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
}

type MemoryHistoryEvent added in v0.3.0

type MemoryHistoryEvent struct {
	EvidenceID      string            `json:"evidence_id"`
	Action          string            `json:"action"`
	MemoryID        string            `json:"memory_id"`
	UserID          string            `json:"user_id"`
	AgentID         string            `json:"agent_id,omitempty"`
	RunID           string            `json:"run_id,omitempty"`
	SessionKey      string            `json:"session_key,omitempty"`
	PreviousContent string            `json:"previous_content,omitempty"`
	NewContent      string            `json:"new_content,omitempty"`
	Metadata        map[string]string `json:"metadata,omitempty"`
	ObservedAt      time.Time         `json:"observed_at"`
}

type MemoryHistoryParams added in v0.3.0

type MemoryHistoryParams struct {
	ID          string `json:"id"`
	UserID      string `json:"user_id"`
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type MemoryHistoryResult added in v0.3.0

type MemoryHistoryResult struct {
	ID     string               `json:"id"`
	Events []MemoryHistoryEvent `json:"events"`
	Count  int                  `json:"count"`
}

type MemoryImportanceUpdater

type MemoryImportanceUpdater interface {
	UpdateImportance(ctx context.Context, id string, importance float64) error
}

type MemoryItem added in v0.3.0

type MemoryItem struct {
	ID          string            `json:"id"`
	UserID      string            `json:"user_id"`
	AgentID     string            `json:"agent_id,omitempty"`
	RunID       string            `json:"run_id,omitempty"`
	SessionKey  string            `json:"session_key,omitempty"`
	WorkspaceID string            `json:"workspace_id"`
	ProfileID   string            `json:"profile_id,omitempty"`
	Content     string            `json:"content"`
	Metadata    map[string]string `json:"metadata,omitempty"`
	Revision    int               `json:"revision"`
	Deleted     bool              `json:"deleted,omitempty"`
	CreatedAt   int64             `json:"created_at"`
	UpdatedAt   int64             `json:"updated_at"`
	EvidenceIDs []string          `json:"evidence_ids,omitempty"`
}

type MemoryNamespace

type MemoryNamespace struct {
	WorkspaceID      string `json:"workspace_id"`
	ProfileID        string `json:"profile_id"`
	PeerID           string `json:"peer_id,omitempty"`
	Scope            string `json:"scope,omitempty"`
	ProfileDirectory string `json:"profile_directory,omitempty"`
}

type MemoryProposal added in v0.3.0

type MemoryProposal struct {
	ID           string                  `json:"id"`
	Operation    MemoryProposalOperation `json:"operation"`
	Status       MemoryProposalStatus    `json:"status"`
	Kind         MemoryProposalKind      `json:"kind"`
	WorkspaceID  string                  `json:"workspace_id"`
	ProfileID    string                  `json:"profile_id,omitempty"`
	Peer         string                  `json:"peer_id"`
	SessionKey   string                  `json:"session_key"`
	Scope        string                  `json:"scope"`
	Subject      string                  `json:"subject,omitempty"`
	Content      string                  `json:"content,omitempty"`
	Confidence   float64                 `json:"confidence"`
	ExpiryHint   string                  `json:"expiry_hint,omitempty"`
	EvidenceIDs  []string                `json:"evidence_ids"`
	RelatedIDs   []string                `json:"related_ids,omitempty"`
	ReviewItemID string                  `json:"review_item_id,omitempty"`
	ReviewReason string                  `json:"review_reason,omitempty"`
}

type MemoryProposalKind added in v0.3.0

type MemoryProposalKind string
const (
	MemoryProposalFact       MemoryProposalKind = "fact"
	MemoryProposalPreference MemoryProposalKind = "preference"
	MemoryProposalProcedure  MemoryProposalKind = "procedure"
)

type MemoryProposalOperation added in v0.3.0

type MemoryProposalOperation string
const (
	MemoryProposalAdd       MemoryProposalOperation = "add"
	MemoryProposalUpdate    MemoryProposalOperation = "update"
	MemoryProposalSupersede MemoryProposalOperation = "supersede"
	MemoryProposalDelete    MemoryProposalOperation = "delete"
	MemoryProposalNoop      MemoryProposalOperation = "noop"
)

type MemoryProposalStatus added in v0.3.0

type MemoryProposalStatus string
const (
	MemoryProposalReady          MemoryProposalStatus = "ready"
	MemoryProposalReviewRequired MemoryProposalStatus = "review_required"
)

type MemoryResourceContent

type MemoryResourceContent struct {
	URI      string         `json:"uri"`
	MimeType string         `json:"mime_type"`
	Payload  map[string]any `json:"payload"`
}

type MemoryResourceDescriptor

type MemoryResourceDescriptor struct {
	URI         string             `json:"uri"`
	Name        string             `json:"name"`
	Kind        MemoryResourceKind `json:"kind"`
	Description string             `json:"description"`
	MimeType    string             `json:"mime_type"`
}

type MemoryResourceKind

type MemoryResourceKind string
const (
	MemoryResourceKindResource MemoryResourceKind = "resource"
	MemoryResourceKindPrompt   MemoryResourceKind = "prompt"
)

type MemoryResourceRegistry

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

func NewMemoryResourceRegistry

func NewMemoryResourceRegistry(svc *Service) *MemoryResourceRegistry

func (*MemoryResourceRegistry) Descriptors

func (*MemoryResourceRegistry) Read

type MemoryResourceRequest

type MemoryResourceRequest struct {
	URI        string `json:"uri"`
	ProfileID  string `json:"profile_id,omitempty"`
	Peer       string `json:"peer,omitempty"`
	Query      string `json:"query,omitempty"`
	SessionKey string `json:"session_key,omitempty"`
	Scope      string `json:"scope,omitempty"`
	Limit      int    `json:"limit,omitempty"`
}

type MemorySearchParams added in v0.3.0

type MemorySearchParams struct {
	UserID      string            `json:"user_id"`
	AgentID     string            `json:"agent_id,omitempty"`
	RunID       string            `json:"run_id,omitempty"`
	SessionKey  string            `json:"session_key,omitempty"`
	WorkspaceID string            `json:"workspace_id,omitempty"`
	ProfileID   string            `json:"profile_id,omitempty"`
	Query       string            `json:"query,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
	Limit       int               `json:"limit,omitempty"`
}

type MemorySearchResult added in v0.3.0

type MemorySearchResult struct {
	Items []MemoryItem `json:"items"`
	Count int          `json:"count"`
}

type MemorySlot

type MemorySlot struct {
	WorkspaceID string `json:"workspace_id"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	Scope       string `json:"scope"`
	Name        string `json:"name"`
	Kind        string `json:"kind"`
	Value       string `json:"value"`
	Revision    int    `json:"revision"`
	Deleted     bool   `json:"deleted,omitempty"`
	CreatedAt   int64  `json:"created_at"`
	UpdatedAt   int64  `json:"updated_at"`
}

type MemorySlotList

type MemorySlotList struct {
	WorkspaceID string       `json:"workspace_id"`
	ProfileID   string       `json:"profile_id,omitempty"`
	Peer        string       `json:"peer"`
	Scope       string       `json:"scope"`
	Slots       []MemorySlot `json:"slots"`
}

type MemorySlotParams

type MemorySlotParams struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	Scope       string `json:"scope,omitempty"`
	Name        string `json:"name"`
	Kind        string `json:"kind,omitempty"`
	Value       string `json:"value"`
}

type MemorySlotQuery

type MemorySlotQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	Scope       string `json:"scope,omitempty"`
	Name        string `json:"name,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type MemoryToolEntry

type MemoryToolEntry struct {
	ID         string            `json:"id"`
	Content    string            `json:"content"`
	Tags       []string          `json:"tags"`
	Importance float64           `json:"importance"`
	SessionID  string            `json:"session_id,omitempty"`
	CreatedAt  time.Time         `json:"created_at"`
	UpdatedAt  time.Time         `json:"updated_at"`
	Metadata   map[string]string `json:"metadata,omitempty"`
}

MemoryToolEntry is a single unit of agent-managed memory.

func RecentEntries

func RecentEntries(entries []MemoryToolEntry, now time.Time, maxAge time.Duration) []MemoryToolEntry

type MemoryToolStore

type MemoryToolStore interface {
	Store(ctx context.Context, entry MemoryToolEntry) error
	Retrieve(ctx context.Context, query string, limit int) ([]MemoryToolEntry, error)
	Update(ctx context.Context, id string, content string) error
	Forget(ctx context.Context, id string) error
}

MemoryToolStore abstracts the storage backend for agent-controlled memory tool calls.

type MemoryUpdateParams added in v0.3.0

type MemoryUpdateParams struct {
	ID          string            `json:"id"`
	UserID      string            `json:"user_id"`
	AgentID     string            `json:"agent_id,omitempty"`
	RunID       string            `json:"run_id,omitempty"`
	SessionKey  string            `json:"session_key,omitempty"`
	WorkspaceID string            `json:"workspace_id,omitempty"`
	ProfileID   string            `json:"profile_id,omitempty"`
	Content     string            `json:"content"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type MemoryV1ToolContractInfo

type MemoryV1ToolContractInfo struct {
	ContractVersion                string                      `json:"contract_version"`
	PrivateAgentMemoryDefault      bool                        `json:"private_agent_memory_default"`
	SelfImprovementPerAgentDefault bool                        `json:"self_improvement_per_agent_default"`
	PurgePolicy                    string                      `json:"purge_policy"`
	Tools                          map[string]MemoryV1ToolSpec `json:"tools"`
}

func MemoryV1ToolContract

func MemoryV1ToolContract() MemoryV1ToolContractInfo

type MemoryV1ToolSpec

type MemoryV1ToolSpec struct {
	Name                  string `json:"name"`
	Mutating              bool   `json:"mutating"`
	Idempotent            bool   `json:"idempotent"`
	RequiresStableID      bool   `json:"requires_stable_id"`
	RequiresProvenance    bool   `json:"requires_provenance"`
	CreatesRevision       bool   `json:"creates_revision"`
	DeleteSemantics       string `json:"delete_semantics,omitempty"`
	ResultContractVersion string `json:"result_contract_version"`
}

type MemoryV1ToolTranscriptEntry

type MemoryV1ToolTranscriptEntry struct {
	Tool      string         `json:"tool"`
	Arguments map[string]any `json:"arguments"`
	Result    map[string]any `json:"result"`
}

func DecodeMemoryV1ToolTranscript

func DecodeMemoryV1ToolTranscript(body []byte) ([]MemoryV1ToolTranscriptEntry, error)

type Message

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

Message is a goncho-owned chat message type used by session summary extraction. It replaces hermes.Message to enable standalone extraction.

type MessageRecord

type MessageRecord struct {
	ID          int64          `json:"id"`
	WorkspaceID string         `json:"workspace_id"`
	SessionKey  string         `json:"session_key"`
	ProfileID   string         `json:"profile_id,omitempty"`
	Peer        string         `json:"peer_id"`
	Role        string         `json:"role"`
	Content     string         `json:"content"`
	Sequence    int            `json:"seq_in_session"`
	CreatedAt   int64          `json:"created_at"`
	Metadata    map[string]any `json:"metadata,omitempty"`
}

type MessageSearchHit

type MessageSearchHit struct {
	SessionID string
	ChatID    string
	Source    string
	Role      string
	Content   string
	TSUnix    int64
	Lineage   SearchLineage
}

MessageSearchHit is one turn-level result from the session catalog.

func SearchMessages

func SearchMessages(ctx context.Context, db *sql.DB, metas []SessionMetadata, filter SearchFilter, limit int) ([]MessageSearchHit, error)

SearchMessages returns matching turns across the canonical sessions bound to one user, optionally narrowed to a subset of sources.

type MessageSlice

type MessageSlice struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

MessageSlice is one recent message excerpt included in context responses.

type NegativeEvidenceCandidate added in v0.3.1

type NegativeEvidenceCandidate struct {
	Kind            NegativeEvidenceCandidateKind `json:"kind"`
	WorkspaceID     string                        `json:"workspace_id,omitempty"`
	ProfileID       string                        `json:"profile_id,omitempty"`
	PeerID          string                        `json:"peer_id,omitempty"`
	SessionKey      string                        `json:"session_key,omitempty"`
	ToolName        string                        `json:"tool_name,omitempty"`
	FailureCount    int                           `json:"failure_count"`
	EvidenceIDs     []string                      `json:"evidence_ids"`
	FirstObservedAt time.Time                     `json:"first_observed_at,omitempty"`
	LastObservedAt  time.Time                     `json:"last_observed_at,omitempty"`
	Recommendation  string                        `json:"recommendation"`
}

func GenerateNegativeEvidenceCandidates added in v0.3.1

func GenerateNegativeEvidenceCandidates(input NegativeEvidenceCandidateInput) []NegativeEvidenceCandidate

func (NegativeEvidenceCandidate) String added in v0.3.1

func (c NegativeEvidenceCandidate) String() string

type NegativeEvidenceCandidateInput added in v0.3.1

type NegativeEvidenceCandidateInput struct {
	Projection   SessionEvidenceProjection `json:"projection"`
	Observations []Observation             `json:"observations,omitempty"`
	MinFailures  int                       `json:"min_failures,omitempty"`
}

type NegativeEvidenceCandidateKind added in v0.3.1

type NegativeEvidenceCandidateKind string
const (
	NegativeEvidenceRepeatedToolFailure NegativeEvidenceCandidateKind = "repeated_tool_failure"
)

type NegativeEvidenceReviewRequest added in v0.3.1

type NegativeEvidenceReviewRequest struct {
	WorkspaceID string    `json:"workspace_id,omitempty"`
	ProfileID   string    `json:"profile_id,omitempty"`
	PeerID      string    `json:"peer_id,omitempty"`
	SessionKey  string    `json:"session_key,omitempty"`
	Limit       int       `json:"limit,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty"`
}

type Observation

type Observation = observationlog.Observation

type ObservationDecision

type ObservationDecision struct {
	ObserveMe     bool
	ObserveOthers bool
	Evidence      []string
}

func DefaultObservation

func DefaultObservation(req ObservationRequest) ObservationDecision

type ObservationList

type ObservationList = observationlog.ObservationList

func ListObservations

func ListObservations(ctx context.Context, db *sql.DB, q ObservationQuery) (ObservationList, error)

type ObservationParams

type ObservationParams = observationlog.ObservationParams

type ObservationQuery

type ObservationQuery = observationlog.ObservationQuery

type ObservationRequest

type ObservationRequest struct {
	Role                 PeerRole
	CrossPeerObservation bool
}

type ObservationResult

type ObservationResult = observationlog.ObservationResult

type PeerIdentityDecision

type PeerIdentityDecision struct {
	PeerID   string
	Degraded bool
	Evidence []string
}

func ResolvePeerID

func ResolvePeerID(meta SessionMetadata) (PeerIdentityDecision, error)

type PeerRole

type PeerRole string
const (
	PeerRoleHuman                  PeerRole = "human"
	PeerRoleGormesAssistant        PeerRole = "gormes_assistant"
	PeerRoleDeterministicAssistant PeerRole = "deterministic_assistant"
	PeerRoleTransportBot           PeerRole = "transport_bot"
	PeerRoleImportHelper           PeerRole = "import_helper"
	PeerRoleParentAgent            PeerRole = "parent_agent"
)

type PortableExportManifest added in v0.3.0

type PortableExportManifest struct {
	SchemaVersion   string         `json:"schema_version"`
	WorkspaceID     string         `json:"workspace_id"`
	ProfileID       string         `json:"profile_id,omitempty"`
	Peer            string         `json:"peer_id,omitempty"`
	SessionKey      string         `json:"session_key,omitempty"`
	RedactionPolicy string         `json:"redaction_policy,omitempty"`
	Counts          map[string]int `json:"counts"`
	Checksum        string         `json:"checksum"`
}

type PortableExportParams added in v0.3.0

type PortableExportParams struct {
	WorkspaceID      string    `json:"workspace_id,omitempty"`
	ProfileID        string    `json:"profile_id,omitempty"`
	Peer             string    `json:"peer_id,omitempty"`
	SessionKey       string    `json:"session_key,omitempty"`
	Since            time.Time `json:"since,omitempty"`
	Until            time.Time `json:"until,omitempty"`
	RedactionPolicy  string    `json:"redaction_policy,omitempty"`
	IncludeSnapshots bool      `json:"include_snapshots,omitempty"`
}

type PortableExportRecord added in v0.3.0

type PortableExportRecord struct {
	Type     string          `json:"type"`
	StableID string          `json:"stable_id"`
	Data     json.RawMessage `json:"data"`
}

type PortableExportResult added in v0.3.0

type PortableExportResult struct {
	Manifest PortableExportManifest `json:"manifest"`
	JSONL    []byte                 `json:"-"`
}

type PortableImportConflict added in v0.3.0

type PortableImportConflict struct {
	Type     string `json:"type"`
	StableID string `json:"stable_id"`
	Reason   string `json:"reason"`
}

type PortableImportParams added in v0.3.0

type PortableImportParams struct {
	JSONL []byte `json:"-"`
	Apply bool   `json:"apply"`
}

type PortableImportPreview added in v0.3.0

type PortableImportPreview struct {
	SchemaVersion    string                   `json:"schema_version"`
	ManifestChecksum string                   `json:"manifest_checksum"`
	Mutates          bool                     `json:"mutates"`
	SafeToApply      bool                     `json:"safe_to_apply"`
	Counts           map[string]int           `json:"counts"`
	Conflicts        []PortableImportConflict `json:"conflicts,omitempty"`
	Redaction        PortableRedactionSummary `json:"redaction"`
}

type PortableImportResult added in v0.3.0

type PortableImportResult struct {
	ManifestChecksum string         `json:"manifest_checksum"`
	Mutates          bool           `json:"mutates"`
	Applied          map[string]int `json:"applied"`
}

type PortableRedactionSummary added in v0.3.0

type PortableRedactionSummary struct {
	Policy               string `json:"policy,omitempty"`
	RedactedObservations int    `json:"redacted_observations,omitempty"`
	RedactionCount       int    `json:"redaction_count,omitempty"`
}

type ProfileHint

type ProfileHint struct {
	Code         string   `json:"code"`
	Message      string   `json:"message"`
	Alternatives []string `json:"alternatives"`
}

ProfileHint gives honcho_profile callers actionable guidance when an empty peer card is a valid non-error state.

type ProfileResult

type ProfileResult struct {
	WorkspaceID    string       `json:"workspace_id"`
	ProfileID      string       `json:"profile_id,omitempty"`
	Peer           string       `json:"peer"`
	Target         string       `json:"target,omitempty"`
	ObserverPeerID string       `json:"observer_peer_id,omitempty"`
	ObservedPeerID string       `json:"observed_peer_id,omitempty"`
	Card           []string     `json:"card"`
	Result         string       `json:"result,omitempty"`
	Hint           *ProfileHint `json:"hint,omitempty"`
}

ProfileResult is the external shape used by profile reads and updates.

type ProposalWindow added in v0.3.0

type ProposalWindow struct {
	Requested    int  `json:"requested"`
	MessageCount int  `json:"message_count"`
	Total        int  `json:"total"`
	Truncated    bool `json:"truncated"`
}

type ProviderCircuitBreaker added in v0.3.0

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

func NewProviderCircuitBreaker added in v0.3.0

func NewProviderCircuitBreaker(cfg ProviderCircuitBreakerConfig) *ProviderCircuitBreaker

func (*ProviderCircuitBreaker) Execute added in v0.3.0

func (b *ProviderCircuitBreaker) Execute(ctx context.Context, fn func(context.Context) error) error

func (*ProviderCircuitBreaker) Health added in v0.3.0

type ProviderCircuitBreakerConfig added in v0.3.0

type ProviderCircuitBreakerConfig struct {
	Name             string
	Kind             ProviderKind
	FailureThreshold int
	Cooldown         time.Duration
	Timeout          time.Duration
	MaxPayloadBytes  int
	Now              func() time.Time
}

type ProviderCircuitState added in v0.3.0

type ProviderCircuitState string
const (
	ProviderCircuitClosed   ProviderCircuitState = "closed"
	ProviderCircuitOpen     ProviderCircuitState = "open"
	ProviderCircuitHalfOpen ProviderCircuitState = "half_open"
)

type ProviderHealth added in v0.3.0

type ProviderHealth struct {
	Name            string               `json:"name"`
	Kind            ProviderKind         `json:"kind"`
	Status          ProviderStatus       `json:"status"`
	CircuitState    ProviderCircuitState `json:"circuit_state"`
	Optional        bool                 `json:"optional"`
	LastError       string               `json:"last_error,omitempty"`
	FailureCount    int                  `json:"failure_count,omitempty"`
	RetryAfter      time.Time            `json:"retry_after,omitempty"`
	TimeoutMillis   int64                `json:"timeout_ms,omitempty"`
	MaxPayloadBytes int                  `json:"max_payload_bytes,omitempty"`
}

type ProviderHealthDiagnostics added in v0.3.0

type ProviderHealthDiagnostics []ProviderHealth

func (ProviderHealthDiagnostics) ByName added in v0.3.0

type ProviderHealthRegistry added in v0.3.0

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

func NewProviderHealthRegistry added in v0.3.0

func NewProviderHealthRegistry(cfg ProviderResilienceConfig, vectorStore VectorStore) *ProviderHealthRegistry

func (*ProviderHealthRegistry) Diagnostics added in v0.3.0

func (*ProviderHealthRegistry) Execute added in v0.3.0

func (r *ProviderHealthRegistry) Execute(ctx context.Context, name string, fn func(context.Context) error) error

func (*ProviderHealthRegistry) MaxPayloadBytes added in v0.3.0

func (r *ProviderHealthRegistry) MaxPayloadBytes(name string) int

type ProviderKind added in v0.3.0

type ProviderKind string
const (
	ProviderKindExtraction    ProviderKind = "extraction"
	ProviderKindEmbedding     ProviderKind = "embedding"
	ProviderKindReranking     ProviderKind = "reranking"
	ProviderKindSummarization ProviderKind = "summarization"
)

type ProviderResilienceConfig added in v0.3.0

type ProviderResilienceConfig struct {
	FailureThreshold int
	Cooldown         time.Duration
	Timeout          time.Duration
	MaxPayloadBytes  int
}

type ProviderStatus added in v0.3.0

type ProviderStatus string
const (
	ProviderStatusHealthy  ProviderStatus = "healthy"
	ProviderStatusDegraded ProviderStatus = "degraded"
	ProviderStatusDisabled ProviderStatus = "disabled"
)

type QueueEmptyWebhookEventParams

type QueueEmptyWebhookEventParams = webhookspkg.QueueEmptyWebhookEventParams

type QueueStatus

type QueueStatus = queuestatus.Status

QueueStatus is the local Goncho queue status read model. Until a dedicated Goncho task queue exists, it reports deterministic zero-state counts with degraded evidence.

func ReadQueueStatus

func ReadQueueStatus(ctx context.Context, db *sql.DB, cfgs ...QueueStatusConfig) (QueueStatus, error)

ReadQueueStatus returns a deterministic local read model. It never waits for the queue to drain; dream rows are auditable work intent, not worker output.

func ZeroQueueStatus

func ZeroQueueStatus() QueueStatus

ZeroQueueStatus reports that no dedicated Goncho task queue exists yet while preserving Honcho-compatible work-unit fields.

type QueueStatusConfig

type QueueStatusConfig = dreamscheduler.QueueStatusConfig

type QueueWorkUnitStatus

type QueueWorkUnitStatus = queuestatus.WorkUnitStatus

QueueWorkUnitStatus mirrors Honcho's queue status count shape.

type RecallBenchmarkAbilityReport

type RecallBenchmarkAbilityReport struct {
	Ability             string  `json:"ability"`
	CaseCount           int     `json:"case_count"`
	RecallAt5           float64 `json:"recall_at_5"`
	RecallAt10          float64 `json:"recall_at_10"`
	ContextHitRate      float64 `json:"context_hit_rate"`
	TokenBudgetPassRate float64 `json:"token_budget_pass_rate"`
	ProvenanceHitRate   float64 `json:"provenance_hit_rate"`
}

type RecallBenchmarkCase

type RecallBenchmarkCase struct {
	ID                    string
	Ability               string
	Scale                 string
	ConversationID        string
	IdealAnswer           string
	Rubric                []string
	Trace                 RecallTrace
	RelevantIDs           []string
	ContextContains       []string
	RequiredEvidenceKinds []string
	ExpectedNoAnswer      bool
	Latency               time.Duration
}

RecallBenchmarkCase is one hermetic retrieval-evaluation case. It consumes an already-produced RecallTrace; it never runs retrieval or opens storage.

type RecallBenchmarkCaseReport

type RecallBenchmarkCaseReport struct {
	ID                     string   `json:"id"`
	Ability                string   `json:"ability,omitempty"`
	Scale                  string   `json:"scale,omitempty"`
	ConversationID         string   `json:"conversation_id,omitempty"`
	Question               string   `json:"question,omitempty"`
	IdealAnswer            string   `json:"ideal_answer,omitempty"`
	Rubric                 []string `json:"rubric,omitempty"`
	TraceID                string   `json:"trace_id"`
	PipelineVersion        string   `json:"pipeline_version"`
	ScoringConfigVersion   string   `json:"scoring_config_version"`
	RelevantIDs            []string `json:"relevant_ids"`
	RequiredEvidenceKinds  []string `json:"required_evidence_kinds,omitempty"`
	ExpectedNoAnswer       bool     `json:"expected_no_answer,omitempty"`
	RubricContextScore     float64  `json:"rubric_context_score,omitempty"`
	RubricContextMatches   []string `json:"rubric_context_matches,omitempty"`
	CandidateMemoryIDs     []string `json:"candidate_memory_ids"`
	SelectedMemoryIDs      []string `json:"selected_memory_ids"`
	SelectedContext        string   `json:"selected_context,omitempty"`
	CandidateEvidenceKinds []string `json:"candidate_evidence_kinds,omitempty"`
	SelectedEvidenceKinds  []string `json:"selected_evidence_kinds,omitempty"`
	TopEvidenceKinds       []string `json:"top_evidence_kinds,omitempty"`
	RecallAt5              float64  `json:"recall_at_5"`
	RecallAt10             float64  `json:"recall_at_10"`
	ContextSatisfied       bool     `json:"context_satisfied"`
	ProvenanceSatisfied    bool     `json:"provenance_satisfied,omitempty"`
	TokenBudget            int      `json:"token_budget"`
	SelectedTokens         int      `json:"selected_tokens"`
	TokenBudgetWithin      bool     `json:"token_budget_within"`
	LatencyMS              int      `json:"latency_ms"`
	WarningCodes           []string `json:"warning_codes"`
}

type RecallBenchmarkLatency

type RecallBenchmarkLatency struct {
	MinMS int `json:"min_ms"`
	P50MS int `json:"p50_ms"`
	P95MS int `json:"p95_ms"`
	MaxMS int `json:"max_ms"`
}

type RecallBenchmarkReport

type RecallBenchmarkReport struct {
	Service             string                         `json:"service"`
	CorpusVersion       string                         `json:"corpus_version"`
	CaseCount           int                            `json:"case_count"`
	RecallAt5           float64                        `json:"recall_at_5"`
	RecallAt10          float64                        `json:"recall_at_10"`
	ContextHitRate      float64                        `json:"context_hit_rate"`
	TokenBudgetPassRate float64                        `json:"token_budget_pass_rate"`
	Latency             RecallBenchmarkLatency         `json:"latency"`
	WarningCount        int                            `json:"warning_count"`
	Warnings            []RecallWarning                `json:"warnings"`
	Abilities           []RecallBenchmarkAbilityReport `json:"abilities,omitempty"`
	Cases               []RecallBenchmarkCaseReport    `json:"cases"`
}

func EvaluateRecallBenchmark

func EvaluateRecallBenchmark(cases []RecallBenchmarkCase) RecallBenchmarkReport

func EvaluateServiceRecallBenchmark

func EvaluateServiceRecallBenchmark(ctx context.Context, svc *Service, cases []RecallBenchmarkServiceCase) (RecallBenchmarkReport, error)

type RecallBenchmarkServiceCase

type RecallBenchmarkServiceCase struct {
	ID                    string
	Ability               string
	Scale                 string
	ConversationID        string
	Peer                  string
	SessionKey            string
	Query                 string
	IdealAnswer           string
	Rubric                []string
	ScopeID               string
	Memories              []RecallBenchmarkServiceMemory
	RelevantRefs          []string
	ContextContains       []string
	RequiredEvidenceKinds []string
	ExpectedNoAnswer      bool
	Limit                 int
	MaxTokens             int
	ScoringConfig         RecallScoringConfig
	PipelineVersion       string
}

RecallBenchmarkServiceCase runs a tiny BEAM-style fixture through public conclusion writes and the recall pipeline before EvaluateRecallBenchmark aggregates the resulting RecallTrace.

func DefaultRecallBenchmarkServiceCases

func DefaultRecallBenchmarkServiceCases() []RecallBenchmarkServiceCase

DefaultRecallBenchmarkServiceCases returns the local BEAM-style recall oracle for the MEMORIA categories Goncho currently implements deterministically. The cases intentionally use public Service.Conclude ingestion and benchmark refs instead of storage IDs, answer hints, LLM judges, or external datasets.

type RecallBenchmarkServiceMemory

type RecallBenchmarkServiceMemory struct {
	Ref        string
	Conclusion string
	Peer       string
	SessionKey string
	Scope      string
}

RecallBenchmarkServiceMemory is one public Service.Conclude write used by a service-backed benchmark case. Ref is local to the case and maps benchmark relevant IDs to the concrete conclusion IDs generated during ingestion.

type RecallCandidate

type RecallCandidate struct {
	MemoryID   string         `json:"memory_id"`
	SourceType string         `json:"source_type"`
	Content    string         `json:"content"`
	SessionID  string         `json:"session_id,omitempty"`
	AgentID    string         `json:"agent_id,omitempty"`
	ScopeID    string         `json:"scope_id,omitempty"`
	CreatedAt  time.Time      `json:"created_at,omitempty"`
	Importance float64        `json:"importance,omitempty"`
	Provenance []EvidenceItem `json:"provenance,omitempty"`
}

type RecallDiagnosticsCandidate

type RecallDiagnosticsCandidate struct {
	MemoryID       string      `json:"memory_id"`
	SourceType     string      `json:"source_type,omitempty"`
	SessionID      string      `json:"session_id,omitempty"`
	AgentID        string      `json:"agent_id,omitempty"`
	ScopeID        string      `json:"scope_id,omitempty"`
	ContentPreview string      `json:"content_preview,omitempty"`
	FinalScore     float64     `json:"final_score"`
	Scores         RecallScore `json:"scores"`
	WhySelected    []string    `json:"why_selected,omitempty"`
}

type RecallDiagnosticsRejection

type RecallDiagnosticsRejection struct {
	MemoryID       string      `json:"memory_id"`
	SourceType     string      `json:"source_type,omitempty"`
	SessionID      string      `json:"session_id,omitempty"`
	AgentID        string      `json:"agent_id,omitempty"`
	ScopeID        string      `json:"scope_id,omitempty"`
	ContentPreview string      `json:"content_preview,omitempty"`
	Reason         string      `json:"reason"`
	FinalScore     float64     `json:"final_score"`
	Scores         RecallScore `json:"scores"`
	WhyRejected    []string    `json:"why_rejected,omitempty"`
}

type RecallDiagnosticsReport

type RecallDiagnosticsReport struct {
	Service              string                       `json:"service"`
	Status               string                       `json:"status"`
	TraceID              string                       `json:"trace_id"`
	PipelineVersion      string                       `json:"pipeline_version"`
	Query                RecallQuery                  `json:"query"`
	ScoringConfig        RecallScoringConfig          `json:"scoring_config"`
	CandidateCount       int                          `json:"candidate_count"`
	SelectedCount        int                          `json:"selected_count"`
	RejectedCount        int                          `json:"rejected_count"`
	WarningCount         int                          `json:"warning_count"`
	Selected             []RecallDiagnosticsCandidate `json:"selected"`
	Rejected             []RecallDiagnosticsRejection `json:"rejected"`
	Warnings             []RecallWarning              `json:"warnings"`
	ProjectionInvariant  string                       `json:"projection_invariant"`
	DegradedPathContract string                       `json:"degraded_path_contract"`
}

func BuildRecallDiagnostics

func BuildRecallDiagnostics(trace RecallTrace) RecallDiagnosticsReport

type RecallEngine

type RecallEngine interface {
	Run(ctx context.Context, q RecallQuery) (RecallTrace, error)
}

type RecallFeedback added in v0.3.0

type RecallFeedback struct {
	ID           string               `json:"id"`
	WorkspaceID  string               `json:"workspace_id"`
	Peer         string               `json:"peer_id,omitempty"`
	SessionKey   string               `json:"session_key,omitempty"`
	TraceID      string               `json:"trace_id,omitempty"`
	Query        string               `json:"query,omitempty"`
	Label        RecallFeedbackLabel  `json:"label"`
	MemoryID     string               `json:"memory_id,omitempty"`
	Reason       string               `json:"reason"`
	SubmittedBy  string               `json:"submitted_by,omitempty"`
	ReviewItemID string               `json:"review_item_id,omitempty"`
	Status       RecallFeedbackStatus `json:"status"`
	CreatedAt    time.Time            `json:"created_at"`
}

type RecallFeedbackLabel added in v0.3.0

type RecallFeedbackLabel string
const (
	RecallFeedbackUseful  RecallFeedbackLabel = "useful"
	RecallFeedbackWrong   RecallFeedbackLabel = "wrong"
	RecallFeedbackStale   RecallFeedbackLabel = "stale"
	RecallFeedbackUnsafe  RecallFeedbackLabel = "unsafe"
	RecallFeedbackMissing RecallFeedbackLabel = "missing"
)

type RecallFeedbackList added in v0.3.0

type RecallFeedbackList struct {
	Items []RecallFeedback `json:"items"`
}

type RecallFeedbackParams added in v0.3.0

type RecallFeedbackParams struct {
	WorkspaceID string              `json:"workspace_id,omitempty"`
	Peer        string              `json:"peer_id,omitempty"`
	SessionKey  string              `json:"session_key,omitempty"`
	TraceID     string              `json:"trace_id,omitempty"`
	Query       string              `json:"query,omitempty"`
	Label       RecallFeedbackLabel `json:"label"`
	MemoryID    string              `json:"memory_id,omitempty"`
	Reason      string              `json:"reason"`
	SubmittedBy string              `json:"submitted_by,omitempty"`
}

type RecallFeedbackQuery added in v0.3.0

type RecallFeedbackQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	TraceID     string `json:"trace_id,omitempty"`
	Peer        string `json:"peer_id,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type RecallFeedbackStatus added in v0.3.0

type RecallFeedbackStatus string
const RecallFeedbackRecorded RecallFeedbackStatus = "recorded"

type RecallProjector

type RecallProjector struct{}

func (*RecallProjector) ProjectContext

func (p *RecallProjector) ProjectContext(trace RecallTrace) ContextResult

func (*RecallProjector) ProjectSearch

func (p *RecallProjector) ProjectSearch(trace RecallTrace) SearchResultSet

type RecallQuery

type RecallQuery struct {
	WorkspaceID    string   `json:"workspace_id"`
	Peer           string   `json:"peer"`
	Query          string   `json:"query"`
	SessionKey     string   `json:"session_key,omitempty"`
	ScopeID        string   `json:"scope_id,omitempty"`
	Sources        []string `json:"sources,omitempty"`
	Limit          int      `json:"limit,omitempty"`
	MaxTokens      int      `json:"max_tokens,omitempty"`
	AgentID        string   `json:"agent_id,omitempty"`
	AgentScopeMode string   `json:"agent_scope_mode,omitempty"`
}

type RecallReplay

type RecallReplay struct {
	Service              string              `json:"service"`
	TraceID              string              `json:"trace_id"`
	ReplayFingerprint    string              `json:"replay_fingerprint"`
	PipelineVersion      string              `json:"pipeline_version"`
	ScoringConfigVersion string              `json:"scoring_config_version"`
	Query                RecallQuery         `json:"query"`
	EventCount           int                 `json:"event_count"`
	Events               []RecallReplayEvent `json:"events"`
	ProjectionInvariant  string              `json:"projection_invariant"`
	ReplayContract       string              `json:"replay_contract"`
}

func BuildRecallReplay

func BuildRecallReplay(trace RecallTrace) RecallReplay

type RecallReplayEvent

type RecallReplayEvent struct {
	Index       int      `json:"index"`
	Stage       string   `json:"stage"`
	Kind        string   `json:"kind"`
	MemoryID    string   `json:"memory_id,omitempty"`
	SourceType  string   `json:"source_type,omitempty"`
	SessionID   string   `json:"session_id,omitempty"`
	AgentID     string   `json:"agent_id,omitempty"`
	ScopeID     string   `json:"scope_id,omitempty"`
	Reason      string   `json:"reason,omitempty"`
	FinalScore  float64  `json:"final_score,omitempty"`
	WarningCode string   `json:"warning_code,omitempty"`
	Severity    string   `json:"severity,omitempty"`
	Details     []string `json:"details,omitempty"`
}

type RecallScore

type RecallScore struct {
	KeywordScore     float64  `json:"keyword_score"`
	SemanticScore    float64  `json:"semantic_score"`
	GraphScore       float64  `json:"graph_score"`
	FactScore        float64  `json:"fact_score,omitempty"`
	RecencyScore     float64  `json:"recency_score"`
	ImportanceScore  float64  `json:"importance_score"`
	ScopeScore       float64  `json:"scope_score"`
	RRFScore         float64  `json:"rrf_score"`
	DiversityPenalty float64  `json:"diversity_penalty"`
	FinalScore       float64  `json:"final_score"`
	WhySelected      []string `json:"why_selected,omitempty"`
}

type RecallScoringConfig

type RecallScoringConfig struct {
	Version       string             `json:"version"`
	Weights       map[string]float64 `json:"weights"`
	RRFK          int                `json:"rrf_k"`
	MMRLambda     float64            `json:"mmr_lambda"`
	DiversityKeys []string           `json:"diversity_keys,omitempty"`
	TokenBudget   int                `json:"token_budget,omitempty"`
}

type RecallTrace

type RecallTrace struct {
	TraceID          string                    `json:"trace_id"`
	PipelineVersion  string                    `json:"pipeline_version"`
	CreatedAt        time.Time                 `json:"created_at"`
	Query            RecallQuery               `json:"query"`
	ScoringConfig    RecallScoringConfig       `json:"scoring_config"`
	VoiceDiagnostics []RecallVoiceDiagnostic   `json:"voice_diagnostics,omitempty"`
	Candidates       []ScoredRecallCandidate   `json:"candidates"`
	Selected         []ScoredRecallCandidate   `json:"selected"`
	Rejected         []RejectedRecallCandidate `json:"rejected"`
	Warnings         []RecallWarning           `json:"warnings"`
}

func DecodeRecallTraceJSON

func DecodeRecallTraceJSON(r io.Reader) (RecallTrace, error)

func (RecallTrace) StableJSON

func (t RecallTrace) StableJSON() ([]byte, error)

type RecallVoiceDiagnostic added in v0.3.1

type RecallVoiceDiagnostic struct {
	Name           string  `json:"name"`
	Enabled        bool    `json:"enabled"`
	Weight         float64 `json:"weight"`
	CandidatesWith int     `json:"candidates_with"`
	MaxScore       float64 `json:"max_score"`
	MinScore       float64 `json:"min_score"`
	AvgScore       float64 `json:"avg_score"`
	SelectedCount  int     `json:"selected_count"`
}

type RecallWarning

type RecallWarning struct {
	Code     string            `json:"code"`
	Stage    string            `json:"stage"`
	Severity string            `json:"severity"`
	Message  string            `json:"message,omitempty"`
	Evidence map[string]string `json:"evidence,omitempty"`
}

type RegressionGateInput added in v0.3.0

type RegressionGateInput struct {
	Metric    string  `json:"metric"`
	Baseline  float64 `json:"baseline"`
	Current   float64 `json:"current"`
	Tolerance float64 `json:"tolerance"`
}

type RegressionGateResult added in v0.3.0

type RegressionGateResult struct {
	Metric    string  `json:"metric"`
	Baseline  float64 `json:"baseline"`
	Current   float64 `json:"current"`
	Tolerance float64 `json:"tolerance"`
	Drop      float64 `json:"drop"`
	Pass      bool    `json:"pass"`
	Reason    string  `json:"reason"`
}

func EvaluateRegressionGate added in v0.3.0

func EvaluateRegressionGate(input RegressionGateInput) RegressionGateResult

type ReindexPreviewResult added in v0.3.1

type ReindexPreviewResult struct {
	Status      string `json:"status"`
	Mutates     bool   `json:"mutates"`
	Total       int    `json:"total"`        // total non-deleted conclusions
	NotIndexed  int    `json:"not_indexed"`  // conclusions missing from vector index
	Stale       int    `json:"stale"`        // conclusions in vector index with mismatched checksum
	Fresh       int    `json:"fresh"`        // conclusions already indexed and up-to-date
	VectorCount int    `json:"vector_count"` // total entries in vector index
}

ReindexPreviewResult is the non-mutating preview for embedding reindex.

type ReindexResult added in v0.3.1

type ReindexResult struct {
	ReindexPreviewResult
	Indexed int `json:"indexed"`
	Updated int `json:"updated"`
}

type RejectedRecallCandidate

type RejectedRecallCandidate struct {
	Candidate   RecallCandidate `json:"candidate"`
	Score       RecallScore     `json:"score"`
	Reason      string          `json:"reason"`
	WhyRejected []string        `json:"why_rejected,omitempty"`
}

type RetentionAccessReport added in v0.3.1

type RetentionAccessReport struct {
	Status      string                      `json:"status"`
	Mutates     bool                        `json:"mutates"`
	WorkspaceID string                      `json:"workspace_id"`
	GeneratedAt time.Time                   `json:"generated_at"`
	Policy      RetentionAccessReportPolicy `json:"policy"`
	Counts      map[string]int              `json:"counts"`
	Items       []RetentionAccessReportItem `json:"items"`
}

type RetentionAccessReportItem added in v0.3.1

type RetentionAccessReportItem struct {
	StableID    string   `json:"stable_id"`
	TargetType  string   `json:"target_type"`
	WorkspaceID string   `json:"workspace_id"`
	PeerID      string   `json:"peer_id,omitempty"`
	SessionKey  string   `json:"session_key,omitempty"`
	Categories  []string `json:"categories"`
	Bytes       int64    `json:"bytes,omitempty"`
	AgeSeconds  int64    `json:"age_seconds,omitempty"`
	ReviewOpen  bool     `json:"review_open,omitempty"`
	Reasons     []string `json:"reasons"`
	Preview     string   `json:"preview,omitempty"`
}

type RetentionAccessReportParams added in v0.3.1

type RetentionAccessReportParams struct {
	Now            time.Time     `json:"-"`
	StaleAfter     time.Duration `json:"-"`
	OversizedBytes int           `json:"oversized_bytes,omitempty"`
	BudgetBytes    int64         `json:"budget_bytes,omitempty"`
	Limit          int           `json:"limit,omitempty"`
}

type RetentionAccessReportPolicy added in v0.3.1

type RetentionAccessReportPolicy struct {
	StaleAfterSeconds int64 `json:"stale_after_seconds"`
	OversizedBytes    int   `json:"oversized_bytes"`
	BudgetBytes       int64 `json:"budget_bytes,omitempty"`
}

type RetentionAction

type RetentionAction = importance.RetentionAction
const (
	RetentionActionSummarize RetentionAction = importance.RetentionActionSummarize
	RetentionActionForget    RetentionAction = importance.RetentionActionForget
)
const RetentionActionArchive RetentionAction = "archive"

type RetentionApplyResult added in v0.3.0

type RetentionApplyResult struct {
	WorkspaceID    string              `json:"workspace_id"`
	Mutates        bool                `json:"mutates"`
	AppliedBy      string              `json:"applied_by"`
	Applied        []EvictionCandidate `json:"applied"`
	ImagesArchived int                 `json:"images_archived,omitempty"`
	VectorCleanup  int                 `json:"vector_cleanup,omitempty"`
}

type RetentionAuditEvent added in v0.3.0

type RetentionAuditEvent struct {
	ID          int64           `json:"id"`
	WorkspaceID string          `json:"workspace_id"`
	StableID    string          `json:"stable_id"`
	TargetType  string          `json:"target_type"`
	Action      RetentionAction `json:"action"`
	Reason      string          `json:"reason"`
	AppliedBy   string          `json:"applied_by"`
	CreatedAt   time.Time       `json:"created_at"`
}

type RetentionAuditQuery added in v0.3.0

type RetentionAuditQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	StableID    string `json:"stable_id,omitempty"`
	Limit       int    `json:"limit,omitempty"`
}

type RetentionAuditResult added in v0.3.0

type RetentionAuditResult struct {
	Events []RetentionAuditEvent `json:"events"`
}

type RetentionCandidate

type RetentionCandidate struct {
	Entry               MemoryToolEntry
	Age                 time.Duration
	EffectiveImportance float64
	Action              RetentionAction
	Reason              string
}

type RetentionPolicy

type RetentionPolicy struct {
	Now                    time.Time
	MinAge                 time.Duration
	MinEffectiveImportance float64
	Limit                  int

	KeepForever        bool          `json:"keep_forever,omitempty"`
	MaxAge             time.Duration `json:"max_age,omitempty"`
	MaxDBBytes         int64         `json:"max_db_bytes,omitempty"`
	MaxImageBytes      int64         `json:"max_image_bytes,omitempty"`
	MaxVectorBytes     int64         `json:"max_vector_bytes,omitempty"`
	PerWorkspaceLimit  int           `json:"per_workspace_limit,omitempty"`
	ArchiveBeforeEvict bool          `json:"archive_before_evict,omitempty"`
	ImageDir           string        `json:"image_dir,omitempty"`
	VectorDir          string        `json:"vector_dir,omitempty"`
}

type RetentionPolicyView added in v0.3.0

type RetentionPolicyView struct {
	KeepForever        bool   `json:"keep_forever,omitempty"`
	MaxAgeSeconds      int64  `json:"max_age_seconds,omitempty"`
	MaxDBBytes         int64  `json:"max_db_bytes,omitempty"`
	MaxImageBytes      int64  `json:"max_image_bytes,omitempty"`
	MaxVectorBytes     int64  `json:"max_vector_bytes,omitempty"`
	PerWorkspaceLimit  int    `json:"per_workspace_limit,omitempty"`
	ArchiveBeforeEvict bool   `json:"archive_before_evict,omitempty"`
	ImageDir           string `json:"image_dir,omitempty"`
	VectorDir          string `json:"vector_dir,omitempty"`
}

type RetentionPreview added in v0.3.0

type RetentionPreview struct {
	WorkspaceID string               `json:"workspace_id"`
	Mutates     bool                 `json:"mutates"`
	Policy      RetentionPolicyView  `json:"policy"`
	Disk        DiskUsageDiagnostics `json:"disk"`
	Candidates  []EvictionCandidate  `json:"candidates"`
}

type RetrieveMemoryTool

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

func NewRetrieveMemoryTool

func NewRetrieveMemoryTool(store MemoryToolStore) *RetrieveMemoryTool

func (RetrieveMemoryTool) Description

func (t RetrieveMemoryTool) Description() string

func (RetrieveMemoryTool) Execute

func (t RetrieveMemoryTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (RetrieveMemoryTool) Name

func (t RetrieveMemoryTool) Name() string

func (RetrieveMemoryTool) Schema

func (t RetrieveMemoryTool) Schema() json.RawMessage

func (RetrieveMemoryTool) Spec

func (t RetrieveMemoryTool) Spec() toolmeta.OperationSpec

func (RetrieveMemoryTool) Timeout

func (t RetrieveMemoryTool) Timeout() time.Duration

type ReviewItem

type ReviewItem = reviewlog.ReviewItem

func CreateReviewItem

func CreateReviewItem(ctx context.Context, db *sql.DB, p ReviewItemCreateParams) (ReviewItem, error)

func ResolveReviewItem

func ResolveReviewItem(ctx context.Context, db *sql.DB, p ReviewResolutionParams) (ReviewItem, error)

type ReviewItemCreateParams

type ReviewItemCreateParams = reviewlog.ReviewItemCreateParams

type ReviewKind

type ReviewKind = reviewlog.ReviewKind
const (
	ReviewKindConflict ReviewKind = reviewlog.ReviewKindConflict
	ReviewKindStale    ReviewKind = reviewlog.ReviewKindStale
)

type ReviewList

type ReviewList = reviewlog.ReviewList

func ListReviewItems

func ListReviewItems(ctx context.Context, db *sql.DB, q ReviewQuery) (ReviewList, error)

type ReviewQuery

type ReviewQuery = reviewlog.ReviewQuery

type ReviewResolution

type ReviewResolution = reviewlog.ReviewResolution
const (
	ReviewResolutionAccepted   ReviewResolution = reviewlog.ReviewResolutionAccepted
	ReviewResolutionRejected   ReviewResolution = reviewlog.ReviewResolutionRejected
	ReviewResolutionSuperseded ReviewResolution = reviewlog.ReviewResolutionSuperseded
	ReviewResolutionVerified   ReviewResolution = reviewlog.ReviewResolutionVerified
)

type ReviewResolutionParams

type ReviewResolutionParams = reviewlog.ReviewResolutionParams

type ReviewStatus

type ReviewStatus = reviewlog.ReviewStatus
const (
	ReviewStatusOpen     ReviewStatus = reviewlog.ReviewStatusOpen
	ReviewStatusResolved ReviewStatus = reviewlog.ReviewStatusResolved
)

type ReviewTool

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

func NewReviewTool

func NewReviewTool(svc *Service) *ReviewTool

func (*ReviewTool) Description

func (t *ReviewTool) Description() string

func (*ReviewTool) Execute

func (t *ReviewTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (*ReviewTool) Name

func (t *ReviewTool) Name() string

func (*ReviewTool) Schema

func (t *ReviewTool) Schema() json.RawMessage

func (*ReviewTool) Spec

func (t *ReviewTool) Spec() toolmeta.OperationSpec

func (*ReviewTool) Timeout

func (t *ReviewTool) Timeout() time.Duration

type ScoredMemory

type ScoredMemory struct {
	Entry               MemoryToolEntry
	Relevance           float64
	Recency             float64
	EffectiveImportance float64
	Score               float64
}

type ScoredRecallCandidate

type ScoredRecallCandidate struct {
	Candidate RecallCandidate `json:"candidate"`
	Score     RecallScore     `json:"score"`
}

type SearchFilter

type SearchFilter struct {
	UserID           string
	Sources          []string
	SessionIDs       []string
	Query            string
	Roles            []string
	CurrentSessionID string
	CurrentChatKey   string
}

SearchFilter narrows cross-session search to one canonical user.

type SearchHit

type SearchHit struct {
	ID           int64          `json:"id,omitempty"`
	Source       string         `json:"source"`
	OriginSource string         `json:"origin_source,omitempty"`
	Content      string         `json:"content"`
	SessionKey   string         `json:"session_key,omitempty"`
	Lineage      *SearchLineage `json:"lineage,omitempty"`
	Provenance   []EvidenceItem `json:"provenance,omitempty"`
	// contains filtered or unexported fields
}

SearchHit is one result entry returned by search.

type SearchLineage

type SearchLineage struct {
	ParentSessionID string   `json:"parent_session_id,omitempty"`
	LineageKind     string   `json:"lineage_kind,omitempty"`
	ChildSessionIDs []string `json:"child_session_ids,omitempty"`
	Status          string   `json:"status"`
}

SearchLineage is operator evidence for the session lineage attached to a search hit.

type SearchParams

type SearchParams struct {
	ProfileID  string         `json:"profile_id,omitempty"`
	Peer       string         `json:"peer"`
	Query      string         `json:"query"`
	MaxTokens  int            `json:"max_tokens,omitempty"`
	SessionKey string         `json:"session_key,omitempty"`
	Scope      string         `json:"scope,omitempty"`
	Sources    []string       `json:"sources,omitempty"`
	Filters    map[string]any `json:"filters,omitempty"`
	Limit      int            `json:"limit,omitempty"`
}

SearchParams controls retrieval for honcho_search.

type SearchRerankCandidate added in v0.3.1

type SearchRerankCandidate struct {
	ID      string `json:"id"`
	Source  string `json:"source,omitempty"`
	Content string `json:"content"`
}

SearchRerankCandidate is the privacy-minimal candidate shape passed to an optional SearchReranker.

type SearchRerankScore added in v0.3.1

type SearchRerankScore struct {
	ID    string  `json:"id"`
	Score float64 `json:"score"`
}

SearchRerankScore is one scored reranker response row keyed by candidate ID.

type SearchReranker added in v0.3.1

type SearchReranker interface {
	RerankSearch(ctx context.Context, query string, candidates []SearchRerankCandidate) ([]SearchRerankScore, error)
}

SearchReranker is an optional host-owned reranking seam. Implementations may call a local cross-encoder, remote provider, or deterministic test fake. Goncho degrades to the original search order on reranker errors.

type SearchResultSet

type SearchResultSet struct {
	WorkspaceID   string                   `json:"workspace_id"`
	ProfileID     string                   `json:"profile_id,omitempty"`
	Peer          string                   `json:"peer"`
	Query         string                   `json:"query"`
	ScopeEvidence *CrossChatRecallEvidence `json:"scope_evidence,omitempty"`
	AgentScope    *AgentScopeEvidence      `json:"agent_scope,omitempty"`
	Results       []SearchHit              `json:"results"`
}

type SentinelParams added in v0.3.1

type SentinelParams struct {
	ID        string `json:"id"`
	Peer      string `json:"peer,omitempty"`
	Scope     string `json:"scope,omitempty"`
	Expected  string `json:"expected"`
	Condition string `json:"condition,omitempty"`
}

type SentinelRecord added in v0.3.1

type SentinelRecord struct {
	ID           string    `json:"id"`
	WorkspaceID  string    `json:"workspace_id"`
	Peer         string    `json:"peer,omitempty"`
	Scope        string    `json:"scope"`
	Expected     string    `json:"expected"`
	Condition    string    `json:"condition"`
	Status       string    `json:"status"`
	ReviewStatus string    `json:"review_status"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type ServerModeSecurityRequirement added in v0.3.0

type ServerModeSecurityRequirement struct {
	Mode                     string                   `json:"mode"`
	Status                   ServerModeSecurityStatus `json:"status"`
	CapabilityMode           string                   `json:"capability_mode"`
	LeasesEnabled            bool                     `json:"leases_enabled"`
	SignalsEnabled           bool                     `json:"signals_enabled"`
	ServerModeOnly           []string                 `json:"server_mode_only,omitempty"`
	EnforcementEnabled       bool                     `json:"enforcement_enabled"`
	Roles                    []string                 `json:"roles"`
	ThreatModelSummary       string                   `json:"threat_model_summary"`
	AuthRequirement          string                   `json:"auth_requirement"`
	PostgresAdapterPlan      string                   `json:"postgres_adapter_plan"`
	BackupRestoreRequirement string                   `json:"backup_restore_requirement"`
}

ServerModeSecurityRequirement is the public, non-enforcing contract for the first server-mode security slice. It intentionally documents the minimum controls future shared/team work must satisfy without weakening local mode.

func ServerModeCapabilityReport added in v0.3.1

func ServerModeCapabilityReport(mode string) ServerModeSecurityRequirement

func ServerModeSecurityRequirements added in v0.3.0

func ServerModeSecurityRequirements() ServerModeSecurityRequirement

ServerModeSecurityRequirements returns the requirements-only threat/RBAC contract for future server/team mode. It is safe to surface from CLI/doctor flows because it does not grant access or mutate state.

type ServerModeSecurityStatus added in v0.3.0

type ServerModeSecurityStatus string

ServerModeSecurityStatus describes how much shared-server security is active.

const (
	// ServerModeStatusRequirementsOnly means Goncho has documented server-mode
	// contracts but has not enabled shared/team enforcement yet.
	ServerModeStatusRequirementsOnly ServerModeSecurityStatus = "requirements_only"
)

type Service

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

Service is the first in-binary Goncho domain facade. It sits directly on top of the SQLite store used by Gormes today.

func NewService

func NewService(db *sql.DB, cfg Config, log *slog.Logger) *Service

NewService constructs a Goncho service with conservative defaults.

Example
ctx := context.Background()
dir, err := os.MkdirTemp("", "goncho-example-*")
if err != nil {
	panic(err)
}
defer func() { _ = os.RemoveAll(dir) }()

store, err := memory.OpenSqlite(filepath.Join(dir, "memory.db"), 0, nil)
if err != nil {
	panic(err)
}
defer func() { _ = store.Close(ctx) }()

if err := goncho.RunMigrations(store.DB()); err != nil {
	panic(err)
}

svc := goncho.NewService(store.DB(), goncho.Config{
	WorkspaceID:    "example-agent",
	ObserverPeerID: "assistant",
}, nil)

if err := svc.SetProfile(ctx, "user:juan", []string{
	"Prefers SQLite-backed local memory.",
}); err != nil {
	panic(err)
}

profile, err := svc.Profile(ctx, "user:juan")
if err != nil {
	panic(err)
}
fmt.Println(profile.Card[0])
Output:
Prefers SQLite-backed local memory.

func (*Service) AcquireActionLease added in v0.3.0

func (s *Service) AcquireActionLease(ctx context.Context, params ActionLeaseParams) (ActionLeaseResult, error)

func (*Service) AppendMemorySlot

func (s *Service) AppendMemorySlot(ctx context.Context, params MemorySlotParams) (MemorySlot, error)

func (*Service) ApplyRetention added in v0.3.0

func (s *Service) ApplyRetention(ctx context.Context, policy RetentionPolicy, appliedBy string) (RetentionApplyResult, error)

func (*Service) ApproveSkillLearningProposal

func (s *Service) ApproveSkillLearningProposal(ctx context.Context, p SkillLearningProposalReviewParams) (SkillLearningProposal, error)

func (*Service) AuditTrail

func (s *Service) AuditTrail(ctx context.Context, q AuditQuery) (AuditResult, error)

func (*Service) CaptureHostHook

func (s *Service) CaptureHostHook(ctx context.Context, event HostHookEvent) (HookCaptureResult, error)

CaptureHostHook records a host-neutral hook event into Goncho's observation log and, for conversational events, the session message stream.

func (*Service) Chat

func (s *Service) Chat(ctx context.Context, peer string, params ChatParams) (ChatResult, error)

func (*Service) CompleteAction

func (s *Service) CompleteAction(ctx context.Context, query ActionGraphQuery) (ActionNode, error)

func (*Service) Conclude

func (s *Service) Conclude(ctx context.Context, params ConcludeParams) (ConcludeResult, error)

func (*Service) Context

func (s *Service) Context(ctx context.Context, params ContextParams) (ContextResult, error)
Example
ctx := context.Background()
dir, err := os.MkdirTemp("", "goncho-context-example-*")
if err != nil {
	panic(err)
}
defer func() { _ = os.RemoveAll(dir) }()

store, err := memory.OpenSqlite(filepath.Join(dir, "memory.db"), 0, nil)
if err != nil {
	panic(err)
}
defer func() { _ = store.Close(ctx) }()

if err := goncho.RunMigrations(store.DB()); err != nil {
	panic(err)
}

svc := goncho.NewService(store.DB(), goncho.Config{
	WorkspaceID:    "example-agent",
	ObserverPeerID: "assistant",
}, nil)

if err := svc.SetProfile(ctx, "user:juan", []string{
	"Prefers verification before action.",
}); err != nil {
	panic(err)
}
if _, err := svc.Conclude(ctx, goncho.ConcludeParams{
	Peer:       "user:juan",
	Conclusion: "Use SQLite local memory for agent handoffs.",
}); err != nil {
	panic(err)
}

orientation, err := svc.Context(ctx, goncho.ContextParams{
	Peer:      "user:juan",
	Query:     "handoffs",
	MaxTokens: 2000,
})
if err != nil {
	panic(err)
}
fmt.Println(orientation.Representation)
Output:
Representation for user:juan:

Profile facts:
- Prefers verification before action.

Current conclusions:
- Use SQLite local memory for agent handoffs.

func (*Service) CreateMemorySlot

func (s *Service) CreateMemorySlot(ctx context.Context, params MemorySlotParams) (MemorySlot, error)

func (*Service) CreateMessages

func (s *Service) CreateMessages(ctx context.Context, params CreateMessagesParams) (CreateMessagesResult, error)

func (*Service) CreateNegativeEvidenceReviewItems added in v0.3.1

func (s *Service) CreateNegativeEvidenceReviewItems(ctx context.Context, req NegativeEvidenceReviewRequest) ([]ReviewItem, error)

func (*Service) CreateReviewItem

func (s *Service) CreateReviewItem(ctx context.Context, p ReviewItemCreateParams) (ReviewItem, error)

func (*Service) DeleteMemorySlot

func (s *Service) DeleteMemorySlot(ctx context.Context, query MemorySlotQuery) (MemorySlot, error)

func (*Service) DeleteSession

func (s *Service) DeleteSession(ctx context.Context, sessionKey string) (SessionDeletionResult, error)

func (*Service) DeleteWebhookEndpoint

func (s *Service) DeleteWebhookEndpoint(ctx context.Context, workspaceID, endpointID string) error

func (*Service) DeleteWorkspace

func (s *Service) DeleteWorkspace(ctx context.Context) (WorkspaceDeletionResult, error)

func (*Service) DialecticCaller

func (s *Service) DialecticCaller() DialecticCaller

func (*Service) DiskUsage added in v0.3.0

func (s *Service) DiskUsage(ctx context.Context, policy RetentionPolicy) (DiskUsageDiagnostics, error)

func (*Service) EmbeddingDiagnostics added in v0.3.1

func (s *Service) EmbeddingDiagnostics(ctx context.Context) (EmbeddingDiagnosticsReport, error)

func (*Service) ExecuteDreamCompression

func (s *Service) ExecuteDreamCompression(ctx context.Context) (int, error)

func (*Service) ExecuteDreamFactExtraction

func (s *Service) ExecuteDreamFactExtraction(ctx context.Context, sessionKey string) (int, error)

func (*Service) ExecuteFourTierConsolidation

func (s *Service) ExecuteFourTierConsolidation(ctx context.Context, params FourTierConsolidationParams) (FourTierConsolidationResult, error)

func (*Service) ExpireActionLeases added in v0.3.0

func (s *Service) ExpireActionLeases(ctx context.Context, params ActionLeaseExpireParams) (ActionLeaseExpireResult, error)

func (*Service) ExportPortableJSONL added in v0.3.0

func (s *Service) ExportPortableJSONL(ctx context.Context, params PortableExportParams) (PortableExportResult, error)

func (*Service) ExportPortableMarkdown added in v0.3.0

func (s *Service) ExportPortableMarkdown(ctx context.Context, params PortableExportParams) (string, error)

func (*Service) ExportSnapshotManifest

func (s *Service) ExportSnapshotManifest(ctx context.Context, params SnapshotParams) (SnapshotManifest, error)

func (*Service) ExtractMemoryProposals added in v0.3.0

func (s *Service) ExtractMemoryProposals(ctx context.Context, params ExtractMemoryProposalsParams) (ExtractMemoryProposalsResult, error)

func (*Service) GetMemorySlot

func (s *Service) GetMemorySlot(ctx context.Context, query MemorySlotQuery) (MemorySlot, error)

func (*Service) GetOrCreateWebhookEndpoint

func (s *Service) GetOrCreateWebhookEndpoint(ctx context.Context, params WebhookEndpointCreateParams) (WebhookEndpointCreateResult, error)

func (*Service) GetSkillLearningProposal

func (s *Service) GetSkillLearningProposal(ctx context.Context, proposalID string) (SkillLearningProposal, error)

func (*Service) ImportFile

func (s *Service) ImportFile(ctx context.Context, params ImportFileParams) (FileImportResult, error)

ImportFile converts a text-like file into ordinary ready user turns for the requested session. The original uploaded bytes are only used for extraction.

func (*Service) ImportFilesystemWatcherChanges added in v0.3.0

func (s *Service) ImportFilesystemWatcherChanges(ctx context.Context, params FilesystemWatcherImportParams) (FilesystemWatcherImportResult, error)

func (*Service) ImportPortableJSONL added in v0.3.0

func (s *Service) ImportPortableJSONL(ctx context.Context, params PortableImportParams) (PortableImportResult, error)

func (*Service) ListActionLeaseAudit added in v0.3.0

func (s *Service) ListActionLeaseAudit(ctx context.Context, query ActionLeaseAuditQuery) (ActionLeaseAuditResult, error)

func (*Service) ListActionSignalReceiptAudit added in v0.3.0

func (s *Service) ListActionSignalReceiptAudit(ctx context.Context, query ActionSignalReceiptAuditQuery) (ActionSignalReceiptAuditResult, error)

func (*Service) ListActionSignalReceipts added in v0.3.0

func (s *Service) ListActionSignalReceipts(ctx context.Context, query ActionSignalReceiptQuery) (ActionSignalReceiptList, error)

func (*Service) ListEvalCandidates added in v0.3.0

func (s *Service) ListEvalCandidates(ctx context.Context, q EvalCandidateQuery) (EvalCandidateList, error)

func (*Service) ListMemorySlots

func (s *Service) ListMemorySlots(ctx context.Context, query MemorySlotQuery) (MemorySlotList, error)

func (*Service) ListObservations

func (s *Service) ListObservations(ctx context.Context, q ObservationQuery) (ObservationList, error)

func (*Service) ListPendingSkillLearningProposals

func (s *Service) ListPendingSkillLearningProposals(ctx context.Context, q SkillLearningProposalQuery) (SkillLearningProposalList, error)

func (*Service) ListRecallFeedback added in v0.3.0

func (s *Service) ListRecallFeedback(ctx context.Context, q RecallFeedbackQuery) (RecallFeedbackList, error)

func (*Service) ListReviewItems

func (s *Service) ListReviewItems(ctx context.Context, q ReviewQuery) (ReviewList, error)

func (*Service) ListTeamFeedAudit added in v0.3.0

func (s *Service) ListTeamFeedAudit(ctx context.Context, query TeamFeedAuditQuery) (TeamFeedAuditResult, error)

func (*Service) ListWebhookEndpoints

func (s *Service) ListWebhookEndpoints(ctx context.Context, workspaceID string) ([]WebhookEndpoint, error)

func (*Service) NegativeEvidenceCandidates added in v0.3.1

func (s *Service) NegativeEvidenceCandidates(ctx context.Context, q ObservationQuery) ([]NegativeEvidenceCandidate, error)

func (*Service) NewStreamingChatPersistence

func (s *Service) NewStreamingChatPersistence(peer string, params ChatParams) (*StreamingChatPersistence, error)

func (*Service) Observe

func (*Service) OnSessionEnd

func (s *Service) OnSessionEnd(ctx context.Context, sessionKey string, messages []Message) error

func (*Service) PreviewFilesystemWatcherImport added in v0.3.0

func (s *Service) PreviewFilesystemWatcherImport(ctx context.Context, params FilesystemWatcherImportParams) (FilesystemWatcherPreview, error)

func (*Service) PreviewPortableImport added in v0.3.0

func (s *Service) PreviewPortableImport(ctx context.Context, jsonl []byte) (PortableImportPreview, error)

func (*Service) PreviewRetention added in v0.3.0

func (s *Service) PreviewRetention(ctx context.Context, policy RetentionPolicy) (RetentionPreview, error)

func (*Service) Profile

func (s *Service) Profile(ctx context.Context, peer string) (ProfileResult, error)

func (*Service) ProfileForTarget

func (s *Service) ProfileForTarget(ctx context.Context, peer, target string) (ProfileResult, error)

func (*Service) ProfileInNamespace

func (s *Service) ProfileInNamespace(ctx context.Context, ns MemoryNamespace) (ProfileResult, error)

func (*Service) ProviderHealthDiagnostics added in v0.3.0

func (s *Service) ProviderHealthDiagnostics() ProviderHealthDiagnostics

func (*Service) ReadActionGraph

func (s *Service) ReadActionGraph(ctx context.Context, query ActionGraphQuery) (ActionGraph, error)

func (*Service) Recall

func (s *Service) Recall(ctx context.Context, q RecallQuery) (RecallTrace, error)

Recall runs the full scored recall pipeline against stored conclusions and returns a deterministic trace with candidates, scores, selection reasoning, and warnings. Unlike Search, which returns flat result rows, Recall exposes the scoring and provenance chain so hosts can audit why each memory was selected or rejected.

Example
ctx := context.Background()
dir, err := os.MkdirTemp("", "goncho-recall-example-*")
if err != nil {
	panic(err)
}
defer func() { _ = os.RemoveAll(dir) }()

store, err := memory.OpenSqlite(filepath.Join(dir, "memory.db"), 0, nil)
if err != nil {
	panic(err)
}
defer func() { _ = store.Close(ctx) }()

if err := goncho.RunMigrations(store.DB()); err != nil {
	panic(err)
}

svc := goncho.NewService(store.DB(), goncho.Config{
	WorkspaceID:    "example-agent",
	ObserverPeerID: "assistant",
}, nil)

if _, err := svc.Conclude(ctx, goncho.ConcludeParams{
	Peer:       "user:juan",
	Conclusion: "Recall traces preserve scoring provenance for deployment notes.",
}); err != nil {
	panic(err)
}

trace, err := svc.Recall(ctx, goncho.RecallQuery{
	Peer:  "user:juan",
	Query: "scoring provenance",
	Limit: 1,
})
if err != nil {
	panic(err)
}
fmt.Printf("%s selected=%d provenance=%t\n", trace.PipelineVersion, len(trace.Selected), len(trace.Selected[0].Candidate.Provenance) > 0)
Output:
goncho-recall-v1 selected=1 provenance=true

func (*Service) RecallWithScoringConfig added in v0.3.1

func (s *Service) RecallWithScoringConfig(ctx context.Context, q RecallQuery, config RecallScoringConfig) (RecallTrace, error)

RecallWithScoringConfig runs Recall with an explicit scoring configuration. It is intended for evaluation harnesses and advanced integrations that need to compare ranking profiles without changing the default Service.Recall behavior.

func (*Service) RecordActionSignalReceipt added in v0.3.0

func (s *Service) RecordActionSignalReceipt(ctx context.Context, params ActionSignalReceiptParams) (ActionSignalReceiptResult, error)

func (*Service) RecordEvalFailures added in v0.3.0

func (s *Service) RecordEvalFailures(ctx context.Context, input EvalRegistryInput) (EvalRegistryResult, error)

func (*Service) RecordRecallFeedback added in v0.3.0

func (s *Service) RecordRecallFeedback(ctx context.Context, params RecallFeedbackParams) (RecallFeedback, error)

func (*Service) RecordSkillOutcome

func (s *Service) RecordSkillOutcome(ctx context.Context, outcome SkillOutcome) error

RecordSkillOutcome writes a skill execution result as a Goncho conclusion. The source prefix "skill:<name>" is embedded in the conclusion text for later querying.

func (*Service) Reindex added in v0.3.1

func (s *Service) Reindex(ctx context.Context) (ReindexResult, error)

func (*Service) ReindexPreview added in v0.3.1

func (s *Service) ReindexPreview(ctx context.Context) (ReindexPreviewResult, error)

ReindexPreview returns counts of what a reindex would do without mutating. It compares active goncho_conclusions against the local vector index by memory_id and content checksum. No embedding generation happens during preview.

func (*Service) RejectSkillLearningProposal

func (s *Service) RejectSkillLearningProposal(ctx context.Context, p SkillLearningProposalReviewParams) (SkillLearningProposal, error)

func (*Service) RenewActionLease added in v0.3.0

func (s *Service) RenewActionLease(ctx context.Context, params ActionLeaseParams) (ActionLeaseResult, error)

func (*Service) ReplaceMemorySlot

func (s *Service) ReplaceMemorySlot(ctx context.Context, params MemorySlotParams) (MemorySlot, error)

func (*Service) ResolveReviewItem

func (s *Service) ResolveReviewItem(ctx context.Context, p ReviewResolutionParams) (ReviewItem, error)

func (*Service) RetentionAccessReport added in v0.3.1

func (s *Service) RetentionAccessReport(ctx context.Context, params RetentionAccessReportParams) (RetentionAccessReport, error)

func (*Service) RetentionAudit added in v0.3.0

func (*Service) ScheduleDream

func (s *Service) ScheduleDream(ctx context.Context, params DreamScheduleParams) (DreamScheduleResult, error)

func (*Service) Search

func (s *Service) Search(ctx context.Context, params SearchParams) (SearchResultSet, error)
Example
ctx := context.Background()
dir, err := os.MkdirTemp("", "goncho-search-example-*")
if err != nil {
	panic(err)
}
defer func() { _ = os.RemoveAll(dir) }()

store, err := memory.OpenSqlite(filepath.Join(dir, "memory.db"), 0, nil)
if err != nil {
	panic(err)
}
defer func() { _ = store.Close(ctx) }()

if err := goncho.RunMigrations(store.DB()); err != nil {
	panic(err)
}

svc := goncho.NewService(store.DB(), goncho.Config{
	WorkspaceID:    "example-agent",
	ObserverPeerID: "assistant",
}, nil)

if _, err := svc.Conclude(ctx, goncho.ConcludeParams{
	Peer:       "user:juan",
	Conclusion: "Keep deployment notes evidence-first and searchable.",
}); err != nil {
	panic(err)
}

results, err := svc.Search(ctx, goncho.SearchParams{
	Peer:  "user:juan",
	Query: "deployment evidence",
	Limit: 1,
})
if err != nil {
	panic(err)
}
fmt.Printf("%s: %s\n", results.Results[0].Source, results.Results[0].Content)
Output:
conclusion: Keep deployment notes evidence-first and searchable.

func (*Service) SearchImageMemories

func (s *Service) SearchImageMemories(ctx context.Context, query ImageMemoryQuery) (ImageMemoryList, error)

func (*Service) SearchSkillOutcomes

func (s *Service) SearchSkillOutcomes(ctx context.Context, skillName string, limit int) ([]string, error)

SearchSkillOutcomes returns conclusions from skill executions matching the given skill name.

func (*Service) SetDialecticCaller

func (s *Service) SetDialecticCaller(dc DialecticCaller)

func (*Service) SetProfile

func (s *Service) SetProfile(ctx context.Context, peer string, card []string) error

func (*Service) SetProfileForTarget

func (s *Service) SetProfileForTarget(ctx context.Context, peer, target string, card []string) error

func (*Service) SetProfileInNamespace

func (s *Service) SetProfileInNamespace(ctx context.Context, ns MemoryNamespace, card []string) error

func (*Service) SignalAction

func (s *Service) SignalAction(ctx context.Context, params ActionSignalParams) (ActionSignal, error)

func (*Service) StoreImageMemory

func (s *Service) StoreImageMemory(ctx context.Context, params ImageMemoryParams) (ImageMemory, error)

func (*Service) TeamFeed added in v0.3.0

func (s *Service) TeamFeed(ctx context.Context, query TeamFeedQuery) (TeamFeedResult, error)

func (*Service) UpsertAction

func (s *Service) UpsertAction(ctx context.Context, params ActionParams) (ActionNode, error)

func (*Service) UpsertMemoryFacet added in v0.3.1

func (s *Service) UpsertMemoryFacet(ctx context.Context, params FacetParams) error

func (*Service) UpsertSentinel added in v0.3.1

func (s *Service) UpsertSentinel(ctx context.Context, params SentinelParams) (SentinelRecord, error)

func (*Service) VerifiedCodeContext

func (s *Service) VerifiedCodeContext(ctx context.Context, params VerifiedCodeContextParams) (VerifiedCodeContextResult, error)

func (*Service) ViewerMemoryReport added in v0.3.1

func (s *Service) ViewerMemoryReport(ctx context.Context, facet, value string, limit int) (ViewerMemoryReport, error)

func (*Service) ViewerOrientationPack added in v0.3.1

func (s *Service) ViewerOrientationPack(ctx context.Context, peer, query, sessionKey string, maxTokens int) (ViewerOrientationPack, error)

func (*Service) ViewerRecallTrace added in v0.3.1

func (s *Service) ViewerRecallTrace(ctx context.Context, peer, query, sessionKey string, limit int) (ViewerRecallTrace, error)

func (*Service) ViewerSessionTimeline added in v0.3.0

func (s *Service) ViewerSessionTimeline(ctx context.Context, sessionKey string) (ViewerSessionTimeline, error)

func (*Service) ViewerSnapshot added in v0.3.0

func (s *Service) ViewerSnapshot(ctx context.Context) (ViewerSnapshot, error)

ViewerSnapshot returns a local-first, read-only overview for viewer clients.

type SessionBoundaryDecision

type SessionBoundaryDecision struct {
	Kind       SessionBoundaryKind
	SessionKey string
	Evidence   []string
}

type SessionBoundaryKind

type SessionBoundaryKind string
const (
	SessionBoundaryThread            SessionBoundaryKind = "thread"
	SessionBoundaryChannel           SessionBoundaryKind = "channel"
	SessionBoundaryRepository        SessionBoundaryKind = "repository"
	SessionBoundaryImportBatch       SessionBoundaryKind = "import_batch"
	SessionBoundaryDelegatedChildRun SessionBoundaryKind = "delegated_child_run"
)

type SessionBoundaryRequest

type SessionBoundaryRequest struct {
	Kind   SessionBoundaryKind
	Key    string
	Source string
}

type SessionDeletionResult

type SessionDeletionResult struct {
	WorkspaceID        string `json:"workspace_id"`
	SessionKey         string `json:"session_key"`
	MessagesDeleted    int64  `json:"messages_deleted"`
	ConclusionsDeleted int64  `json:"conclusions_deleted"`
	SummariesDeleted   int64  `json:"summaries_deleted"`
}

type SessionDirectory

type SessionDirectory interface {
	ListMetadataByUserID(ctx context.Context, userID string) ([]SessionMetadata, error)
}

SessionDirectory exposes the canonical user->session metadata seam needed for user-scoped cross-chat search.

type SessionEvidenceIndex added in v0.3.1

type SessionEvidenceIndex struct {
	Scope        SessionEvidenceScope `json:"scope"`
	ProfileID    string               `json:"profile_id,omitempty"`
	Path         string               `json:"path"`
	SessionCount int                  `json:"session_count"`
	LineageCount int                  `json:"lineage_count"`
	UpdatedAt    time.Time            `json:"updated_at,omitempty"`
}

type SessionEvidenceInput added in v0.3.1

type SessionEvidenceInput struct {
	WorkspaceID    string                      `json:"workspace_id"`
	SessionIndexes []SessionEvidenceIndex      `json:"session_indexes,omitempty"`
	MemoryFiles    []SessionEvidenceMemoryFile `json:"memory_files,omitempty"`
	Messages       []MessageRecord             `json:"messages,omitempty"`
	Observations   []Observation               `json:"observations,omitempty"`
	Summaries      []SessionSummary            `json:"summaries,omitempty"`
}

type SessionEvidenceMemoryFile added in v0.3.1

type SessionEvidenceMemoryFile struct {
	Scope          SessionEvidenceScope `json:"scope"`
	ProfileID      string               `json:"profile_id,omitempty"`
	Path           string               `json:"path"`
	Kind           string               `json:"kind"`
	SizeBytes      int64                `json:"size_bytes"`
	ModifiedAt     time.Time            `json:"modified_at,omitempty"`
	NonEmptyLines  int                  `json:"non_empty_lines"`
	HeadingCount   int                  `json:"heading_count"`
	GonchoMentions int                  `json:"goncho_mentions"`
	GormesMentions int                  `json:"gormes_mentions"`
	RawContent     string               `json:"-"`
}

type SessionEvidenceProfileSummary added in v0.3.1

type SessionEvidenceProfileSummary struct {
	ProfileID string `json:"profile_id"`
	SessionEvidenceScopeSummary
}

type SessionEvidenceProjection added in v0.3.1

type SessionEvidenceProjection struct {
	WorkspaceID         string                          `json:"workspace_id"`
	Root                SessionEvidenceScopeSummary     `json:"root"`
	WorkspaceTemplate   SessionEvidenceScopeSummary     `json:"workspace_template"`
	Profiles            []SessionEvidenceProfileSummary `json:"profiles"`
	TotalMemoryFiles    int                             `json:"total_memory_files"`
	TotalGonchoMentions int                             `json:"total_goncho_mentions"`
	TotalGormesMentions int                             `json:"total_gormes_mentions"`
	TimelineEventCount  int                             `json:"timeline_event_count"`
}

func ProjectSessionEvidence added in v0.3.1

func ProjectSessionEvidence(input SessionEvidenceInput) SessionEvidenceProjection

func (SessionEvidenceProjection) Profile added in v0.3.1

func (SessionEvidenceProjection) String added in v0.3.1

func (p SessionEvidenceProjection) String() string

type SessionEvidenceScope added in v0.3.1

type SessionEvidenceScope string
const (
	SessionEvidenceScopeRoot              SessionEvidenceScope = "root"
	SessionEvidenceScopeProfile           SessionEvidenceScope = "profile"
	SessionEvidenceScopeWorkspaceTemplate SessionEvidenceScope = "workspace_template"
)

type SessionEvidenceScopeSummary added in v0.3.1

type SessionEvidenceScopeSummary struct {
	SessionCount    int       `json:"session_count"`
	LineageCount    int       `json:"lineage_count"`
	UpdatedAt       time.Time `json:"updated_at,omitempty"`
	MemoryFileCount int       `json:"memory_file_count"`
	SizeBytes       int64     `json:"size_bytes"`
	NonEmptyLines   int       `json:"non_empty_lines"`
	HeadingCount    int       `json:"heading_count"`
	GonchoMentions  int       `json:"goncho_mentions"`
	GormesMentions  int       `json:"gormes_mentions"`
}

type SessionMemoryDeletionPlan

type SessionMemoryDeletionPlan struct {
	SessionID     string
	Preserve      bool
	Preserved     []MemoryToolEntry
	CascadeForget []MemoryToolEntry
	Unrelated     []MemoryToolEntry
}

func PlanSessionMemoryDeletion

func PlanSessionMemoryDeletion(entries []MemoryToolEntry, sessionID string, cascade bool) SessionMemoryDeletionPlan

type SessionMetadata

type SessionMetadata struct {
	SessionID       string `json:"session_id"`
	Source          string `json:"source,omitempty"`
	ChatID          string `json:"chat_id,omitempty"`
	UserID          string `json:"user_id,omitempty"`
	Title           string `json:"title,omitempty"`
	ParentSessionID string `json:"parent_session_id,omitempty"`
	LineageKind     string `json:"lineage_kind"`
	CreatedAt       int64  `json:"created_at,omitempty"`
	UpdatedAt       int64  `json:"updated_at"`
}

SessionMetadata is the goncho-owned subset of session directory metadata needed for user-scoped cross-chat search. This type exists so goncho can be extracted as a standalone repository without importing internal/session.

type SessionSummary

type SessionSummary struct {
	Content     string `json:"content"`
	MessageID   int64  `json:"message_id"`
	SummaryType string `json:"summary_type"`
	CreatedAt   int64  `json:"created_at"`
	TokenCount  int    `json:"token_count"`
}

SessionSummary is the summary component returned by session context when a short or long summary slot fits inside the requested summary budget.

type SkillLearningProposal

type SkillLearningProposal = skillproposals.SkillLearningProposal

func GetSkillLearningProposal

func GetSkillLearningProposal(ctx context.Context, db *sql.DB, proposalID string) (SkillLearningProposal, error)

type SkillOutcome

type SkillOutcome struct {
	SkillName string
	Success   bool
	Lesson    string
}

SkillOutcome records the result of a skill execution.

type SnapshotDiff

type SnapshotDiff struct {
	FromSnapshotID string          `json:"from_snapshot_id"`
	ToSnapshotID   string          `json:"to_snapshot_id"`
	Added          []SnapshotEntry `json:"added"`
	Removed        []SnapshotEntry `json:"removed"`
	Changed        []SnapshotEntry `json:"changed"`
}

func DiffSnapshotManifests

func DiffSnapshotManifests(from, to SnapshotManifest) SnapshotDiff

type SnapshotEntry

type SnapshotEntry struct {
	Kind     string            `json:"kind"`
	Key      string            `json:"key"`
	Checksum string            `json:"checksum"`
	Metadata map[string]string `json:"metadata,omitempty"`
}

type SnapshotGitMetadata

type SnapshotGitMetadata struct {
	AdapterOwned bool   `json:"adapter_owned"`
	Operation    string `json:"operation"`
	Note         string `json:"note"`
}

type SnapshotManifest

type SnapshotManifest struct {
	ManifestVersion string              `json:"manifest_version"`
	SnapshotID      string              `json:"snapshot_id"`
	WorkspaceID     string              `json:"workspace_id"`
	ProfileID       string              `json:"profile_id,omitempty"`
	Peer            string              `json:"peer"`
	Git             SnapshotGitMetadata `json:"git"`
	Counts          map[string]int      `json:"counts"`
	Entries         []SnapshotEntry     `json:"entries"`
}

type SnapshotParams

type SnapshotParams struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
}

type SnapshotRollbackMetadata

type SnapshotRollbackMetadata struct {
	AdapterOwned     bool   `json:"adapter_owned"`
	Applied          bool   `json:"applied"`
	FromSnapshotID   string `json:"from_snapshot_id"`
	TargetSnapshotID string `json:"target_snapshot_id"`
	Operation        string `json:"operation"`
	Note             string `json:"note"`
}

func BuildSnapshotRollbackMetadata

func BuildSnapshotRollbackMetadata(from, target SnapshotManifest) SnapshotRollbackMetadata

type StoreMemoryTool

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

func NewStoreMemoryTool

func NewStoreMemoryTool(store MemoryToolStore) *StoreMemoryTool

func (StoreMemoryTool) Description

func (t StoreMemoryTool) Description() string

func (StoreMemoryTool) Execute

func (t StoreMemoryTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (StoreMemoryTool) Name

func (t StoreMemoryTool) Name() string

func (StoreMemoryTool) Schema

func (t StoreMemoryTool) Schema() json.RawMessage

func (StoreMemoryTool) Spec

func (t StoreMemoryTool) Spec() toolmeta.OperationSpec

func (StoreMemoryTool) Timeout

func (t StoreMemoryTool) Timeout() time.Duration

type StreamingChatPersistence

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

StreamingChatPersistence buffers stream chunks until a terminal event decides whether the assistant response is complete enough to become durable memory.

func (*StreamingChatPersistence) AppendChunk

func (p *StreamingChatPersistence) AppendChunk(chunk string)

func (*StreamingChatPersistence) Complete

func (*StreamingChatPersistence) Interrupt

func (p *StreamingChatPersistence) Interrupt(reason string) ChatResult

type StructuredSummary

type StructuredSummary struct {
	FilesModified []string `json:"files_modified,omitempty"`
	DecisionsMade []string `json:"decisions_made,omitempty"`
	OpenQuestions []string `json:"open_questions,omitempty"`
	SkillOutcomes []string `json:"skill_outcomes,omitempty"`
	NextSteps     []string `json:"next_steps,omitempty"`
}

StructuredSummary captures session-end facts for cross-session continuity.

type SummarizeMemoryTool

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

func NewSummarizeMemoryTool

func NewSummarizeMemoryTool(store MemoryToolStore) *SummarizeMemoryTool

func (SummarizeMemoryTool) Description

func (t SummarizeMemoryTool) Description() string

func (SummarizeMemoryTool) Execute

func (t SummarizeMemoryTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (SummarizeMemoryTool) Name

func (t SummarizeMemoryTool) Name() string

func (SummarizeMemoryTool) Schema

func (t SummarizeMemoryTool) Schema() json.RawMessage

func (SummarizeMemoryTool) Spec

func (t SummarizeMemoryTool) Spec() toolmeta.OperationSpec

func (SummarizeMemoryTool) Timeout

func (t SummarizeMemoryTool) Timeout() time.Duration

type TeamFeedAuditEvent added in v0.3.0

type TeamFeedAuditEvent struct {
	ID               int64            `json:"id"`
	WorkspaceID      string           `json:"workspace_id"`
	ProfileID        string           `json:"profile_id,omitempty"`
	Peer             string           `json:"peer"`
	Actor            string           `json:"actor"`
	ActorWorkspaceID string           `json:"actor_workspace_id,omitempty"`
	ActorProfileID   string           `json:"actor_profile_id,omitempty"`
	Role             string           `json:"role,omitempty"`
	Decision         TeamFeedDecision `json:"decision"`
	Reason           string           `json:"reason,omitempty"`
	CreatedAt        int64            `json:"created_at"`
}

type TeamFeedAuditQuery added in v0.3.0

type TeamFeedAuditQuery struct {
	WorkspaceID string `json:"workspace_id,omitempty"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	Limit       int    `json:"limit,omitempty"`
}

type TeamFeedAuditResult added in v0.3.0

type TeamFeedAuditResult struct {
	Events []TeamFeedAuditEvent `json:"events"`
	Count  int                  `json:"count"`
}

type TeamFeedDecision added in v0.3.0

type TeamFeedDecision string
const (
	TeamFeedDecisionAllowed TeamFeedDecision = "allowed"
	TeamFeedDecisionDenied  TeamFeedDecision = "denied"
)

type TeamFeedEntry added in v0.3.0

type TeamFeedEntry struct {
	ID          string `json:"id"`
	Kind        string `json:"kind"`
	WorkspaceID string `json:"workspace_id"`
	ProfileID   string `json:"profile_id,omitempty"`
	Peer        string `json:"peer"`
	ActionID    string `json:"action_id"`
	SignalID    int64  `json:"signal_id"`
	Signal      string `json:"signal"`
	Message     string `json:"message,omitempty"`
	Actor       string `json:"actor,omitempty"`
	CreatedAt   int64  `json:"created_at"`
}

type TeamFeedQuery added in v0.3.0

type TeamFeedQuery struct {
	WorkspaceID      string `json:"workspace_id,omitempty"`
	ProfileID        string `json:"profile_id,omitempty"`
	Peer             string `json:"peer"`
	Actor            string `json:"actor"`
	ActorWorkspaceID string `json:"actor_workspace_id,omitempty"`
	ActorProfileID   string `json:"actor_profile_id,omitempty"`
	Role             string `json:"role,omitempty"`
	Limit            int    `json:"limit,omitempty"`
	Cursor           string `json:"cursor,omitempty"`
}

type TeamFeedResult added in v0.3.0

type TeamFeedResult struct {
	Authorized bool             `json:"authorized"`
	Decision   TeamFeedDecision `json:"decision"`
	Reason     string           `json:"reason,omitempty"`
	Entries    []TeamFeedEntry  `json:"entries"`
	NextCursor string           `json:"next_cursor,omitempty"`
	AuditID    int64            `json:"audit_id,omitempty"`
}

type TextEmbeddingProvider added in v0.3.0

type TextEmbeddingProvider interface {
	EmbedText(ctx context.Context, text string) ([]float64, error)
}

TextEmbeddingProvider turns text into deterministic local vectors. It is kept separate from VectorStore so embedding generation and vector storage can be tested, swapped, and audited independently.

type UnsupportedFilterError

type UnsupportedFilterError = searchfilter.UnsupportedFilterError

type UpdateMemoryTool

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

func NewUpdateMemoryTool

func NewUpdateMemoryTool(store MemoryToolStore) *UpdateMemoryTool

func (UpdateMemoryTool) Description

func (t UpdateMemoryTool) Description() string

func (UpdateMemoryTool) Execute

func (t UpdateMemoryTool) Execute(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

func (UpdateMemoryTool) Name

func (t UpdateMemoryTool) Name() string

func (UpdateMemoryTool) Schema

func (t UpdateMemoryTool) Schema() json.RawMessage

func (UpdateMemoryTool) Spec

func (t UpdateMemoryTool) Spec() toolmeta.OperationSpec

func (UpdateMemoryTool) Timeout

func (t UpdateMemoryTool) Timeout() time.Duration

type VectorSearchHit

type VectorSearchHit struct {
	MemoryID   string            `json:"memory_id"`
	SourceType string            `json:"source_type,omitempty"`
	Content    string            `json:"content"`
	SessionID  string            `json:"session_id,omitempty"`
	AgentID    string            `json:"agent_id,omitempty"`
	ScopeID    string            `json:"scope_id,omitempty"`
	CreatedAt  time.Time         `json:"created_at,omitempty"`
	Importance float64           `json:"importance,omitempty"`
	Score      float64           `json:"score"`
	Metadata   map[string]string `json:"metadata,omitempty"`
}

VectorSearchHit is one semantic hit returned by a VectorStore.

type VectorSearchQuery

type VectorSearchQuery struct {
	WorkspaceID string   `json:"workspace_id"`
	ProfileID   string   `json:"profile_id,omitempty"`
	Peer        string   `json:"peer"`
	Query       string   `json:"query"`
	SessionKey  string   `json:"session_key,omitempty"`
	ScopeID     string   `json:"scope_id,omitempty"`
	Sources     []string `json:"sources,omitempty"`
	Limit       int      `json:"limit,omitempty"`
}

VectorSearchQuery is the host-neutral request passed to an optional VectorStore during recall candidate generation.

type VectorStore

type VectorStore interface {
	Search(ctx context.Context, query VectorSearchQuery) ([]VectorSearchHit, error)
}

VectorStore is the optional host-owned semantic retrieval seam. Implementations may use local embeddings, an in-process ANN index, or deterministic fakes in tests; Goncho treats returned hits as semantic evidence and fuses them with lexical/graph recall through the existing RRF scorer.

type VerifiedCodeClaim

type VerifiedCodeClaim struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Status  string `json:"status"`
}

type VerifiedCodeContextParams

type VerifiedCodeContextParams struct {
	Peer       string `json:"peer"`
	SessionKey string `json:"session_key,omitempty"`
	Query      string `json:"query,omitempty"`
	RepoRoot   string `json:"repo_root"`
	MaxTokens  int    `json:"max_tokens,omitempty"`
}

type VerifiedCodeContextResult

type VerifiedCodeContextResult struct {
	WorkspaceID    string                       `json:"workspace_id"`
	Peer           string                       `json:"peer"`
	SessionKey     string                       `json:"session_key,omitempty"`
	Representation string                       `json:"representation"`
	VerifiedClaims []VerifiedCodeClaim          `json:"verified_claims"`
	StaleClaims    []VerifiedCodeClaim          `json:"stale_claims"`
	Unavailable    []ContextUnavailableEvidence `json:"unavailable,omitempty"`
}

type ViewerConclusion added in v0.3.0

type ViewerConclusion struct {
	ID          int64     `json:"id"`
	WorkspaceID string    `json:"workspace_id"`
	ProfileID   string    `json:"profile_id,omitempty"`
	PeerID      string    `json:"peer_id"`
	SessionKey  string    `json:"session_key,omitempty"`
	Content     string    `json:"content"`
	Scope       string    `json:"scope"`
	Status      string    `json:"status"`
	CreatedAt   time.Time `json:"created_at"`
}

type ViewerCounts added in v0.3.0

type ViewerCounts struct {
	Workspaces     int `json:"workspaces"`
	Profiles       int `json:"profiles"`
	Sessions       int `json:"sessions"`
	Messages       int `json:"messages"`
	Observations   int `json:"observations"`
	Conclusions    int `json:"conclusions"`
	ReviewOpen     int `json:"review_open"`
	ReviewResolved int `json:"review_resolved"`
}

type ViewerDBInfo added in v0.3.0

type ViewerDBInfo struct {
	Path string `json:"path"`
}

type ViewerMemoryReport added in v0.3.1

type ViewerMemoryReport struct {
	Status      string              `json:"status"`
	ReadOnly    bool                `json:"read_only"`
	WorkspaceID string              `json:"workspace_id"`
	Facet       string              `json:"facet,omitempty"`
	Value       string              `json:"value,omitempty"`
	AgentScope  *AgentScopeEvidence `json:"agent_scope,omitempty"`
	Items       []ViewerConclusion  `json:"items"`
	GeneratedAt time.Time           `json:"generated_at"`
}

type ViewerOrientationPack added in v0.3.1

type ViewerOrientationPack struct {
	Status           string                       `json:"status"`
	ReadOnly         bool                         `json:"read_only"`
	WorkspaceID      string                       `json:"workspace_id"`
	Peer             string                       `json:"peer"`
	Query            string                       `json:"query,omitempty"`
	SessionKey       string                       `json:"session_key,omitempty"`
	Context          ContextResult                `json:"context"`
	InclusionReasons []ContextInclusionReason     `json:"inclusion_reasons"`
	Warnings         []ContextUnavailableEvidence `json:"warnings,omitempty"`
	GeneratedAt      time.Time                    `json:"generated_at"`
}

type ViewerRecallTrace added in v0.3.1

type ViewerRecallTrace struct {
	Status          string                  `json:"status"`
	ReadOnly        bool                    `json:"read_only"`
	WorkspaceID     string                  `json:"workspace_id"`
	Peer            string                  `json:"peer"`
	Query           string                  `json:"query"`
	SessionKey      string                  `json:"session_key,omitempty"`
	Trace           RecallTrace             `json:"trace"`
	Diagnostics     RecallDiagnosticsReport `json:"diagnostics"`
	DiagnosticsText string                  `json:"diagnostics_text"`
	QueryExpansion  []EvidenceItem          `json:"query_expansion,omitempty"`
	GeneratedAt     time.Time               `json:"generated_at"`
}

ViewerRecallTrace is the read-only viewer wrapper around a recall trace.

type ViewerReviewQueue added in v0.3.0

type ViewerReviewQueue struct {
	Open       int          `json:"open"`
	Resolved   int          `json:"resolved"`
	LatestOpen []ReviewItem `json:"latest_open"`
}

type ViewerSessionTimeline added in v0.3.0

type ViewerSessionTimeline struct {
	Status       string                `json:"status"`
	ReadOnly     bool                  `json:"read_only"`
	WorkspaceID  string                `json:"workspace_id"`
	SessionKey   string                `json:"session_key"`
	Messages     []MessageRecord       `json:"messages"`
	Observations []Observation         `json:"observations"`
	Summaries    []SessionSummary      `json:"summaries"`
	Events       []ViewerTimelineEvent `json:"events"`
	GeneratedAt  time.Time             `json:"generated_at"`
}

type ViewerSnapshot added in v0.3.0

type ViewerSnapshot struct {
	Status                     string                      `json:"status"`
	ReadOnly                   bool                        `json:"read_only"`
	WorkspaceID                string                      `json:"workspace_id"`
	ObserverPeerID             string                      `json:"observer_peer_id"`
	DB                         ViewerDBInfo                `json:"db"`
	Counts                     ViewerCounts                `json:"counts"`
	LatestObservations         []Observation               `json:"latest_observations"`
	LatestConclusions          []ViewerConclusion          `json:"latest_conclusions"`
	ReviewQueue                ViewerReviewQueue           `json:"review_queue"`
	NegativeEvidenceCandidates []NegativeEvidenceCandidate `json:"negative_evidence_candidates,omitempty"`
	GeneratedAt                time.Time                   `json:"generated_at"`
	UnavailableWarnings        []string                    `json:"unavailable_warnings,omitempty"`
}

ViewerSnapshot is the read-only JSON model for Goncho's local viewer API.

type ViewerTimelineEvent added in v0.3.0

type ViewerTimelineEvent struct {
	Type      string `json:"type"`
	ID        string `json:"id"`
	AtUnix    int64  `json:"at_unix"`
	Sequence  int    `json:"sequence,omitempty"`
	Kind      string `json:"kind,omitempty"`
	Role      string `json:"role,omitempty"`
	PeerID    string `json:"peer_id,omitempty"`
	Content   string `json:"content,omitempty"`
	Source    string `json:"source"`
	Truncated bool   `json:"truncated,omitempty"`
}

type WebhookClock

type WebhookClock = webhookspkg.WebhookClock

type WebhookDeliveryAttempt

type WebhookDeliveryAttempt = webhookspkg.WebhookDeliveryAttempt

type WebhookDeliveryEndpoint

type WebhookDeliveryEndpoint = webhookspkg.WebhookDeliveryEndpoint

type WebhookDeliveryEvidence

type WebhookDeliveryEvidence = webhookspkg.WebhookDeliveryEvidence

type WebhookDeliveryRequest

type WebhookDeliveryRequest = webhookspkg.WebhookDeliveryRequest

type WebhookDeliveryResult

type WebhookDeliveryResult = webhookspkg.WebhookDeliveryResult

type WebhookDeliveryStore

type WebhookDeliveryStore = webhookspkg.WebhookDeliveryStore

type WebhookDeliveryWorker

type WebhookDeliveryWorker = webhookspkg.WebhookDeliveryWorker

type WebhookEndpoint

type WebhookEndpoint = webhookspkg.WebhookEndpoint

type WebhookEndpointCreateParams

type WebhookEndpointCreateParams = webhookspkg.WebhookEndpointCreateParams

type WebhookEndpointCreateResult

type WebhookEndpointCreateResult = webhookspkg.WebhookEndpointCreateResult

type WebhookEvent

type WebhookEvent = webhookspkg.WebhookEvent

func NewQueueEmptyWebhookEvent

func NewQueueEmptyWebhookEvent(params QueueEmptyWebhookEventParams) (WebhookEvent, error)

func NewTestWebhookEvent

func NewTestWebhookEvent(workspaceID string) (WebhookEvent, error)

type WebhookEventType

type WebhookEventType = webhookspkg.WebhookEventType

type WebhookHTTPClient

type WebhookHTTPClient = webhookspkg.WebhookHTTPClient

type WebhookHTTPRequest

type WebhookHTTPRequest = webhookspkg.WebhookHTTPRequest

type WebhookHTTPResponse

type WebhookHTTPResponse = webhookspkg.WebhookHTTPResponse

type WorkspaceDecision

type WorkspaceDecision struct {
	WorkspaceID   string
	HardIsolation bool
	Evidence      []string
}

func ResolveWorkspace

func ResolveWorkspace(req WorkspaceRequest) (WorkspaceDecision, error)

type WorkspaceDeletionResult

type WorkspaceDeletionResult struct {
	WorkspaceID        string `json:"workspace_id"`
	MessagesDeleted    int64  `json:"messages_deleted"`
	PeerCardsDeleted   int64  `json:"peer_cards_deleted"`
	ConclusionsDeleted int64  `json:"conclusions_deleted"`
	SummariesDeleted   int64  `json:"summaries_deleted"`
	DreamsDeleted      int64  `json:"dreams_deleted"`
}

type WorkspaceRequest

type WorkspaceRequest struct {
	Strategy    WorkspaceStrategy
	WorkspaceID string
	UserID      string
}

type WorkspaceStrategy

type WorkspaceStrategy string
const (
	WorkspaceStrategyDefault       WorkspaceStrategy = "default"
	WorkspaceStrategyHardIsolation WorkspaceStrategy = "hard_isolation"
	WorkspaceStrategyPerUser       WorkspaceStrategy = "per_user"
)

Source Files

Jump to

Keyboard shortcuts

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