learning

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDreamsFile     = "DREAMS.md"
	DefaultDreamingSubdir = "memory/dreaming"
)

Variables

This section is empty.

Functions

func FormatBackgroundReviewNotification added in v0.3.14

func FormatBackgroundReviewNotification(mode string, notices []string) string

FormatBackgroundReviewNotification builds a short chat line after review writes.

func FormatHelp

func FormatHelp() string

FormatHelp returns /learn usage text.

func NewBackgroundReview added in v0.3.13

func NewBackgroundReview(cfg BackgroundReviewConfig, deps backgroundReviewDeps) (agentkit.HookProvider, error)

NewBackgroundReview registers hook/background-review: spawn an LLM review fork after each successful turn.

func NewDreamSweep added in v0.1.17

func NewDreamSweep(cfg DreamSweepConfig, deps DreamSweepDeps) (capschedule.Runtime, error)

NewDreamSweep registers learning/dream-sweep: background grounded dreaming sweeps.

func NewLearnCaptureTool added in v0.3.14

func NewLearnCaptureTool(mem capmemory.Capture, skills caplearning.SkillProposer) (agentkit.Tool, error)

NewLearnCaptureTool builds the isolated review-fork tool (not registered as a separate plugin kind).

func NormalizeMemoryNotifications added in v0.3.14

func NormalizeMemoryNotifications(mode string) string

NormalizeMemoryNotifications maps hook config to off | on | verbose.

func SummarizeSessionUserMessages

func SummarizeSessionUserMessages(ctx context.Context, store agentkit.SessionStore, sessionID agentkit.SessionID, maxMessages int) (string, error)

SummarizeSessionUserMessages extracts recent user text from the current session.

Types

type BackgroundReviewConfig added in v0.3.13

type BackgroundReviewConfig struct {
	Enabled             *bool  `json:"enabled"`
	Model               string `json:"model"`
	MaxSteps            int    `json:"maxSteps"`
	MaxDigestMessages   int    `json:"maxDigestMessages"`
	SkipSlashOnly       *bool  `json:"skipSlashOnly"`
	MinTurnTokens       int    `json:"minTurnTokens"`
	MaxReviewsPerDay    int    `json:"maxReviewsPerDay"`
	MinIdleSeconds      int    `json:"minIdleSeconds"`
	MemoryNotifications string `json:"memoryNotifications"` // off | on | verbose (Hermes display.memory_notifications)
	// MemoryNudgeInterval user turns between automatic memory reviews (Hermes memory.nudge_interval). 0 disables; default 10.
	MemoryNudgeInterval *int `json:"memoryNudgeInterval"`
	// SessionRecall when false, skip FTS prior-session block in the review digest (use tool/session-search instead).
	SessionRecall *bool `json:"sessionRecall"`
}

BackgroundReviewConfig controls post-turn LLM review (Hermes-style learning fork).

type Config

type Config struct {
	Disabled    bool            `json:"disabled"`
	SessionsDir string          `json:"sessionsDir"`
	Dreaming    dreaming.Config `json:"dreaming"`
	Workshop    workshop.Config `json:"workshop"`
}

type Deps

type Deps struct {
	Workspace    workspace.Service     `json:"workspace"`
	SessionStore agentkit.SessionStore `json:"sessionStore"`
	Memory       capmemory.Service     `json:"memory"`
}

type DreamSweep added in v0.1.17

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

DreamSweep runs scheduled dreaming sweeps without agent turns.

func (*DreamSweep) Start added in v0.1.17

func (*DreamSweep) Stop added in v0.1.17

func (d *DreamSweep) Stop(context.Context) error

type DreamSweepConfig added in v0.1.17

type DreamSweepConfig struct {
	PollSeconds int `json:"pollSeconds"`
}

type DreamSweepDeps added in v0.1.17

type DreamSweepDeps struct {
	Learning caplearning.DreamSweepScheduler `json:"learning"`
}

type Service

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

Service owns dreaming, workshop, and /learn commands (memory.md is memory/default).

func New

func New(cfg Config, deps Deps) (*Service, error)

New registers learning/default: dreaming, workshop, and /learn (memory via deps.Memory).

func (*Service) CaptureSkillPropose added in v0.3.13

func (s *Service) CaptureSkillPropose(ctx context.Context, name, body, sessionID, focus, source string) (string, error)

CaptureSkillPropose implements caplearning.SkillProposer.

func (*Service) Commands

func (s *Service) Commands() []agentkit.Command

func (*Service) Disabled added in v0.3.14

func (s *Service) Disabled() bool

func (*Service) DreamSweepDue added in v0.3.14

func (s *Service) DreamSweepDue(ctx context.Context) bool

func (*Service) OnMemoryCommitted added in v0.3.14

func (s *Service) OnMemoryCommitted(ctx context.Context, text, source string, outcome capmemory.AddOutcome)

func (*Service) ReviewNudgeLoad added in v0.3.14

func (s *Service) ReviewNudgeLoad(ctx context.Context, sessionID string) (caplearning.NudgeSessionState, bool, error)

func (*Service) ReviewNudgeSave added in v0.3.14

func (s *Service) ReviewNudgeSave(ctx context.Context, sessionID string, state caplearning.NudgeSessionState) error

func (*Service) ReviewSignalCandidates added in v0.3.14

func (s *Service) ReviewSignalCandidates(ctx context.Context) string

ReviewSignalCandidates builds a digest block from dreaming short-term signals for background review.

func (*Service) RunScheduledDreamSweep added in v0.3.14

func (s *Service) RunScheduledDreamSweep(ctx context.Context) error

func (*Service) SessionsDir added in v0.3.14

func (s *Service) SessionsDir() string

func (*Service) TryConsumeReviewQuota added in v0.3.14

func (s *Service) TryConsumeReviewQuota(ctx context.Context, maxPerDay int) (bool, error)

func (*Service) Workspace added in v0.3.14

func (s *Service) Workspace() workspace.Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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