fn format_section(title: &str, memories: &[Memory]) -> String
Formats a section with a title and memories.