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

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.1.0
File Size Uploaded
autourgos_summary_memory-2.1.0.tar.gz 16.0 kB Details

Built distribution (wheel)

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

Total release size: 29.8 kB

Release files / autourgos_summary_memory-2.1.0.tar.gz

Download URL autourgos_summary_memory-2.1.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
001562ab12dcbbcf0b117bbbe3992e5fe56555d1d4b2de8423a304131df006c6
BLAKE2b-256 checksum
How to use checksums
c82dabc6fb9ece3af1aff8433977cc547812a5d839d2672208f342ba260d224a
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.1.0-py3-none-any.whl

Download URL autourgos_summary_memory-2.1.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a81bbad8279c0e30eabc80847b364b31ebbfb993d05ce272bf67066b0cb9f2e6
BLAKE2b-256 checksum
How to use checksums
0f360b1645a59fdd99e3ee1158d03e1fd247458b92e3c1f287f2379088418efe
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