Memory · Software component

Sliding-Window History Truncator

Software componentMemoryCognition & Memoryarc:SlidingWindowHistoryTruncator

A context window manager that retains only the most recent N items of a history field, discarding older ones.

Responsibility. Keeps only the last N history items in state.

Also known as: keep_last_n operator, Maximum history limit, ConversationBufferWindowMemory, Blind context truncation, Truncation, Rolling buffer

Variant of Context Window Manager abstract

When to choose. Choose as the simplest bound when losing early conversation detail is acceptable.

specializesalternative tois target of alternativeTois target of alternativeToalternative tois configured byis target of alternativeToContext Window Manager: specializesContext Window ManagerSummarizing History Compressor: alternative toSummarizing History Comp…Hierarchical History Compressor: is target of alternativeToHierarchical History Com…Full Conversation Buffer: is target of alternativeToFull Conversation BufferTrajectory Pruner: alternative toTrajectory PrunerAgent State Schema: is configured byAgent State SchemaImportance-Weighted History Retainer: is target of alternativeToImportance-Weighted Hist…
Direct neighbourhood (hover for relationship types)

Relationships

is configured by structural

alternative to variability

Design guidance

Quantitative guidance

As stated by the sources; verify before use.

Classification

Patterns
Sliding window
Technologies
LangGraph state annotationsLangChain
Quality attributes
Maintainability (ISO/IEC 25010)
Risks mitigated
Context overflow

Sources

  1. Ch1.6: T. Nguyen, "Stateful Orchestration - Pitfalls, Integration, and Synthesis," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 1.6. ISBN: 9798244538229.
  2. Ch2.3: T. Nguyen, "LangChain Sequential Frameworks," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 2.3. ISBN: 9798244538229.
  3. Ch3.10: T. Nguyen, "Efficiency Metrics," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 3.10. ISBN: 9798244538229.
  4. Ch5.9: T. Nguyen, "Working Memory," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 5.9. ISBN: 9798244538229.
  5. Ref5.04: C. Stryker, "What is AI agent memory?," IBM Think. Accessed: Sep. 27, 2026. [Online]. Available: https://www.ibm.com/think/topics/ai-agent-memory