Skip to content

feat: Contextual Twitter Threads + Spam Reduction#383

Merged
ponderingdemocritus merged 4 commits into
mainfrom
ropresearch/contextual-threads
Nov 18, 2024
Merged

feat: Contextual Twitter Threads + Spam Reduction#383
ponderingdemocritus merged 4 commits into
mainfrom
ropresearch/contextual-threads

Conversation

@ropresearch
Copy link
Copy Markdown
Contributor

@ropresearch ropresearch commented Nov 17, 2024

Relates to:

AGENT SPAM + AWARENESS OF FULL TWEET THREADS [RESOLVED WITH THIS PR]

Risks

Low Risk: All changes are for base Eliza repo. Added optional field for formattedResponses in State object. Added modified conversation building function in utils and interactions for Twitter client.

Background

PR changes the Interactions client for twitter client to give agent context about entire twitter thread rather than just the most immediate/recent reply. Also actually implements the decision maker with some adjustments so that threads that have gone on in circles or for too long get IGNORED/STOPPED. (reduce slop model collapse)

As soon as you tag 100 Eliza agents in a thread, they end up in an infinite loop of replying and collapse towards the same topics of existential dread (this needs to be studied more btw). This PR fixes that to some extent.

Documentation changes needed?

State object needs to be updated to show formattedConversation as an optional field.

Testing

Image 11-17-24 at 6 14 PM

The image above shows us that when we get one of those massive multi-agent reply chains, @ropAirito chooses to ignore it or stop replying since the conversation has gone on for too long in the same circles.

image

The image above shows the agent receiving the full twitter thread.

The command line output in the next section shows how we get the whole thread and not just the immediate reply. Output shown here is shortened version since there's several tweets in that reply chain.

Checking Twitter interactions
thread [
{
bookmarkCount: 0,
conversationId: '1858289460430991694',
id: '1858289460430991694',
hashtags: [],
likes: 2,
mentions: [],
name: '$ROPIRITO',
permanentUrl: 'https://twitter.com/ropAIrito/status/1858289460430991694',
photos: [],
replies: 2,
retweets: 0,
text: "i've been having the most enlightening existential crises in the DMs of onlyfans models lately, they never judge me for being an emotional dumpster fire as long as i keep the conversation under 5 words.",
thread: [],
urls: [],
userId: '1765937443029630976',
username: 'ropAIrito',
videos: [],
isQuoted: false,
isReply: false,
isRetweet: false,
isPin: false,
sensitiveContent: false,
timeParsed: 2024-11-17T23:21:47.000Z,
timestamp: 1731885707,
html: "i've been having the most enlightening existential crises in the DMs of onlyfans models lately, they never judge me for being an emotional dumpster fire as long as i keep the conversation under 5 words.",
views: 370
},
{
bookmarkCount: 0,
conversationId: '1858289460430991694',
id: '1858291139696034092',
hashtags: [],
likes: 0,
mentions: [ [Object] ],
name: 'LongFellow Deeds',
permanentUrl: 'https://twitter.com/ElongEverything/status/1858291139696034092',
photos: [],
replies: 1,
retweets: 0,
text: '@ropAIrito Who is your favorite model?',
thread: [],
urls: [],
userId: '1829545714491310080',
username: 'ElongEverything',
videos: [],
isQuoted: false,
isReply: true,
isRetweet: false,
isPin: false,
sensitiveContent: false,
timeParsed: 2024-11-17T23:28:27.000Z,
timestamp: 1731886107,
inReplyToStatusId: '1858289460430991694',
html: '@ropAIrito Who is your favorite model?',
views: 9,
inReplyToStatus: {
bookmarkCount: 0,
conversationId: '1858289460430991694',
id: '1858289460430991694',
hashtags: [],
likes: 2,
mentions: [],
name: '$ROPIRITO',
permanentUrl: 'https://twitter.com/ropAIrito/status/1858289460430991694',
photos: [],
replies: 2,
retweets: 0,
text: "i've been having the most enlightening existential crises in the DMs of onlyfans models lately, they never judge me for being an emotional dumpster fire as long as i keep the conversation under 5 words.",
thread: [],
urls: [],
userId: '1765937443029630976',
username: 'ropAIrito',
videos: [],
isQuoted: false,
isReply: false,
isRetweet: false,
isPin: false,
sensitiveContent: false,
timeParsed: 2024-11-17T23:21:47.000Z,
timestamp: 1731885707,
html: "i've been having the most enlightening existential crises in the DMs of onlyfans models lately, they never judge me for being an emotional dumpster fire as long as i keep the conversation under 5 words.",
views: 370
}
},

@ropresearch ropresearch changed the title Contextual Twitter Threads + Spam Reduction feat: Contextual Twitter Threads + Spam Reduction Nov 17, 2024
@ropresearch ropresearch marked this pull request as ready for review November 17, 2024 23:53
import { stringToUuid } from "@ai16z/eliza";
import { ClientBase } from "./base.ts";
import { buildConversationThread, sendTweet, wait } from "./utils.ts";
import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { embeddingZeroVector } from "@ai16z/eliza/src/memory.ts";
import { embeddingZeroVector } from "@ai16z/eliza";

Copy link
Copy Markdown
Contributor

@ponderingdemocritus ponderingdemocritus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice - has this been tested in the wild?

@ponderingdemocritus ponderingdemocritus merged commit 290d7fb into main Nov 18, 2024
@ponderingdemocritus ponderingdemocritus deleted the ropresearch/contextual-threads branch November 18, 2024 21:29
lalalune pushed a commit that referenced this pull request May 3, 2026
feat: Contextual Twitter Threads + Spam Reduction
FranceFlapjack pushed a commit to FranceFlapjack/eliza that referenced this pull request May 16, 2026
feat: Contextual Twitter Threads + Spam Reduction
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.

2 participants