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§
- Card
Mapping - Card fingerprint to user mapping
- Dynamo
Config - DynamoDB table configuration
- Dynamo
State Store - DynamoDB-backed state store
- Pending
Capture - Pending capture data
- Pending
Location - Session
KeyData - Session key data for storage
Functions§
- create_
table - Create the DynamoDB table with GSI Run this once during infrastructure setup