Skip to main content

LLM-compressed rolling summary memory for Autourgos agents — SummaryBufferedMemory.

Project description

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.


Install

pip install autourgos-summary-memory

Quick Start

from autourgos_summary_memory import SummaryBufferedMemory
from autourgos_openaichat import OpenAIChatModel
from autourgos_react_agent import ReactAgent

# Use a cheap model for summarization
summarizer_llm = OpenAIChatModel(model="gpt-4o-mini")

memory = SummaryBufferedMemory(
    llm=summarizer_llm,
    max_messages=10,   # keep last 10 messages in full; compress the rest
)
agent = ReactAgent(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
-----------------------------------

Pair with autourgos-summarizer

For scratchpad compression (not memory), see autourgos-summarizer — it compresses the agent's reasoning chain, not the conversation history.


Links


License

MIT — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autourgos_summary_memory-1.0.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autourgos_summary_memory-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file autourgos_summary_memory-1.0.0.tar.gz.

File metadata

  • Download URL: autourgos_summary_memory-1.0.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for autourgos_summary_memory-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c3e3e58c07acd963674c49bb91bb11ca2b3fbccf26f8ddf97da5c999b71891d2
MD5 00c3efe17dc75fbbc0c62e355784fa9a
BLAKE2b-256 6541e47000f6c60a93e1f334eb11c0505c07130490dcc322d783d94dea70ef75

See more details on using hashes here.

File details

Details for the file autourgos_summary_memory-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autourgos_summary_memory-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b3f2749e17fdd5fa89917c8bac67028bf555e0facfcf8d69441d664299db841
MD5 e7803baac2eb67fa2e4cf0a46f84e4eb
BLAKE2b-256 24122537e7bdf57be66c408563c5c4d2d34a0481f39f094f459accbad0881716

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page