This project has been archived by its maintainers, and is no longer receiving any updates.
autourgos-episodic-memory
Structured task/outcome log for Autourgos agents. Unlike the
freeform conversational recall the rest of the memory family provides, EpisodicMemory
records what was tried and what happened — so a future run can check "have I attempted
this before, and did it work?" before repeating a known-bad approach.
from autourgos_episodic_memory import EpisodicMemory
memory = EpisodicMemory(db_path="episodes.db") # persists across restarts
memory.remember(
task="Deploy the app to production",
outcome="fail",
actions_taken=["ran deploy.sh", "hit permission error on S3 bucket"],
notes="Needs IAM role update before retrying.",
)
for episode in memory.retrieve("deploying the app", top_k=3):
print(episode.metadata["outcome"], "-", episode.content)
Table of Contents
Install
pip install autourgos-episodic-memory
Depends on autourgos-memory and autourgos-semantic-memory (its TF-IDF KeywordRetriever
does the relevance scoring — this package doesn't reimplement it). SQLite persistence is
stdlib, no extra dependency.
Why a separate package
The rest of the memory family stores conversation (what was said). EpisodicMemory stores
attempts (what was done and whether it worked) — a different shape of data with its own
outcome field ("success" / "fail" / "partial") and actions_taken list, not a chat
turn. Keeping it separate from autourgos-vector-memory/autourgos-semantic-memory avoids
conflating "recall a relevant past conversation" with "recall a relevant past task result."
Quick Start
from autourgos_episodic_memory import EpisodicMemory
memory = EpisodicMemory(db_path="agent_episodes.db", max_episodes=500)
memory.remember(
task="Fix the failing test suite",
outcome="success",
actions_taken=["reran pytest -x", "found stale fixture", "regenerated fixture"],
)
memory.remember(
task="Fix the failing test suite",
outcome="fail",
actions_taken=["tried deleting __pycache__"],
notes="Did not address the root cause.",
)
# Before trying again, check what happened last time:
past = memory.retrieve("failing test suite", top_k=5)
for ep in past:
print(f"[{ep.metadata['outcome']}] {ep.metadata['task']}")
db_path=":memory:" (the default) keeps everything in RAM for the process lifetime. Pass a
real file path for recall across restarts — episodes are reloaded and re-indexed on the next
EpisodicMemory(db_path=...) construction.
EpisodicMemory supports the context-manager protocol, closing its connection automatically:
with EpisodicMemory(db_path="agent_episodes.db") as memory:
memory.remember(task="Deploy the app", outcome="success")
# connection is closed here automatically
Constructor Reference
EpisodicMemory
| Parameter | Type | Default | Description |
|---|---|---|---|
db_path |
str |
":memory:" |
SQLite file path, or :memory: for no persistence |
max_episodes |
int, optional |
None |
Oldest episodes dropped once this count is exceeded |
EpisodicMemory.remember(task, outcome, actions_taken=None, notes="")
| Parameter | Type | Required | Description |
|---|---|---|---|
task |
str |
yes | What was attempted. Non-empty. |
outcome |
str |
yes | One of "success", "fail", "partial" |
actions_taken |
list[str] |
no | Steps taken during the attempt |
notes |
str |
no | Freeform extra context (why it failed, what to try next, etc.) |
Returns an Episode (frozen dataclass with task/outcome/actions_taken/notes/timestamp).
EpisodicMemory.retrieve(query, top_k=5)
Returns a list of autourgos_memory.Document, ranked by TF-IDF relevance to query. Each
Document.metadata carries task, outcome, actions_taken, notes, timestamp.
License
Apache License 2.0 — see LICENSE.
Metadata
Release files for autourgos-episodic-memory 0.2.1
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_episodic_memory-0.2.1.tar.gz | 18.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autourgos_episodic_memory-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.5 kB
Release files / autourgos_episodic_memory-0.2.1.tar.gz
| Download URL | autourgos_episodic_memory-0.2.1.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e957e5dc84d46750c1278199f0c259eec50d04f1415dc321ad1e6a9c1640ab49
|
|
BLAKE2b-256 checksum How to use checksums |
50f1f2ca42b8ff3c93592a356d174a6776c689b9780516e8349a8171ebf1ffba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / autourgos_episodic_memory-0.2.1-py3-none-any.whl
| Download URL | autourgos_episodic_memory-0.2.1-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e95d4d5322ef341f2bbe96a15f03665923cfbea7a8e586f87727201f9067cf26
|
|
BLAKE2b-256 checksum How to use checksums |
5612bf030a79f8833994c2b45dcb99d9cf70ab5bf9728b0651efd30d59e1c15b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|