Skip to main content

Crate goose_context_management

Crate goose_context_management 

Source
Expand description

Conversation compaction: summarizing a message history down to a single message so a conversation can continue past a model’s context window.

Three layers, smallest first:

  • [summarize] - given a model and messages, produce one summary message.
  • compact - the trait-based API (CompactionInput / CompactionOutput) letting a caller read from and write back to its own conversation representation. Rust only.

Cross-language (Python/Kotlin) access is exposed by goose-sdk, which wraps this crate in its uniffi bindings.

Re-exports§

pub use format::format_message_for_compacting;
pub use model::CompactionModel;
pub use model::ProviderModel;
pub use model::TokenEstimator;
pub use provider::CompactingProvider;
pub use structured::FileActivity;
pub use structured::StructuredSummary;
pub use summarize::summarize;
pub use summarize::Summary;
pub use templates::Templates;

Modules§

format
model
provider
Provider-level compaction: retry a completion that overflowed the context window against a compacted history instead of surfacing the error.
structured
summarize
templates

Constants§

DEFAULT_COMPACTION_THRESHOLD

Traits§

CompactionInput
Everything compaction reads from the caller’s conversation.
CompactionOutput
Where compaction writes its result back into the caller’s conversation.

Functions§

compact