Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

autourgos-summary-memory

Framework: Autourgos Python License: Apache 2.0 Author Contributor Contributor

LLM-compressed rolling summary memory for Autourgos agents. Keeps the last N messages in full. When the buffer overflows, older messages are fed to an LLM for compression and merged into a rolling summary. The summary + recent messages are both included in every LLM prompt.

from autourgos_summary_memory import SummaryBufferedMemory
from autourgos_openaichat import OpenAIChatModel
from autourgos_agent import Agent

summarizer_llm = OpenAIChatModel(model="gpt-4o-mini")  # needs OPENAI_API_KEY set
memory = SummaryBufferedMemory(llm=summarizer_llm, max_messages=10)
agent = Agent(llm=summarizer_llm, memory=memory)
agent.invoke("Start a long research task...")

Features

  • Rolling LLM compression — older messages are summarized, not dropped, so context survives long conversations
  • Works without an LLM too — falls back to verbatim concatenation, still prevents unbounded growth
  • Pairs with autourgos-summarizer — that package compresses the agent's reasoning scratchpad, this one compresses conversation history; different jobs, safe to use together

Table of Contents


Install

pip install autourgos-summary-memory

Quick Start

from autourgos_summary_memory import SummaryBufferedMemory
from autourgos_openaichat import OpenAIChatModel
from autourgos_agent import Agent

# Use a cheap model for summarization
summarizer_llm = OpenAIChatModel(model="gpt-4o-mini")  # needs OPENAI_API_KEY set
my_llm = summarizer_llm  # or any other chat-model instance for the main agent

memory = SummaryBufferedMemory(
    llm=summarizer_llm,
    max_messages=10,   # keep last 10 messages in full; compress the rest
)
agent = Agent(llm=my_llm, memory=memory)
agent.invoke("Start a long research task...")

Without an LLM

If no LLM is provided, overflow messages are concatenated verbatim (no AI compression). Still prevents unbounded growth:

memory = SummaryBufferedMemory(max_messages=10)

Parameters

Parameter Type Default Description
llm any None LLM with .invoke(prompt). Falls back to raw concat if not set.
max_messages int 10 Recent messages kept in full before compression triggers.
moving_summary str "" Seed summary to start with (optional).

What format_for_llm Returns

--- Summary of Past Conversation ---
[compressed history here]
------------------------------------

--- Recent Conversation Context ---
[2024-...] user: latest messages
[2024-...] agent: in full
-----------------------------------

License

Apache License 2.0, Copyright (c) 2026 Jitin Kumar Sengar

Metadata

Release files for autourgos-summary-memory 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autourgos-summary-memory 2.0.4
File Size Uploaded
autourgos_summary_memory-2.0.4.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autourgos-summary-memory 2.0.4
File Interpreter ABI Platform
autourgos_summary_memory-2.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 29.9 kB

Release files / autourgos_summary_memory-2.0.4.tar.gz

Download URL autourgos_summary_memory-2.0.4.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
acec7d09ae97f7347bb6f0ad75cd7083b230796b5f39648df96c890a6007797b
BLAKE2b-256 checksum
How to use checksums
35e6358cfbbd26a5783d7597040a501003546adb515c28bde9c5c7e666c39fd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / autourgos_summary_memory-2.0.4-py3-none-any.whl

Download URL autourgos_summary_memory-2.0.4-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4a436b3d7de670de35d7cd443d4d7332d0f4bd51ebe74ff37cba4f7ff3756e6f
BLAKE2b-256 checksum
How to use checksums
da788e15d32d36f0b621abd81b4defc24679b1043ef99d5e5223aeab13b197e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page