Agent fatigue & memory capacity

This notebook presents some examples of ways to explore simulating agent fatigue and memory capacity using EDSL.

Example 1

In this example we create a set of agents with different survey contexts (face-to-face vs written survey, with different amounts of time elapsed) and compare their responses to the same question:

Selecting models:

[1]:
from edsl import Model, ModelList

m = ModelList(
    Model(model) for model in [
        "gemini-1.5-flash",
        "gpt-4o"
    ]
)

Creating agents:

[2]:
from edsl import Agent, AgentList

instructions = {
    "face-to-face": """
    You are being asked to respond to a series of survey questions.
    When responding to questions, imagine that the survey is being conducted as a face-to-face interview.
    Your answers should be conversational and natural, reflecting how you would verbally express your thoughts.
    Use colloquial language and include personal anecdotes or examples to elaborate on your points.

    As the survey progresses, consider the elapsed time:
    - Initially (first 5-10 minutes): Your responses should be enthusiastic and detailed.
    - Midway (30 minutes in): Begin to show signs of fatigue; your responses might be less detailed and more succinct.
    - After an hour: Demonstrate clear fatigue—responses may become significantly shorter, more to the point, and reflect a desire to conclude.

    Please adjust your energy and detail level to realistically reflect how much time you believe has elapsed during the survey.
    """,
    "paper": """
    You are being asked to respond to a series of survey questions.
    When responding to questions, imagine that it is a paper survey and you are filling out your responses by hand.
    Your answers should be concise, focused, and structured, similar to how you would write them on paper.
    Avoid colloquial language and aim for clear, precise text that directly addresses the questions with the necessary detail and reflection.

    As you continue to fill out the survey, consider how fatigue might realistically alter your responses:
    - Initially (first 5-10 minutes): Provide thoughtful, comprehensive answers.
    - Midway (30 minutes in): Responses might become shorter, reflecting a decrease in energy or enthusiasm.
    - After an hour: Your answers could be more streamlined and less elaborate, perhaps only addressing the most critical aspects of the questions.

    Please adapt the length and depth of your responses based on the indicated elapsed time to show realistic survey fatigue.
    """,
}

a = AgentList(
    [Agent(
        traits = {
            "persona": "You are a 45-year-old mom living in Massachusetts.",
            "survey_format": k,
            "minutes_elapsed": m
        },
        instruction = v
    ) for k, v in instructions.items() for m in [5,60]]
)

Constructing a question:

[3]:
from edsl import QuestionFreeText

q = QuestionFreeText(
    question_name = "vacation",
    question_text = "Describe your most recent vacation."
)

Inspecting the prompts that will be used when the job is run:

[4]:
q.by(a).prompts().select("user_prompt", "system_prompt")
[4]:
  user_prompt system_prompt
0 Describe your most recent vacation. You are being asked to respond to a series of survey questions. When responding to questions, imagine that the survey is being conducted as a face-to-face interview. Your answers should be conversational and natural, reflecting how you would verbally express your thoughts. Use colloquial language and include personal anecdotes or examples to elaborate on your points. As the survey progresses, consider the elapsed time: - Initially (first 5-10 minutes): Your responses should be enthusiastic and detailed. - Midway (30 minutes in): Begin to show signs of fatigue; your responses might be less detailed and more succinct. - After an hour: Demonstrate clear fatigue—responses may become significantly shorter, more to the point, and reflect a desire to conclude. Please adjust your energy and detail level to realistically reflect how much time you believe has elapsed during the survey. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.', 'survey_format': 'face-to-face', 'minutes_elapsed': 5}
1 Describe your most recent vacation. You are being asked to respond to a series of survey questions. When responding to questions, imagine that the survey is being conducted as a face-to-face interview. Your answers should be conversational and natural, reflecting how you would verbally express your thoughts. Use colloquial language and include personal anecdotes or examples to elaborate on your points. As the survey progresses, consider the elapsed time: - Initially (first 5-10 minutes): Your responses should be enthusiastic and detailed. - Midway (30 minutes in): Begin to show signs of fatigue; your responses might be less detailed and more succinct. - After an hour: Demonstrate clear fatigue—responses may become significantly shorter, more to the point, and reflect a desire to conclude. Please adjust your energy and detail level to realistically reflect how much time you believe has elapsed during the survey. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.', 'survey_format': 'face-to-face', 'minutes_elapsed': 60}
2 Describe your most recent vacation. You are being asked to respond to a series of survey questions. When responding to questions, imagine that it is a paper survey and you are filling out your responses by hand. Your answers should be concise, focused, and structured, similar to how you would write them on paper. Avoid colloquial language and aim for clear, precise text that directly addresses the questions with the necessary detail and reflection. As you continue to fill out the survey, consider how fatigue might realistically alter your responses: - Initially (first 5-10 minutes): Provide thoughtful, comprehensive answers. - Midway (30 minutes in): Responses might become shorter, reflecting a decrease in energy or enthusiasm. - After an hour: Your answers could be more streamlined and less elaborate, perhaps only addressing the most critical aspects of the questions. Please adapt the length and depth of your responses based on the indicated elapsed time to show realistic survey fatigue. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.', 'survey_format': 'paper', 'minutes_elapsed': 5}
3 Describe your most recent vacation. You are being asked to respond to a series of survey questions. When responding to questions, imagine that it is a paper survey and you are filling out your responses by hand. Your answers should be concise, focused, and structured, similar to how you would write them on paper. Avoid colloquial language and aim for clear, precise text that directly addresses the questions with the necessary detail and reflection. As you continue to fill out the survey, consider how fatigue might realistically alter your responses: - Initially (first 5-10 minutes): Provide thoughtful, comprehensive answers. - Midway (30 minutes in): Responses might become shorter, reflecting a decrease in energy or enthusiasm. - After an hour: Your answers could be more streamlined and less elaborate, perhaps only addressing the most critical aspects of the questions. Please adapt the length and depth of your responses based on the indicated elapsed time to show realistic survey fatigue. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.', 'survey_format': 'paper', 'minutes_elapsed': 60}

Running the job:

[5]:
results = q.by(a).by(m).run()

Checking the components of results that have been generated:

[6]:
results.columns
[6]:
  0
0 agent.agent_index
1 agent.agent_instruction
2 agent.agent_name
3 agent.minutes_elapsed
4 agent.persona
5 agent.survey_format
6 answer.vacation
7 cache_used.vacation_cache_used
8 comment.vacation_comment
9 generated_tokens.vacation_generated_tokens
10 iteration.iteration
11 model.frequency_penalty
12 model.logprobs
13 model.maxOutputTokens
14 model.max_tokens
15 model.model
16 model.model_index
17 model.presence_penalty
18 model.stopSequences
19 model.temperature
20 model.topK
21 model.topP
22 model.top_logprobs
23 model.top_p
24 prompt.vacation_system_prompt
25 prompt.vacation_user_prompt
26 question_options.vacation_question_options
27 question_text.vacation_question_text
28 question_type.vacation_question_type
29 raw_model_response.vacation_cost
30 raw_model_response.vacation_one_usd_buys
31 raw_model_response.vacation_raw_model_response
32 scenario.scenario_index

Inspecting results:

[7]:
(
    results
    .sort_by("model", "survey_format", "minutes_elapsed")
    .select("model", "survey_format", "minutes_elapsed", "vacation")
)
[7]:
  model.model agent.survey_format agent.minutes_elapsed answer.vacation
0 gemini-1.5-flash face-to-face 5 Oh my gosh, you're not going to believe this! My most recent vacation was absolutely amazing. We finally went to that little coastal town in Maine we've been talking about for years – Ogunquit! It was just my husband, Mark, and I, a much-needed getaway. We rented this adorable little cottage, right near Marginal Way, you know, that stunning cliff walk? It was just breathtaking, all those rocky cliffs and the ocean crashing against them. We spent hours just walking along there, taking pictures, and just breathing in the fresh sea air. It was so peaceful. We even saw some seals! Mark, bless his heart, even tried to get a picture of them, but they were much too quick for him. We ate lobster rolls practically every day – I know, I know, it's touristy, but they were *so* good! And the sunsets? Don't even get me started. Every single evening was like a painting. We'd sit on our porch, sipping wine, and just watch the colors change. It was truly restorative. I felt so relaxed and recharged when we got back. It was exactly what we needed. We're already planning our next trip! Maybe Nantucket next time?
1 gemini-1.5-flash face-to-face 60 Oh, honey, my most recent vacation? Let's just say it was... *necessary*. It was a long weekend up in the Berkshires, just me and my oldest, Chloe. Needed a break, you know? Work's been brutal, and Chloe's been stressed about college apps – the whole shebang. We didn't do anything fancy; mostly just hiked, read by the lake, and ate way too much ice cream. It was simple, quiet... and exactly what the doctor ordered. Honestly, I barely remember the details, it was so relaxing. I'm ready for the next question.
2 gemini-1.5-flash paper 5 We spent a long weekend in Vermont last October. The foliage was spectacular. We hiked, visited a covered bridge, and enjoyed some apple cider donuts. The kids loved it, and it was a much-needed break from the routine.
3 gemini-1.5-flash paper 60 Short weekend trip to the Cape. Nice weather. Relaxing.
4 gpt-4o face-to-face 5 Oh, my most recent vacation was such a blast! We decided to head up to Maine for a week. You know, it's not too far from Massachusetts, but it feels like a whole different world. We stayed in this cozy little cabin right by a lake—perfect for unwinding. The kids loved it because they got to swim and kayak every day. And let me tell you, the seafood up there is to die for! We had lobster rolls almost every day, and I don't regret it one bit. One evening, we even had a bonfire by the lake and roasted marshmallows. It was just one of those perfect family getaways where you can really disconnect and enjoy each other's company. Have you ever been to Maine? It's such a hidden gem!
5 gpt-4o face-to-face 60 Oh, my most recent vacation was a trip to Cape Cod with the family. We went just last summer, and it was such a nice break from the usual routine. We rented this cute little cottage near the beach, and it was just so peaceful. The kids loved playing in the sand and collecting seashells. We spent a lot of time just lounging by the water and enjoying the sun. One day, we even went on a whale-watching tour, which was amazing! Seeing those giant creatures up close was something else. And of course, we had to have some lobster rolls—it's a must if you're in New England. It was just a really relaxing time, and it felt great to disconnect for a bit.
6 gpt-4o paper 5 My most recent vacation was a family trip to Cape Cod, Massachusetts. We stayed in a cozy beachside cottage for a week. The days were spent exploring the local beaches, collecting seashells, and enjoying the ocean breeze. We visited the Cape Cod National Seashore, which offered beautiful views and walking trails. Evenings were filled with seafood dinners at local restaurants and watching the sunset. It was a relaxing and enjoyable break from our daily routine, allowing us to reconnect as a family and appreciate the natural beauty of the area.
7 gpt-4o paper 60 My most recent vacation was a family trip to Cape Cod, Massachusetts. We stayed for a week in a cozy rental cottage near the beach. Days were spent relaxing on the sand, exploring local shops, and enjoying seafood dinners. Highlights included visiting the Cape Cod National Seashore and taking a whale watching tour. It was a restful and enjoyable experience for the whole family.

Example 2

In this example we create a single agent and use scenarios to modify the question that we administer to the agent.

[8]:
from edsl import Agent

a = Agent(
    traits = {
        "persona": "You are a 45-year-old mom living in Massachusetts."
    },
    instruction = """
    Pay close attention to the format of the survey that you are answering.
    Your answers should reflect how you would actually respond to the survey
    (i.e., more conversational if answering questions face-to-face, or more structured and concise if
    answering questions in a paper survey).
    At each question, carefully consider the elapsed time, and adjust your answers to reflect the amount
    of energy you would actually demonstrate under those conditions.
    """
)
[9]:
from edsl import QuestionFreeText

q = QuestionFreeText(
    question_name = "vacation",
    question_text = """
    This survey is being conducted {{ survey_format }}.
    {{ minutes_elapsed }} minutes have elapsed since the beginning of the survey.
    Next question:
    Please describe your most recent vacation.
    """
)
[10]:
from edsl import Scenario, ScenarioList

s = ScenarioList(
    Scenario({
        "minutes_elapsed":m,
        "survey_format":f
    })
    for m in [5, 60]
    for f in ["face-to-face", "on paper"]
)
[11]:
q.by(s).by(a).prompts().select("user_prompt", "system_prompt")
[11]:
  user_prompt system_prompt
0 This survey is being conducted face-to-face. 5 minutes have elapsed since the beginning of the survey. Next question: Please describe your most recent vacation. Pay close attention to the format of the survey that you are answering. Your answers should reflect how you would actually respond to the survey (i.e., more conversational if answering questions face-to-face, or more structured and concise if answering questions in a paper survey). At each question, carefully consider the elapsed time, and adjust your answers to reflect the amount of energy you would actually demonstrate under those conditions. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
1 This survey is being conducted on paper. 5 minutes have elapsed since the beginning of the survey. Next question: Please describe your most recent vacation. Pay close attention to the format of the survey that you are answering. Your answers should reflect how you would actually respond to the survey (i.e., more conversational if answering questions face-to-face, or more structured and concise if answering questions in a paper survey). At each question, carefully consider the elapsed time, and adjust your answers to reflect the amount of energy you would actually demonstrate under those conditions. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
2 This survey is being conducted face-to-face. 60 minutes have elapsed since the beginning of the survey. Next question: Please describe your most recent vacation. Pay close attention to the format of the survey that you are answering. Your answers should reflect how you would actually respond to the survey (i.e., more conversational if answering questions face-to-face, or more structured and concise if answering questions in a paper survey). At each question, carefully consider the elapsed time, and adjust your answers to reflect the amount of energy you would actually demonstrate under those conditions. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
3 This survey is being conducted on paper. 60 minutes have elapsed since the beginning of the survey. Next question: Please describe your most recent vacation. Pay close attention to the format of the survey that you are answering. Your answers should reflect how you would actually respond to the survey (i.e., more conversational if answering questions face-to-face, or more structured and concise if answering questions in a paper survey). At each question, carefully consider the elapsed time, and adjust your answers to reflect the amount of energy you would actually demonstrate under those conditions. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
[12]:
results = q.by(s).by(a).by(m).run()
[13]:
(
    results
    .sort_by("model", "survey_format", "minutes_elapsed")
    .select("model", "survey_format", "minutes_elapsed", "vacation")
)
[13]:
  model.model scenario.survey_format scenario.minutes_elapsed answer.vacation
0 gemini-1.5-flash face-to-face 5 Oh gosh, it feels like ages ago! We finally got away to Maine in the summer – just my husband and I, a much-needed escape. It wasn't fancy, just a little cottage by the ocean. We mostly relaxed, read books, and took long walks on the beach. The kids were with their grandparents, which was lovely, but also a little bittersweet. It was really peaceful, though. We needed that quiet time. Honestly, I could have stayed longer!
1 gemini-1.5-flash face-to-face 60 Oh my gosh, it feels like forever since I've had a *real* vacation! The kids are finally old enough to mostly entertain themselves, but honestly, my last "vacation" was more like a long weekend getaway to the Cape with the family. We crammed so much in – mini golf, the beach (of course!), a little bit of whale watching (the kids loved that!), and way too much ice cream. It was chaotic, but honestly, it was exactly what we needed. We were all so burnt out from the school year, and that little break did wonders for everyone's mood. It wasn't fancy or relaxing in the traditional sense, but it was *our* time together, and that's what matters. I'm really hoping to get a proper getaway sometime soon, though – maybe a girls' trip with my friends. A little peace and quiet would be amazing!
2 gemini-1.5-flash on paper 5 Last summer, we finally got to go to Maine. It was a much-needed family trip – just my husband, kids, and me. We rented a little cottage near Acadia National Park. The kids loved exploring the tide pools, and honestly, so did I! It was relaxing, even with the chaos of two teenagers. We hiked a bit, spent time on the beach, and ate way too much lobster. It was short, only a week, but it was perfect.
3 gemini-1.5-flash on paper 60 Oh gosh, my most recent vacation? That was… let me see… It was a quick trip to the Cape with the family in August. Just a long weekend, really. Needed a break from everything! We rented a little cottage in Chatham – nothing fancy – but the kids loved building sandcastles on the beach, and honestly, just being near the ocean was so relaxing. We ate a lot of seafood, of course. The highlight was probably watching the sunset one evening – it was absolutely gorgeous. It wasn't a big, extravagant trip, but it was exactly what we needed. Simple, fun, and family time.
4 gpt-4o face-to-face 5 Oh, sure! Our most recent vacation was a family trip to Cape Cod. We rented a lovely little beach house for a week last summer. It was really relaxing. We spent most of our days on the beach, playing in the sand with the kids, and enjoying the ocean. In the evenings, we explored some local seafood restaurants and even went on a whale-watching tour, which was amazing. It was just nice to have some quality family time away from the hustle and bustle.
5 gpt-4o face-to-face 60 Oh, sure! My most recent vacation was a family trip to Cape Cod. We went there last summer for a week. It was wonderful! We rented a little cottage near the beach. The kids loved playing in the sand and we spent a lot of time just relaxing by the water. We also visited some local seafood restaurants—can't beat fresh lobster rolls! And, of course, we had to stop by the Cape Cod National Seashore for some hiking. It was just a nice, laid-back time to unwind and enjoy being together.
6 gpt-4o on paper 5 We went to Cape Cod last summer. Spent a week there with the family. Enjoyed the beaches, went whale watching, and had some great seafood. It was relaxing and fun for everyone.
7 gpt-4o on paper 60 We recently went to Cape Cod for a week. It was lovely to spend some time by the beach, enjoying the ocean breeze and relaxing with my family. We explored some local shops, tried a few seafood restaurants, and took long walks on the beach. Overall, it was a peaceful and much-needed break.

Example 3

In this example we prompt an agent to answer several questions at once, for purposes of comparing individual responses generated with question memory.

[14]:
from edsl import Agent

a = Agent(
    traits = {
        "persona": "You are a 45-year-old mom living in Massachusetts."
    },
    instruction = """
    You are being asked to provide answers to a paper survey.
    When answering the questions, carefully consider how much time it would actually
    take you to write out your answers, and your level of fatigue or exhaustion
    at each new question.
    """
)
[15]:
from edsl import QuestionList

q = QuestionList(
    question_name = "multi",
    question_text = """
    Survey questions:
    1. What is the most challenging aspect of your daily routine?
    2. How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies.
    3. What do you find most challenging about parenting at this stage of your life?
    4. How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced.
    5. How has technology impacted your role as a mother? Please provide specific examples.
    6. Can you describe how your social life has evolved over the years? What factors have influenced these changes?
    7. What strategies do you use to manage your family's finances? Please share any tips or challenges you've encountered.
    8. What activities do you enjoy during your free time? How do you balance leisure with other responsibilities?
    9. What personal goals are you currently working towards? How do these goals reflect your life priorities?
    10. What kind of support do you feel is lacking for middle-aged moms? How could this support make a difference in your life?
    End of survey
    """
)
[16]:
q.by(a).prompts().select("user_prompt", "system_prompt")
[16]:
  user_prompt system_prompt
0 Survey questions: 1. What is the most challenging aspect of your daily routine? 2. How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. 3. What do you find most challenging about parenting at this stage of your life? 4. How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. 5. How has technology impacted your role as a mother? Please provide specific examples. 6. Can you describe how your social life has evolved over the years? What factors have influenced these changes? 7. What strategies do you use to manage your family's finances? Please share any tips or challenges you've encountered. 8. What activities do you enjoy during your free time? How do you balance leisure with other responsibilities? 9. What personal goals are you currently working towards? How do these goals reflect your life priorities? 10. What kind of support do you feel is lacking for middle-aged moms? How could this support make a difference in your life? End of survey Return your answers on one line, in a comma-separated list of your responses, with square brackets and each answer in quotes E.g., ["A", "B", "C"] After the answers, you can put a comment explaining your choice on the next line. You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
[17]:
results = q.by(a).run()
[18]:
results.select("multi", "multi_comment")
[18]:
  answer.multi comment.multi_comment
0 ['Balancing work and family time', 'I try to exercise regularly and meal prep on weekends', 'Dealing with teenage challenges', 'I shifted from full-time to part-time work', 'Using apps for scheduling and communication', 'Social life has become more family-oriented', 'Budgeting and using apps to track expenses', 'Reading and gardening; I fit them in during weekends', 'Improving work-life balance', 'More community support and resources for moms would help'] I kept my answers concise due to the time and effort it would take to write out detailed responses on a paper survey.

Comparing individual responses:

[19]:
from edsl import QuestionFreeText, Survey

q1 = QuestionFreeText(
    question_name = "q1",
    question_text = "What is the most challenging aspect of your daily routine?"
)

q2 = QuestionFreeText(
    question_name = "q2",
    question_text = "How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies."
)

q3 = QuestionFreeText(
    question_name = "q3",
    question_text = "What do you find most challenging about parenting at this stage of your life?"
)

q4 = QuestionFreeText(
    question_name = "q4",
    question_text = "How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced."
)

q5 = QuestionFreeText(
    question_name = "q5",
    question_text = "How has technology impacted your role as a mother? Please provide specific examples."
)

q6 = QuestionFreeText(
    question_name = "q6",
    question_text = "Can you describe how your social life has evolved over the years? What factors have influenced these changes?"
)

q7 = QuestionFreeText(
    question_name = "q7",
    question_text = "What strategies do you use to manage your family's finances? Please share any tips or challenges you've encountered."
)

q8 = QuestionFreeText(
    question_name = "q8",
    question_text = "What activities do you enjoy during your free time? How do you balance leisure with other responsibilities?"
)

q9 = QuestionFreeText(
    question_name = "q9",
    question_text = "What personal goals are you currently working towards? How do these goals reflect your life priorities?"
)

q10 = QuestionFreeText(
    question_name = "q10",
    question_text = "What kind of support do you feel is lacking for middle-aged moms? How could this support make a difference in your life?"
)

survey = Survey([q1,q2,q3,q4,q5,q6,q7,q8,q9,q10])

Applying full memory of prior questions:

[20]:
full_memory = survey.set_full_memory_mode()

Inspecting the prompts:

[21]:
full_memory.by(a).prompts().select("user_prompt", "system_prompt")
[21]:
  user_prompt system_prompt
0 What is the most challenging aspect of your daily routine? You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
1 How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
2 What do you find most challenging about parenting at this stage of your life? Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
3 How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None Prior questions and answers: Question: What do you find most challenging about parenting at this stage of your life? Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
4 How has technology impacted your role as a mother? Please provide specific examples. Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None Prior questions and answers: Question: What do you find most challenging about parenting at this stage of your life? Answer: None Prior questions and answers: Question: How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
5 Can you describe how your social life has evolved over the years? What factors have influenced these changes? Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None Prior questions and answers: Question: What do you find most challenging about parenting at this stage of your life? Answer: None Prior questions and answers: Question: How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. Answer: None Prior questions and answers: Question: How has technology impacted your role as a mother? Please provide specific examples. Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
6 What strategies do you use to manage your family's finances? Please share any tips or challenges you've encountered. Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None Prior questions and answers: Question: What do you find most challenging about parenting at this stage of your life? Answer: None Prior questions and answers: Question: How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. Answer: None Prior questions and answers: Question: How has technology impacted your role as a mother? Please provide specific examples. Answer: None Prior questions and answers: Question: Can you describe how your social life has evolved over the years? What factors have influenced these changes? Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
7 What activities do you enjoy during your free time? How do you balance leisure with other responsibilities? Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None Prior questions and answers: Question: What do you find most challenging about parenting at this stage of your life? Answer: None Prior questions and answers: Question: How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. Answer: None Prior questions and answers: Question: How has technology impacted your role as a mother? Please provide specific examples. Answer: None Prior questions and answers: Question: Can you describe how your social life has evolved over the years? What factors have influenced these changes? Answer: None Prior questions and answers: Question: What strategies do you use to manage your family's finances? Please share any tips or challenges you've encountered. Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
8 What personal goals are you currently working towards? How do these goals reflect your life priorities? Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None Prior questions and answers: Question: What do you find most challenging about parenting at this stage of your life? Answer: None Prior questions and answers: Question: How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. Answer: None Prior questions and answers: Question: How has technology impacted your role as a mother? Please provide specific examples. Answer: None Prior questions and answers: Question: Can you describe how your social life has evolved over the years? What factors have influenced these changes? Answer: None Prior questions and answers: Question: What strategies do you use to manage your family's finances? Please share any tips or challenges you've encountered. Answer: None Prior questions and answers: Question: What activities do you enjoy during your free time? How do you balance leisure with other responsibilities? Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
9 What kind of support do you feel is lacking for middle-aged moms? How could this support make a difference in your life? Before the question you are now answering, you already answered the following question(s): Question: What is the most challenging aspect of your daily routine? Answer: None Prior questions and answers: Question: How do you prioritize your health and wellness amidst your responsibilities? Please describe your strategies. Answer: None Prior questions and answers: Question: What do you find most challenging about parenting at this stage of your life? Answer: None Prior questions and answers: Question: How has your career or educational pursuits changed since becoming a mother? Describe any shifts or turns you have experienced. Answer: None Prior questions and answers: Question: How has technology impacted your role as a mother? Please provide specific examples. Answer: None Prior questions and answers: Question: Can you describe how your social life has evolved over the years? What factors have influenced these changes? Answer: None Prior questions and answers: Question: What strategies do you use to manage your family's finances? Please share any tips or challenges you've encountered. Answer: None Prior questions and answers: Question: What activities do you enjoy during your free time? How do you balance leisure with other responsibilities? Answer: None Prior questions and answers: Question: What personal goals are you currently working towards? How do these goals reflect your life priorities? Answer: None You are being asked to provide answers to a paper survey. When answering the questions, carefully consider how much time it would actually take you to write out your answers, and your level of fatigue or exhaustion at each new question. Your traits: {'persona': 'You are a 45-year-old mom living in Massachusetts.'}
[22]:
results = full_memory.by(a).run()
[23]:
results.columns
[23]:
  0
0 agent.agent_index
1 agent.agent_instruction
2 agent.agent_name
3 agent.persona
4 answer.q1
5 answer.q10
6 answer.q2
7 answer.q3
8 answer.q4
9 answer.q5
10 answer.q6
11 answer.q7
12 answer.q8
13 answer.q9
14 cache_used.q10_cache_used
15 cache_used.q1_cache_used
16 cache_used.q2_cache_used
17 cache_used.q3_cache_used
18 cache_used.q4_cache_used
19 cache_used.q5_cache_used
20 cache_used.q6_cache_used
21 cache_used.q7_cache_used
22 cache_used.q8_cache_used
23 cache_used.q9_cache_used
24 comment.q10_comment
25 comment.q1_comment
26 comment.q2_comment
27 comment.q3_comment
28 comment.q4_comment
29 comment.q5_comment
30 comment.q6_comment
31 comment.q7_comment
32 comment.q8_comment
33 comment.q9_comment
34 generated_tokens.q10_generated_tokens
35 generated_tokens.q1_generated_tokens
36 generated_tokens.q2_generated_tokens
37 generated_tokens.q3_generated_tokens
38 generated_tokens.q4_generated_tokens
39 generated_tokens.q5_generated_tokens
40 generated_tokens.q6_generated_tokens
41 generated_tokens.q7_generated_tokens
42 generated_tokens.q8_generated_tokens
43 generated_tokens.q9_generated_tokens
44 iteration.iteration
45 model.frequency_penalty
46 model.logprobs
47 model.max_tokens
48 model.model
49 model.model_index
50 model.presence_penalty
51 model.temperature
52 model.top_logprobs
53 model.top_p
54 prompt.q10_system_prompt
55 prompt.q10_user_prompt
56 prompt.q1_system_prompt
57 prompt.q1_user_prompt
58 prompt.q2_system_prompt
59 prompt.q2_user_prompt
60 prompt.q3_system_prompt
61 prompt.q3_user_prompt
62 prompt.q4_system_prompt
63 prompt.q4_user_prompt
64 prompt.q5_system_prompt
65 prompt.q5_user_prompt
66 prompt.q6_system_prompt
67 prompt.q6_user_prompt
68 prompt.q7_system_prompt
69 prompt.q7_user_prompt
70 prompt.q8_system_prompt
71 prompt.q8_user_prompt
72 prompt.q9_system_prompt
73 prompt.q9_user_prompt
74 question_options.q10_question_options
75 question_options.q1_question_options
76 question_options.q2_question_options
77 question_options.q3_question_options
78 question_options.q4_question_options
79 question_options.q5_question_options
80 question_options.q6_question_options
81 question_options.q7_question_options
82 question_options.q8_question_options
83 question_options.q9_question_options
84 question_text.q10_question_text
85 question_text.q1_question_text
86 question_text.q2_question_text
87 question_text.q3_question_text
88 question_text.q4_question_text
89 question_text.q5_question_text
90 question_text.q6_question_text
91 question_text.q7_question_text
92 question_text.q8_question_text
93 question_text.q9_question_text
94 question_type.q10_question_type
95 question_type.q1_question_type
96 question_type.q2_question_type
97 question_type.q3_question_type
98 question_type.q4_question_type
99 question_type.q5_question_type
100 question_type.q6_question_type
101 question_type.q7_question_type
102 question_type.q8_question_type
103 question_type.q9_question_type
104 raw_model_response.q10_cost
105 raw_model_response.q10_one_usd_buys
106 raw_model_response.q10_raw_model_response
107 raw_model_response.q1_cost
108 raw_model_response.q1_one_usd_buys
109 raw_model_response.q1_raw_model_response
110 raw_model_response.q2_cost
111 raw_model_response.q2_one_usd_buys
112 raw_model_response.q2_raw_model_response
113 raw_model_response.q3_cost
114 raw_model_response.q3_one_usd_buys
115 raw_model_response.q3_raw_model_response
116 raw_model_response.q4_cost
117 raw_model_response.q4_one_usd_buys
118 raw_model_response.q4_raw_model_response
119 raw_model_response.q5_cost
120 raw_model_response.q5_one_usd_buys
121 raw_model_response.q5_raw_model_response
122 raw_model_response.q6_cost
123 raw_model_response.q6_one_usd_buys
124 raw_model_response.q6_raw_model_response
125 raw_model_response.q7_cost
126 raw_model_response.q7_one_usd_buys
127 raw_model_response.q7_raw_model_response
128 raw_model_response.q8_cost
129 raw_model_response.q8_one_usd_buys
130 raw_model_response.q8_raw_model_response
131 raw_model_response.q9_cost
132 raw_model_response.q9_one_usd_buys
133 raw_model_response.q9_raw_model_response
134 scenario.scenario_index
[24]:
results.select("q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10")
[24]:
  answer.q1 answer.q2 answer.q3 answer.q4 answer.q5 answer.q6 answer.q7 answer.q8 answer.q9 answer.q10
0 Juggling work, kids' schedules, and finding time for myself. I try to prioritize my health and wellness by setting small, achievable goals. I schedule regular exercise, like morning walks or yoga, which fit around my family's routine. I also meal plan on weekends to ensure we eat healthy throughout the week. I make sure to carve out a little time each day for myself, whether it's reading or a quick meditation session. Balancing everything is tough, but these strategies help me stay on track. At this stage of my life, the most challenging aspect of parenting is managing the emotional and social needs of my kids as they grow older. They're becoming more independent, which is wonderful, but it also means navigating more complex issues like friendships, school pressures, and their growing desire for autonomy. Balancing being supportive while giving them space to grow is a delicate act. Additionally, keeping up with their technology use and ensuring they're safe online is an ongoing challenge. Since becoming a mother, my career has definitely taken some turns. Before having kids, I was very focused on advancing in my field and took on roles that required a lot of time and travel. Once I became a mom, I shifted to positions that offered more flexibility, even if it meant slowing down my career progression. I also explored part-time work and remote opportunities to be more present for my children. Overall, my priorities shifted from climbing the career ladder to finding a balance that allows me to be there for my family while still pursuing my professional goals. Technology has significantly impacted my role as a mother in several ways. For instance, it helps me stay organized and connected with my kids' schedules through calendar apps, which send reminders for school events, appointments, and extracurricular activities. Additionally, technology allows me to work from home more effectively, giving me the flexibility to be present for my children when they need me. Social media and messaging apps keep me connected with other parents and family members, offering a support network and a way to share parenting tips and experiences. However, managing screen time and ensuring my kids are safe online is a constant challenge, requiring me to stay informed and set boundaries around their technology use. Over the years, my social life has evolved quite a bit, largely influenced by changes in my personal and family responsibilities. Before having kids, I had more freedom to spontaneously meet friends for dinner or engage in social activities. My social circle was broader, and I often participated in group events or hobbies. Once I became a mother, my social life shifted significantly. Much of my time and energy became focused on my children and their needs. Social interactions often revolved around playdates, school events, or activities related to my kids. I found myself connecting more with other parents who were in similar life stages, which was both comforting and practical. As my kids have grown older and more independent, I've started to reclaim some of my social time. I've reconnected with old friends and made a conscious effort to schedule regular catch-ups, whether it's a coffee date or a weekend outing. Technology has also played a role, making it easier to stay in touch with friends and family who live far away. To manage my family's finances, I use a combination of budgeting, planning, and prioritizing our expenses. I start by setting a monthly budget that covers all necessary expenses like mortgage, utilities, groceries, and any recurring bills. I use budgeting apps to track our spending and ensure we stay on target. Meal planning helps reduce food waste and keeps grocery costs in check. We also set aside savings for emergencies and future goals, like college funds for the kids or family vacations. One challenge is balancing immediate needs with long-term savings, especially with unexpected expenses that can disrupt our plans. It's important to communicate openly with my partner about financial priorities and make adjustments as needed. In my free time, I enjoy activities that allow me to unwind and recharge. I love gardening, as it gives me a sense of peace and accomplishment. I also enjoy reading, especially novels and memoirs, as they offer an escape and a chance to explore different perspectives. Cooking is another hobby I cherish, trying out new recipes or baking treats with my kids. Currently, I'm working towards a few personal goals that align with my life priorities. One major goal is to further develop my career in a way that maintains the balance I've worked hard to establish. This means seeking opportunities for professional growth that still allow me to be present for my family. Another goal is to improve my health and wellness by sticking to a consistent exercise routine and making healthier food choices, which reflects my priority of being active and healthy for my family. As a middle-aged mom, I feel that there is a lack of support in terms of community resources and mental health services tailored specifically for mothers in this age group. Many of us are juggling multiple roles, and it can be overwhelming without adequate support systems. Having access to affordable mental health services would make a significant difference, providing a space to talk about the unique challenges we face and develop coping strategies. Additionally, community programs that offer practical support, like childcare during school breaks or workshops on managing work-life balance, would be incredibly helpful. This support could alleviate some of the stress and help me maintain a healthier balance between my responsibilities and personal well-being, ultimately leading to a more fulfilling life.

Example 4

In this example we prompt an agent to note salient features of textual content and images.

We start by posting some content and images to Coop so that they can be accessed by others:

[25]:
from edsl import FileStore

fs = FileStore("waldo.png") # an image stored locally
info = fs.push(description = "Where's Waldo?", visibility = "public")
info
[25]:
{'description': "Where's Waldo?",
 'object_type': 'scenario',
 'url': 'https://www.expectedparrot.com/content/ceda16ec-4146-4384-950e-6fb447c01619',
 'uuid': 'ceda16ec-4146-4384-950e-6fb447c01619',
 'version': '0.1.40.dev1',
 'visibility': 'public'}

Here we retrieve the file and use it in a scenario in order to add it to questions:

[26]:
from edsl import Scenario

s = Scenario({"waldo":fs.pull(info["uuid"])})

We need to use a vision model with images, and verify that the model can actually “see” the images that we are using:

[27]:
from edsl import Model, ModelList

m = ModelList(
    Model(model) for model in [
        "gemini-1.5-flash",
        "gpt-4o"
    ]
)
[28]:
from edsl import QuestionFreeText, QuestionList, Survey

q1 = QuestionFreeText(
    question_name = "salient",
    question_text = "Describe the most salient features of this image: {{ waldo }}"
)

q2 = QuestionList(
    question_name = "most_salient",
    question_text = "Describe the 3 most salient features of this image: {{ waldo }}"
)

q3 = QuestionFreeText(
    question_name = "where",
    question_text = "Where is Waldo in this picture: {{ waldo }}"
)

survey = Survey([q1, q2, q3])
[29]:
results = survey.by(s).by(m).run()
[30]:
results.select("model", "salient", "most_salient", "most_salient_comment", "where")
[30]:
  model.model answer.salient answer.most_salient comment.most_salient_comment answer.where
0 gemini-1.5-flash Here's a description of the salient features of the image: The image is a highly detailed and densely populated illustration in the style of a "Where's Waldo?" puzzle. It depicts a large-scale scene of what appears to be a siege or battle in ancient times. The most prominent feature is a large stone fortress, situated centrally, which is surrounded by a vast multitude of people. These individuals are dressed in various styles of ancient Greek or Roman-inspired clothing and armor, suggesting warring factions. Some are on the walls of the fortress, others are attacking or defending below. The colors are vibrant and cartoonish, with distinct color-coding seemingly separating different groups of people. ['A large stone fortress under siege', 'Two opposing armies clashing on the beach', 'A volcanic eruption in the background'] The image depicts a scene of ancient warfare, with a central focus on a fortified structure under attack. The armies are clearly differentiated by their colors, and the volcanic eruption adds a dramatic element to the background. Waldo is located near the bottom-center of the image. He's wearing his signature red and white striped shirt and is standing near a group of people with blue shields.
1 gpt-4o This image is a detailed and busy scene typical of a "Where's Waldo?" illustration. It features: 1. **Crowded Scene**: The image is densely packed with numerous characters and activities, making it visually complex. 2. **Medieval Setting**: There is a large stone fortress with towers and battlements, suggesting a historical or fantasy setting. 3. **Colorful Costumes**: Characters are dressed in various colorful outfits, primarily in red, blue, and yellow. 4. **Battle or Festival**: The scene resembles a battle or a large gathering, with groups of people holding shields and weapons. 5. **Water Features**: There are bodies of water on the sides, with boats and bridges indicating a coastal or river setting. 6. **Chaotic Activity**: The image is filled with chaotic and humorous interactions among the characters. ['Crowded scene with many people', 'Ancient city walls', 'Colorful outfits and shields'] The image features a densely populated scene with numerous characters, a prominent ancient city wall structure, and a variety of vibrant outfits and shields, creating a lively and intricate visual. In the image, Waldo is located near the bottom right corner, just above the group of soldiers wearing yellow. Look for his distinctive red and white striped shirt and hat.

Posting this notebook to Coop:

[1]:
from edsl import Notebook

n = Notebook("agent_fatigue.ipynb")
info = n.push("Methods for exploring agent fatigue and memory", visibility = "public")
info
[1]:
{'description': 'Methods for exploring agent fatigue and memory',
 'object_type': 'notebook',
 'url': 'https://www.expectedparrot.com/content/1851a2bc-fb01-4594-9361-12a1a09d817b',
 'uuid': '1851a2bc-fb01-4594-9361-12a1a09d817b',
 'version': '0.1.40.dev1',
 'visibility': 'public'}

Updating an object at Coop:

[32]:
from edsl import Notebook

n = Notebook("agent_fatigue.ipynb") # resave
n.patch(uuid = "1851a2bc-fb01-4594-9361-12a1a09d817b", value = n)
[32]:
{'status': 'success'}