langgoap.StoreExecutionHistory

langgoap.StoreExecutionHistory#

class StoreExecutionHistory(store, *, index_limit=100)[source]#

Execution history backed by a LangGraph BaseStore.

Parameters:
  • store (BaseStore) – Any BaseStore implementation. get/put are the only methods invoked (plus aget/aput on the async path). search() is never called — see module docstring for the rationale.

  • index_limit (int) – Maximum number of execution IDs kept in a single reverse-index entry. Defaults to 100 which is enough for most diagnostic use cases without incurring large per-write overhead.

Example:

store = InMemoryStore()
history = StoreExecutionHistory(store)
history.record(ExecutionRecord(...))
recent = history.query_by_goal("goal_abc", limit=5)
__init__(store, *, index_limit=100)[source]#
Parameters:
  • store (BaseStore)

  • index_limit (int)

Return type:

None

Methods

__init__(store, *[, index_limit])

aquery_by_goal(goal_hash[, limit])

Async variant of query_by_goal().

aquery_failures(action_name[, limit])

Async variant of query_failures().

arecord(record)

Async variant of record().

goal_hash_for(goal)

Return the goal-index key this history would file goal under.

query_by_goal(goal_hash[, limit])

Return up to limit most-recent records for goal_hash.

query_failures(action_name[, limit])

Return up to limit most-recent failed runs that touched action_name.

record(record)

Persist record and update the reverse indexes.