Learning to Be A Doctor: Searching for Effective Medical Agent Architectures