window

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package window implements the sliding window analysis engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecordsForBudget

func RecordsForBudget(records []types.Record, budget int) int

RecordsForBudget returns how many records from the slice fit within the given token budget.

Types

type Engine

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

Engine orchestrates the sliding window analysis.

func NewEngine

func NewEngine(client llm.Client, builder *prompt.Builder, mgr *job.Manager, cfg *EngineConfig) *Engine

NewEngine creates a new analysis engine.

func (*Engine) Run

func (e *Engine) Run(ctx context.Context, records []types.Record, state *types.WindowState) (*types.AnalysisResult, error)

Run executes the sliding window analysis over the given records. If state is non-nil, resumes from the checkpoint.

type EngineConfig

type EngineConfig struct {
	ContextLimit int
	OverlapRatio float64
	MaxFindings  int
	JobID        string
	Params       *types.AnalysisParam
	Stderr       io.Writer
	Debug        bool
}

EngineConfig holds configuration for the analysis engine.

type MemoryMap

type MemoryMap struct {
	SystemPrompt    int
	PreviousSummary int
	Findings        int
	RawData         int
	ResponseBuffer  int
}

MemoryMap describes how the context budget is allocated.

func ComputeMemoryMap

func ComputeMemoryMap(contextLimit int, summaryTokens int, findingsTokens int) MemoryMap

ComputeMemoryMap calculates the context budget allocation based on current summary and findings token usage.

Jump to

Keyboard shortcuts

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