Skip to main content

autourgos-memory

Framework: Autourgos Python License: Apache 2.0 Author Contributor Contributor

Base memory interfaces for Autourgos agents — the foundation package. It defines the abstract interfaces (BaseMemory, BaseRetriever, MemoryMessage, Document) that every concrete memory implementation uses.

from autourgos_memory import RuntimeShortTermMemory  # requires autourgos-buffer-memory installed
from autourgos_agent import Agent
from autourgos_openaichat import OpenAIChatModel

my_llm = OpenAIChatModel(model="gpt-4o-mini")
memory = RuntimeShortTermMemory(max_messages=20)
agent  = Agent(llm=my_llm, memory=memory)

Features

  • Abstract interfaces: BaseMemory (short-term conversational), BaseRetriever (relevance-scored recall), MemoryMessage, Document
  • Soft re-exports: concrete backends resolve from autourgos_memory directly if their own package is installed — RuntimeShortTermMemory, ConversationBufferMemory, LocalShortTermMemory, SQLiteMemory, KeywordRetriever, KeywordMemory, SimpleSemanticRetriever, HierarchicalSemanticMemory, SummaryBufferedMemory, TokenBufferedMemory, VectorMemory, VectorRetriever, Episode, EpisodicMemory
  • Zero required dependencies — install only the concrete backends you actually need

Table of Contents


Install

# Base interfaces only
pip install autourgos-memory

# Or install concrete implementations individually
pip install autourgos-buffer-memory      # in-memory ring buffer
pip install autourgos-local-memory       # JSON file + SQLite
pip install autourgos-semantic-memory    # TF-IDF keyword retrieval
pip install autourgos-summary-memory     # LLM-compressed rolling summary
pip install autourgos-token-memory       # token-bounded buffer
pip install autourgos-vector-memory      # local, provider-agnostic embedding recall
pip install autourgos-episodic-memory    # structured task/outcome log

Memory Types at a Glance

Package Class Best for
autourgos-buffer-memory RuntimeShortTermMemory Fast in-memory buffer, message-count bounded
autourgos-buffer-memory ConversationBufferMemory Unbounded in-memory buffer
autourgos-local-memory LocalShortTermMemory Disk persistence via JSON file
autourgos-local-memory SQLiteMemory Disk persistence via SQLite, concurrent-safe
autourgos-semantic-memory KeywordMemory TF-IDF retrieval of relevant past context
autourgos-summary-memory SummaryBufferedMemory LLM-compressed history to save tokens
autourgos-token-memory TokenBufferedMemory Token-budget bounded buffer
autourgos-vector-memory VectorMemory Embedding-based recall (you supply the embedding function)
autourgos-episodic-memory EpisodicMemory Structured task/outcome log — what was tried, what happened

Quick Start

RuntimeShortTermMemory is soft re-exported from autourgos_memory — it only resolves if autourgos-buffer-memory is also installed:

pip install autourgos-memory autourgos-buffer-memory autourgos-openaichat
from autourgos_memory import RuntimeShortTermMemory
from autourgos_agent import Agent
from autourgos_openaichat import OpenAIChatModel

my_llm = OpenAIChatModel(model="gpt-4o-mini")  # needs OPENAI_API_KEY set
memory = RuntimeShortTermMemory(max_messages=20)
agent  = Agent(llm=my_llm, memory=memory)
result = agent.invoke("What did I ask you last time?")

Base Interfaces

MemoryMessage

from autourgos_memory import MemoryMessage
from datetime import datetime, timezone

msg = MemoryMessage(role="user", content="Hello", timestamp=datetime.now(timezone.utc))
print(msg.to_dict())
# {"role": "user", "content": "Hello", "timestamp": "2024-..."}

Allowed roles: user, agent, system, tool.

BaseMemory

Implement this to create your own memory backend:

from autourgos_memory import BaseMemory, MemoryMessage

class MyCustomMemory(BaseMemory):
    def add_user_message(self, content: str) -> MemoryMessage: ...
    def add_agent_message(self, content: str) -> MemoryMessage: ...
    def add_tool_message(self, tool_name: str, result: str) -> MemoryMessage: ...
    def format_for_llm(self, query: str = None) -> str: ...
    def clear(self) -> None: ...

Only add_user_message, add_tool_message, and clear are true @abstractmethods. add_agent_message and format_for_llm are concrete methods with a deprecation-shim fallback: each one calls through to an older method name (add_ai_message / get_context respectively) if your subclass implements that one instead, emitting a DeprecationWarning. This exists only to keep a memory backend written against the pre-rename API working unchanged — new backends should implement add_agent_message/format_for_llm directly and can ignore add_ai_message/get_context entirely.

BaseRetriever

Implement this to plug in your own vector database:

from autourgos_memory import BaseRetriever, Document

class MyVectorDB(BaseRetriever):
    def retrieve(self, query: str, top_k: int = 5) -> list[Document]: ...

Document

from autourgos_memory import Document

doc = Document(content="Paris is the capital of France.", score=0.92, source="wiki")

License

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

Metadata

Release files for autourgos-memory 1.0.8

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-memory 1.0.8
File Size Uploaded
autourgos_memory-1.0.8.tar.gz 16.8 kB Details

Built distribution (wheel)

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

Total release size: 30.7 kB

Release files / autourgos_memory-1.0.8.tar.gz

Download URL autourgos_memory-1.0.8.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
076b658c1f3025085ff75323acc84ccc7f4be1e19d88cfa895333bdf3d8ec7c9
BLAKE2b-256 checksum
How to use checksums
f15129bde80c3c5b58914ea45cdecd860f5b03ff2afcfe9b70eed607e23b98cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / autourgos_memory-1.0.8-py3-none-any.whl

Download URL autourgos_memory-1.0.8-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e18e8e2792a86f17b51b223c8de5e8ab4c94c32a0d43ee6b24e18d55ee5e088
BLAKE2b-256 checksum
How to use checksums
f52ec95f386f8fe76c8a3aadee57f1a4476efa6b0fd374309a68238376d6a1d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

2.1.0

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.0.9

2 release files

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.2

2 release files

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