async def insert_memories(memories: list[EmbeddedMemory]): """ Given a list of memories, insert them to the database """ await client.upsert( collection_name=COLLECTION_NAME, points=[ models.PointStruct( id=uuid4().hex, payload={ "user_id": memory.user_id, "memory_text": memory.memory_text, "date": memory.date }, vector=memory.embedding ) for memory in memories ] ) async def delete_records(point_ids): """ Delete a list of point ids from the database """ await client.delete( collection_name=COLLECTION_NAME, points_selector=models.PointIdsList( points=point_ids ) )