Skip to main content

Module dynamo

Module dynamo 

Source
Expand description

Loop Agent SDK - DynamoDB State Store Implementation

High-speed state persistence for Lambda agents. Target: <100ms context reload, <5ms fingerprint lookup.

§Table Schema

Table: loop-agent-state
 
Primary Key:
  PK (Partition Key): String
  SK (Sort Key): String
 
GSI1 (CardFingerprintIndex):
  PK: fingerprint
  Projects: user_pubkey, card_last4, linked_at
 
Item Types:
  USER#{pubkey} | CONTEXT      → User context (preferences, cache)
  USER#{pubkey} | SESSION      → Active session key
  USER#{pubkey} | PENDING#{ts} → Pending capture (ring buffer)
  CARD#{fp}     | META         → Card fingerprint mapping
  TXN#{id}      | PROCESSED    → Processed transaction (dedup)

Structs§

CardMapping
Card fingerprint to user mapping
DynamoConfig
DynamoDB table configuration
DynamoStateStore
DynamoDB-backed state store
PendingCapture
Pending capture data
PendingLocation
SessionKeyData
Session key data for storage

Functions§

create_table
Create the DynamoDB table with GSI Run this once during infrastructure setup