reflect

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package reflect runs the post-task learning pass: it asks the model to distill durable lessons from a finished transcript and returns them as pitfalls for the knowledge base. Parse failures yield no lessons (not an error); only a transport failure surfaces as ReflectionError.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lessons added in v0.4.2

type Lessons struct {
	Pitfalls []knowledge.Pitfall
	Facts    []string
}

Lessons is what a reflection pass distills: environment-general tool pitfalls (saved to the global knowledge base) and durable facts about THIS project (saved per workspace, folded into the prompt next time).

type ReflectionError

type ReflectionError struct{ Err error }

ReflectionError wraps a host-level failure of the reflection pass (the model call itself failing).

func (*ReflectionError) Error

func (e *ReflectionError) Error() string

func (*ReflectionError) Unwrap

func (e *ReflectionError) Unwrap() error

type Reflector

type Reflector struct {
	LLM  llm.Chatter
	Lite bool
}

Reflector distills lessons from a transcript using a Chatter. Lite uses a simpler, facts-only prompt — for a small local model that loops on the full two-part ask.

func New

func New(l llm.Chatter) *Reflector

New constructs a Reflector.

func (*Reflector) Reflect

func (r *Reflector) Reflect(ctx context.Context, t agent.Transcript) (Lessons, error)

Reflect distills lessons from t. A turn with no tool use (a plain chat) has nothing to learn, so it skips the model call — no point making a small model reason over an empty run.

Jump to

Keyboard shortcuts

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