digest

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package digest generates periodic summaries of recent Eidetic memories and delivers them to channel bots. It follows the Second Brain pattern: Capture -> Sort -> Store -> Digest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chatter

type Chatter interface {
	Chat(ctx context.Context, sessionKey, message string) (agentapi.Response, error)
}

Chatter is the minimal agent interface needed for LLM summarization.

type Config

type Config struct {
	Enabled    bool   `json:"enabled"`
	Schedule   string `json:"schedule"`      // "daily", "weekly", or cron expression (only daily/weekly supported now)
	Hour       int    `json:"hour"`          // hour of day to run (0-23), default 8
	Timezone   string `json:"timezone"`      // IANA timezone, default "America/New_York"
	Target     string `json:"target"`        // delivery target: "last" (all paired), "none"
	LookbackH  int    `json:"lookbackHours"` // hours to look back, default 24 for daily
	MaxEntries int    `json:"maxEntries"`    // max entries to summarize, default 50
}

Config controls digest generation behavior.

type Deliverer

type Deliverer interface {
	SendToAllPaired(text string)
}

Deliverer can broadcast a message to all paired users on a channel.

type Runner

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

Runner generates periodic memory digests using an LLM.

func NewRunner

func NewRunner(cfg Config, ec eidetic.Client, chatter Chatter, deliverers []Deliverer, logger *zap.SugaredLogger, stateFile string) *Runner

NewRunner creates a digest runner. stateFile is the path to persist scheduling state across restarts (e.g. ~/.roger/state/digest-state.json). Pass "" to disable persistence (in-memory only).

func (*Runner) GenerateDigest

func (r *Runner) GenerateDigest(ctx context.Context) (string, error)

GenerateDigest fetches recent memories, sends them to the LLM with a digest prompt, and returns the summary text.

func (*Runner) Start

func (r *Runner) Start(ctx context.Context) error

Start runs the digest scheduling loop until ctx is cancelled. It checks every 15 minutes whether it's time to generate a digest.

Jump to

Keyboard shortcuts

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