autourgos-memory
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_memorydirectly if their own package is installed —RuntimeShortTermMemory,ConversationBufferMemory,LocalShortTermMemory,SQLiteMemory,KeywordRetriever,KeywordMemory,SummaryBufferedMemory,TokenBufferedMemory,VectorMemory,VectorRetriever,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: ...
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.7
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_memory-1.0.7.tar.gz | 15.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autourgos_memory-1.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.6 kB
Release files / autourgos_memory-1.0.7.tar.gz
| Download URL | autourgos_memory-1.0.7.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
824f013f80c55a602c1a87f333a01935cb71583bef4318e559d122098e632e56
|
|
BLAKE2b-256 checksum How to use checksums |
20a3489a3b60f3f4cb269d02b091457810a85979663a870399c4dad5a109fc4f
|
| 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.7-py3-none-any.whl
| Download URL | autourgos_memory-1.0.7-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee228c59562d06a398087982e6824355231cfada4a493847d1d4fcadaf88114e
|
|
BLAKE2b-256 checksum How to use checksums |
183c734a9f3e80c53a80e7ca529d645071cc35308d6db61816c6841600ce4c6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|