Memory
SQLite-backed memory: action_log and memory_summary.
All reads and writes use the stdlib sqlite3 module directly — no ORM,
no mocks. Tests must use a real temp-file or in-memory database.
Classes:
-
MemoryStore–Persistent action memory backed by an SQLite database.
MemoryStore
¶
Persistent action memory backed by an SQLite database.
Creates the database file and schema on first use. The connection is kept
open for the lifetime of the instance; call close (or use as a
context manager) when done.
Parameters:
-
db_path(Path) –Filesystem path to the SQLite database file. Intermediate directories are created automatically.
Methods:
-
__enter__–Return self for use as a context manager.
-
__exit__–Close the connection on context exit.
-
close–Close the database connection.
-
get_last_polled–Return the last-polled timestamp for
repo, orNoneif never polled. -
get_memory_summary–Return the stored summary for a (repo, issue_id) pair, or
None. -
log_action–Append a decision record to
action_log. -
set_last_polled–Persist the last-polled timestamp for repo.
-
upsert_memory_summary–Insert or replace the memory summary for a (repo, issue_id) pair.
get_last_polled
¶
Return the last-polled timestamp for repo, or None if never polled.
Parameters:
-
repo(str) –Repository in
owner/repoformat.
Returns:
-
datetime | None–The stored
datetime.datetime(timezone-aware UTC), orNoneif no poll has been recorded for this repo.
get_memory_summary
¶
Return the stored summary for a (repo, issue_id) pair, or None.
Parameters:
-
repo(str) –Repository in
owner/repoformat. -
issue_id(int) –GitHub issue number.
Returns:
-
str | None–The LLM-generated summary string, or
Noneif absent.
log_action
¶
log_action(repo: str, issue_id: int, task_type: str, decision: DecisionType, rationale: str | None, actions: list[ActionItem]) -> None
Append a decision record to action_log.
Parameters:
-
repo(str) –Repository in
owner/repoformat. -
issue_id(int) –GitHub issue number.
-
task_type(str) –Task type string (e.g.
issue.triage). -
decision(DecisionType) –The agent's decision.
-
rationale(str | None) –Human-readable explanation, or
None. -
actions(list[ActionItem]) –Ordered list of actions the harness will execute.
set_last_polled
¶
Persist the last-polled timestamp for repo.
Parameters:
-
repo(str) –Repository in
owner/repoformat. -
timestamp(datetime) –The datetime at which the poll completed.
upsert_memory_summary
¶
Insert or replace the memory summary for a (repo, issue_id) pair.
Parameters:
-
repo(str) –Repository in
owner/repoformat. -
issue_id(int) –GitHub issue number.
-
summary(str) –LLM-generated summary of prior actions on this issue.