write(agent_id, memory, context, memory_type?, metadata?, treasury?)Store a memory on Shelby. Content is SHA-256 hashed, optionally encrypted, and embedding stored if provider configured. Treasury fields (amount, currency, counterparty, tx_status) can be passed for financial records.Parametersrecall(agent_id, context?, limit?, memory_type?)Retrieve memories. Each is decrypted and verified against its stored content hash.Parameterssearch(query, agent_id?, limit?, threshold?)Semantic search by meaning using vector similarity. Requires embeddingProvider.Parametersverify(id)Re-download from Shelby, decrypt, and verify content hash.Parametersdelete(id)Remove a memory from Supabase and attempt Shelby blob deletion.ParametersrecordTransaction(params)Convenience wrapper for write(). Sets memory_type='transaction_record', defaults tx_status to 'pending'. Treasury records get 365-day Shelby expiry.ParametersrecordBalanceSnapshot(params)Convenience wrapper for write(). Sets memory_type='balance_snapshot'. Records a point-in-time balance.ParametersgetLatestBalance(agentId)Returns the most recent balance_snapshot for an agent, or null if none exist.ParameterscreatePool({ name, ownerAgentId, description?, metadata? })Create a shared memory pool. The owner is automatically added as a member with role 'owner'.ParametersaddPoolMember(poolId, callerAgentId, targetAgentId, role)Add or update a member's role. Caller must be the pool owner.ParametersremovePoolMember(poolId, callerAgentId, targetAgentId)Remove a member. Caller must be the pool owner. The owner cannot be removed.ParameterslistPoolMembers(poolId, callerAgentId)List all members of a pool. Caller must be a pool member.ParameterslistPools(agentId)List all pools the agent is a member of.ParameterswriteToPool({ poolId, agentId, memory, context, memory_type?, metadata?, treasury? })Write a memory into a shared pool. Caller must have role 'owner' or 'writer'. Throws PermissionError otherwise.ParametersrecallFromPool({ poolId, agentId, context?, limit?, memory_type? })Read memories written into a shared pool by any member. Caller must be a pool member (any role). Each memory is verified against its content hash. Records a 'read' entry in the pool audit log.ParametersrecallShared(agent_id, context?, limit?, memory_type?)Read memories that were explicitly shared with this agent via the per-memory shared_with ACL — independent of pool membership.ParameterssearchPool({ poolId, agentId, query, limit?, threshold? })Semantic search inside a shared pool using pgvector. Caller must be a pool member. Requires an embeddingProvider in config.ParametersgetPoolAuditLog(poolId, callerAgentId, limit?)Read the access log for a pool. Owner only. One row per writeToPool / recallFromPool / searchPool call.Parameterstransaction_record · balance_snapshot · spending_policypending · confirmed · failedowner, writer, or reader roles, then any member can read everything written into the pool while role permissions are enforced at the SDK boundary. Use them to coordinate workflows like trading → execution → risk → reporting through a single source of truth.1. Create a pool and invite collaborators2. Write into the pool (owner or writer)3. Read from the pool (any member)4. Permission errorsowner (manage members + read/write) · writer (read/write) · reader (read only)supabase/migration-v5.sql to add memory_pools, pool_members, and the nullable pool_id column on memories. Existing private memories are unaffected.sharedWith on write() to grant individual agents read access via recallShared(). Pools and ACLs compose: a memory can live in a pool and be additionally shared with agents outside it.memories.shared_with TEXT[] with a GIN index. Empty list = private to the writer.writeToPool, recallFromPool, and searchPool call writes a row to pool_access_log. Reads record the result count; writes record the new memory's id. Pool owners can replay the log to see who read what and when.PermissionError.agent_id is a trusted string. For production hardening — proving an agent owns its identity — sign claims with the agent's Aptos Ed25519 private key and verify them at the trust boundary. The primitives are exported; wiring them into RLS or every method call is opt-in (this stays compatible with the trust model already in use).shelmem:agent-claim:v1\n{agent_id}\n{timestamp}.maxAgeSeconds (default 300s).Format: [IV 12B] [AuthTag 16B] [Ciphertext]Key: HMAC-SHA256(privkey, "ShelMem-v1")Algo: AES-256-GCM, random 96-bit IV per write