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.2

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.2
File Size Uploaded
autourgos_summary_memory-2.0.2.tar.gz 15.5 kB Details

Built distribution (wheel)

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

Total release size: 29.1 kB

Release files / autourgos_summary_memory-2.0.2.tar.gz

Download URL autourgos_summary_memory-2.0.2.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a676378ae3fdf26673cf2d5a0e725409bed098c824c853523ff42252a927df35
BLAKE2b-256 checksum
How to use checksums
c3d5e483530c131c1b6e60413949c108aee497ff1e16ed0ca28db928b97b3162
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.2-py3-none-any.whl

Download URL autourgos_summary_memory-2.0.2-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86f14d06ee1283a5047ad707b5dc366cbe41e36291e1e5f29afac9468de8813a
BLAKE2b-256 checksum
How to use checksums
e6ecddc7b261193f1c66fd142734989b89e85c94b2b1241864dd1f498f4c5233
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