Skip to content

Conversation

@eob
Copy link
Contributor

@eob eob commented Jul 25, 2023

Right now, we're capable of scheduling a package invocation for a future time. That means we technically support an agent reaching out to tell someone something, but the reality of working with that is a bit tricky:

  • What if some other conversation in the interim renders the original message moot? Or socially weird?
  • What if too many outreach messages get enqueued, resulting in the agent being a psycho stalker that keeps SMS'ing you "hey! hey! hey!"

ENTER:

The Socially Intelligent CRON Job!

(sorry I'm in a silly mood..)

Here's the rough idea:

  • You can enqueue message sends (to start; more complex stuff in V2) with different kinds of invalidation flags.
    • Example invalidation flags: "If another message send is sent with this key" or "if the user messages me back before the send"
  • Then, we schedule a maybe_send callback for the time when the send was scheduled. But it isn't guaranteed to succeed if some kind of invalidation event occurred.

Examples (pseudocode)

  1. Are you still there?
agent.send(answer)
agent.social_cron("10 minutes", "Are you still there?", expire_if_user_responds=True, delete_chat_after_send=True)
  1. Hey! What's cookin?
best_friend.send(response)
agent.social_cron("1 day + rand(1 day)", "What's cookin? How's your day?", expire_if_user_responds=True)

@douglas-reid
Copy link
Contributor

this idea has tons of potential.

aside: i wonder which has more resonance with devs and users: "socially-intelligent" or "context-aware" or something less jargon-y like "conditional reminder" or even "if-not-then" (aside-aside: do people prefer to describe in the negative or positive -- if expired, do vs. if not , do ).

my sketch expanding upon it:

agent.schedule(
  action=FutureAction(tool="GreetingTool", input=user.name),
  condition=NoUserMessagesCondition(),
  delay="1d", 
  recurring=True,
  context=ctx
)

@eob
Copy link
Contributor Author

eob commented Jul 26, 2023

I like this expansion a lot. Also that it's an Action your scheduling rather than a message -- fits better into the rest of the Action/Tool framing.

This is me just piling on ideas, but a few other things that I was thinking could be interesting (though maybe indulgent for v1?) could be:

  • A bit of randomness
  • Some kind of time-zone awareness of the user.. combined with an enum of human-style time blocks?

E.g.:

send this tomorrow-morning
send this late at night
send this on the weekend
send this around dinnertime

@eob eob marked this pull request as draft August 16, 2023 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants