Update agent.py

Added docstrings for record_log_activity and its helper function.