Archived
This project has been archived by its maintainers, and is no longer receiving any updates.
autourgos-summary-memory
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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autourgos_summary_memory-2.0.3.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autourgos_summary_memory-2.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.8 kB
Release files / autourgos_summary_memory-2.0.3.tar.gz
| Download URL | autourgos_summary_memory-2.0.3.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47b76e473cf4724a2b6c204fb6526dbf2ef302035e76ac75e7aa936c2551fa21
|
|
BLAKE2b-256 checksum How to use checksums |
96a38e1e14e4a4d402a8662c7e354afd465c74626c61a99dd6c12d438561a72a
|
| 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.3-py3-none-any.whl
| Download URL | autourgos_summary_memory-2.0.3-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea6a3966a11152fe90965e73769322b747d74fae0ddf02771c05868b7710a41a
|
|
BLAKE2b-256 checksum How to use checksums |
e1bd60f755ce5541b1e1bbb109e9db39880b21b8bd2e03cdf4dbd7cf146ffd5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|