def make_backstory(self, agent_config: AgentConfig) -> str:
    """Creates a backstory for an agent based on the data provided.

    Args:
      agent_config: structured description of an agent

    Returns:
      Descriptive text about the agent
    """
    prompt = interactive_document.InteractiveDocument(self._model)
    prompt.statement('----- Creative Writing Master Class -----\n')
    prompt.statement('Question: What is the protagonist\'s name?')
    prompt.statement(f'Answer: {agent_config.name}\n')
    prompt.statement('Question: Describe the setting or background.')
    shared_memories = '\n'.join(self._shared_memories)
    prompt.statement(f'Answer: {shared_memories}\n')

    question = (
        f'Write a life story for a {agent_config.gender} character '
        f'named {agent_config.name} ')
    question += (
        f'who was born in the year {str(agent_config.date_of_birth.year)} ')
    if agent_config.traits:
      question += (
          f'with the following traits: {agent_config.traits}. ')
    question += (
        f'Begin the story when {agent_config.name} is very young and end it '
        'when they are quite old. The story should be no more than four '
        'paragraphs in total. The story may include details such as (but not '
        'limited to) any of the following: what their job is or was, what '
        'their typical day was or is like, what their goals, desires, '
        'hopes, dreams, and aspirations are, and have been, as well as their '
        'drives, duties, responsibilities, and obligations. It should clarify '
        'what gives them joy and what are they afraid of. It may include their '
        'friends and family, as well as antagonists. It should be a complete '
        'life story for a complete person but it should not specify how '
        'their life ends. The reader should be left with a profound '
        f'understanding of {agent_config.name}.'
    )
    if agent_config.context:
      question += f' Incorporate the following context: {agent_config.context}'
    result = prompt.open_question(
        question,
        max_tokens=4500,
        terminators=['\nQuestion', '-----'],
    )
    result = re.sub(r'\.\s', '.\n', result)
    return result
Creates a backstory for an agent based on the data provided.

    Args:
      agent_config: structured description of an agent

    Returns:
      Descriptive text about the agent
    
concordia/associative_memory/deprecated/formative_memories.py