goncho

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 36 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.

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.2.0, 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.2.0 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"

	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 (
	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 (
	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"

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 ErrMemorySlotConflict = errors.New("goncho: memory slot conflict")
View Source
var ErrMemorySlotNotFound = errors.New("goncho: memory slot not found")
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 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"`
}

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 ActionStatus

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

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 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
}

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 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"`
	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 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 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 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 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 GraphRelation

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

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 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"
	HostHookUserPrompt        HostHookEventName = "user_prompt"
	HostHookPostToolUse       HostHookEventName = "post_tool_use"
	HostHookAssistantResponse HostHookEventName = "assistant_response"
	HostHookCompact           HostHookEventName = "compact"
	HostHookSessionEnd        HostHookEventName = "session_end"
	HostHookFailure           HostHookEventName = "failure"
)

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 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 MemoryImportanceUpdater

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

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 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 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 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"`
	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 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 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 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 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"`
}

type RecallReplay

type RecallReplay struct {
	Service              string              `json:"service"`
	TraceID              string              `json:"trace_id"`
	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"`
	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 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 RejectedRecallCandidate

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

type RetentionAction

type RetentionAction = importance.RetentionAction
const (
	RetentionActionSummarize RetentionAction = importance.RetentionActionSummarize
	RetentionActionForget    RetentionAction = importance.RetentionActionForget
)

type RetentionCandidate

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

type RetentionPolicy

type RetentionPolicy = importance.RetentionPolicy

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 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"`
	Results       []SearchHit              `json:"results"`
}

SearchResultSet is the stable JSON shape for honcho_search.

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) AppendMemorySlot

func (s *Service) AppendMemorySlot(ctx context.Context, params MemorySlotParams) (MemorySlot, 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) 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) 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) ExportSnapshotManifest

func (s *Service) ExportSnapshotManifest(ctx context.Context, params SnapshotParams) (SnapshotManifest, 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) 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) ListReviewItems

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

func (*Service) ListWebhookEndpoints

func (s *Service) ListWebhookEndpoints(ctx context.Context, workspaceID string) ([]WebhookEndpoint, 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) 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) 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) 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) RejectSkillLearningProposal

func (s *Service) RejectSkillLearningProposal(ctx context.Context, p SkillLearningProposalReviewParams) (SkillLearningProposal, 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) 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) UpsertAction

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

func (*Service) VerifiedCodeContext

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

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 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 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 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"
)

Jump to

Keyboard shortcuts

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