contextguru

package
v0.0.0-...-4ef879c Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 16 Imported by: ? 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 contextguru is an outbound AuthBridge plugin that compacts an agent's LLM request context before it is forwarded upstream, using the embedded github.com/rossoctl/context-guru engine. It runs in the pre-LLM hook (OnRequest): it hands the outbound request body to apply.BodyWithModel, and if the engine rewrote it (dropped/reduced tool outputs, injected cache_control, etc.) it replaces the body via pctx.SetBody. OnResponse is a pass-through in v1 — model-driven restoration/expand is a later integration.

It is the single outbound WritesRequestBody plugin, so it is mutually exclusive with SPARC on the outbound chain (the pipeline refuses to build with two). It declares RequiresAny: [inference-parser] so a parser establishes the request is an inference call before it runs.

LLM-backed engine components (summarize, extract:code) are optional: configure a `model:` block to enable a static cheap model, and the plugin also reconstructs the agent's own "incoming" model from the live request so a component with model.source: incoming can reuse it. With no model available those components degrade to deterministic/no-op.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextGuru

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

ContextGuru is the plugin. pipe/store are built once at Configure and shared across requests (store is synchronized; the engine holds no mutable pipeline state). static is the configured cheap model (nil when none).

func New

func New() *ContextGuru

New returns an unconfigured plugin instance.

func (*ContextGuru) Capabilities

func (p *ContextGuru) Capabilities() pipeline.PluginCapabilities

func (*ContextGuru) ConfigSchema

func (p *ContextGuru) ConfigSchema() []pipeline.FieldSchema

ConfigSchema surfaces the operator-facing fields in abctl / /v1/plugins.

func (*ContextGuru) Configure

func (p *ContextGuru) Configure(raw json.RawMessage) error

func (*ContextGuru) Name

func (p *ContextGuru) Name() string

func (*ContextGuru) OnRequest

func (p *ContextGuru) OnRequest(ctx context.Context, pctx *pipeline.Context) pipeline.Action

func (*ContextGuru) OnResponse

func (p *ContextGuru) OnResponse(_ context.Context, _ *pipeline.Context) pipeline.Action

OnResponse is a pass-through in v1. The model-driven expand loop (resolve markers from the Store + re-invoke upstream via llmclient) would live here in a later integration; the Store + session key are already threaded for it.

Jump to

Keyboard shortcuts

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