Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

autourgos-episodic-memory

Framework: Autourgos Python License: Apache 2.0 Author

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.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-episodic-memory 0.2.0
File Size Uploaded
autourgos_episodic_memory-0.2.0.tar.gz 17.9 kB Details

Built distribution (wheel)

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

Total release size: 33.2 kB

Release files / autourgos_episodic_memory-0.2.0.tar.gz

Download URL autourgos_episodic_memory-0.2.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4b303a4ae9fd0cc67dbdd7ebeb643ac3df50f7a9133947a1839aba7f298cf22f
BLAKE2b-256 checksum
How to use checksums
46305cfa49256ead4dade2ef42d3e6685fb6647d81cbd35c1dc2828caa85aaec
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.0-py3-none-any.whl

Download URL autourgos_episodic_memory-0.2.0-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3982a314c10494540d471b0b1d6f1ed5be685625f2470af357a159eeade7468f
BLAKE2b-256 checksum
How to use checksums
08f178887b97678b29227f7e5554e434f5699772b322b7cba6ad0367a3f34664
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