Skip to content

PmeCompactionStrategy

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/pme-core/src/context/pme-compaction-strategy.ts

Implements: CompactionStrategy

Methods

MethodSignatureReturns
shouldPreserveshouldPreserve(item: ContextItem)boolean
summarizesummarize(items: ContextItem[])string

Where it refuses work

  • PmeCompactionStrategy stops the work with an early return when item.role === 'system'.
  • PmeCompactionStrategy stops the work with an early return when item.tags?.some((t) => PRESERVE_TAGS.has(t)).
  • PmeCompactionStrategy stops the work with an early return when item.tokenEstimate < 200.

Was this page helpful?

Download as PDF