reflect

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 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 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 }

Reflector distills lessons from a transcript using a Chatter.

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) ([]knowledge.Pitfall, error)

Reflect returns the durable pitfalls learned from t. A turn with no tool use (a plain chat exchange) has nothing to learn, so it skips the model call entirely — 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