---
title: "Discussion on \"Build Your Own Personal Twitter Agent 🧠🐦⛓ with LangChain\" | Hashnode"
description: "Discussion on \"Build Your Own Personal Twitter Agent 🧠🐦⛓ with LangChain\". TL;DR\nLangChain, ChatGPT, and other emerging technology have made it possible to build some really creative tools.\nIn this tutorial, we’ll build a full-stack web app (LangChainJS, React, NodeJS) that acts as our own personal Twitter Agent, or “intern..."
url: "https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Build Your Own Personal Twitter Agent 🧠🐦⛓ with LangChain](https://wasp-lang.hashnode.dev/build-your-own-personal-twitter-agent-with-langchain?utm_source=hashnode&utm_medium=feed)

TL;DR LangChain, ChatGPT, and other emerging technology have made it possible to build some really creative tools. In this tutorial, we’ll build a full-stack web app (LangChainJS, React, NodeJS) that acts as our own personal Twitter Agent, or “intern...

Jun 28, 2023 · 41 min read · wasp-lang.hashnode.dev  
Updated Jun 30, 2023  
Read the article

-   [#langchain](https://hashnode.com/tag/langchain)
-   [#chatgpt](https://hashnode.com/tag/chatgpt)
-   [#full-stack](https://hashnode.com/tag/full-stack)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#nodejs](https://hashnode.com/tag/nodejs)

## Written by

[Vince Canger](https://hashnode.com/@vincanger)

@vincanger

  
[View profile](https://hashnode.com/@vincanger)

Software Dude

## Responses 13

Markdown supported · ⌘↵ to post

[Raghu S](https://hashnode.com/@raghu07)

[Aug 6, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/64cf4577058075dab96ed6ed)

Nice Content!!!

[Vince Canger](https://hashnode.com/@vincanger)

[Aug 6, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/64cf4577058075dab96ed6ed#reply-64cf5cf0058075dab96ed8fe)

thank you!

[Devin Smaldore](https://hashnode.com/@speakofthedevo)

[Jul 6, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/64a614bad6052e06fc15db09)

Hey again, [Vince Canger](https://hashnode.com/@vincanger)!

Just thought I would help out as I am stepping through this tutorial. It looks like rettiwt-api made an update that needs to be addressed here. See [github.com/Rishikant181/Rettiwt-API/issues/315](https://github.com/Rishikant181/Rettiwt-API/issues/315)

[Vince Canger](https://hashnode.com/@vincanger)

[Jul 6, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/64a614bad6052e06fc15db09#reply-64a68727c8506606ccf1de62)

Thanks for the heads up! Those updates are probably in reference to twitter closing public access. Since we log in to twitter with Rettiwt, this shouldn’t be an issue, as we’re using the non-public methods.

But if you do use the newer version let me know how it goes!

[Devin Smaldore](https://hashnode.com/@speakofthedevo)

[Jul 6, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/64a60b95c8506606ccf1cf5f)

Hey there, [Vince Canger](https://hashnode.com/@vincanger)! First off, this is an amazing tutorial you've put together and I am looking forward to having a working version here soon!

I'm running into an issue with the `export const generateNewIdeas: GenerateNewIdeas<unknown, void> = async (_args, context) => {...}` function, specifically, it is complaining that `src/ext-src/ideas.ts(102,49): error TS2344: Type 'unknown' does not satisfy the constraint 'Payload'.`

I changed the `unknown` to be of type `Payload`. Is that a sufficient enough work around?

[Vince Canger](https://hashnode.com/@vincanger)

[Jul 6, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/64a60b95c8506606ccf1cf5f#reply-64a686a6c8506606ccf1de5a)

Ah. Try changing it to ‘never’. That should do the trick as we’re letting typescript know that this function won’t take any arguments

[farah nizami](https://hashnode.com/@farahnizami887)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649f0dd25b8c3caad17893f9)

Thats useful 🩷💜❤️

[Vince Canger](https://hashnode.com/@vincanger)

[Jul 1, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649f0dd25b8c3caad17893f9#reply-64a090c08db091c401034187)

thanks!

[SHRIVATSA D DESAI](https://hashnode.com/@ShrivatsaDesai54)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649ef5395b8c3caad1789104)

Will take a couple of week to study this!!! BUt iT wiLL be woRTH IT. loved this article :) :) :)

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649ef5395b8c3caad1789104#reply-649ef59a5b8c3caad178911e)

Nice! Yeah it's long but you should learn a lot. Let me know if you have any Qs.

[Neutron](https://hashnode.com/@Neutron768)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13)

On clicking 'Generate New Ideas' it shows a pop up `TypeError: Cannot read properties of undefined (reading 'instructions')`

In MainPage.tsx on `await generateNewIdeas()` it shows the following error :

`Expected 1 arguments, but got 0.ts(2554) types.ts(7, 6): Arguments for the rest parameter 'args' were not provided`

How do I resolve this? btw great blog and gg till now!

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649ea0032a0936ab01ee21f3)

[Neutron](https://hashnode.com/@Neutron768) hey I found out the work around. It looks twitter no longer allows you to view content unless you're signed in. so you have to log in with the Rettiwt-Api once, save the tokens it returns (in your ENV VARS perhaps) and then use those to initiate the client like this. Be careful with this thought because if you dont do it correctly you could get your account suspended. Its probably best to use an alternate twitter account for this:

```
const getTokens = async () => {
  const tokens = await Rettiwt().account.login(
    process.env.TWITTER_EMAIL!,
    process.env.TWITTER_HANDLE!,
    process.env.TWITTER_PASSWORD!
  );

  console.log('tokens: ', tokens) // save these in your env vars or somewhere safe
};

//...

      const twitter = Rettiwt(tokens); // from above
      // then call twitter.tweets.getTweets() instead of twitter.users.getUserTweets
      const favUserTweets = await twitter.tweets.getTweets({
        fromUsers: [favUser],
        // endDate in format YYYY-MM-DD
        endDate: endDate,
      });
```

i'll post an update to the article and repos ASAP

[Neutron](https://hashnode.com/@Neutron768)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649eb23a2a0936ab01ee24e0)

[Vince Canger](https://hashnode.com/@vincanger) cool, i'll update it

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e861d2a0936ab01ee1e13#reply-649eeb022a0936ab01ee2dda)

tutorial has been updated! [Neutron](https://hashnode.com/@Neutron768)

[Pulimaradka](https://hashnode.com/@coorgboy)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e71135b8c3caad1787b7f)

Amazon work

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649e71135b8c3caad1787b7f#reply-649e83f92a0936ab01ee1dbe)

Straight from the rainforest ;)

[Daniela Passos](https://hashnode.com/@danielapassos)

[Jun 29, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649db9805b8c3caad1786c5c)

Loved the article! So useful 🔥

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 30, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649db9805b8c3caad1786c5c#reply-649e84085b8c3caad1787f82)

Thanks, Dani

[Jake Page](https://hashnode.com/@jakepagedev)

[Jun 29, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649d5ac02f8474a27dd5d432)

Can't wait to implement this!

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 29, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649d5ac02f8474a27dd5d432#reply-649d62222f8474a27dd5d548)

noice. lemme know if oyu have any Qs!

[Matija Sosic](https://hashnode.com/@matijash)

[Jun 29, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649d4dee2f8474a27dd5d286)

This is cool stuff, I'm gonna build this over the weekend. Thanks for the detailed instructions!

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 29, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649d4dee2f8474a27dd5d286#reply-649d4f192f8474a27dd5d2a4)

You're welcome. let me know if you have any Qs

[Kavir Kaycee](https://hashnode.com/@kavir)

[Jun 29, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649d1c8a2f8474a27dd5c9fe)

Very comprehensive, thanks for sharing this!

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 29, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649d1c8a2f8474a27dd5c9fe#reply-649d1d382f8474a27dd5ca35)

🙏

[Jacek Fleszar](https://hashnode.com/@fleszarjacek)

[Jun 28, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649c441830c0ca9898ddc279)

Very useful 🎺

[Vince Canger](https://hashnode.com/@vincanger)

[Jun 28, 2023](https://hashnode.com/posts/build-your-own-personal-twitter-agent-with-langchain/649c29c04c5b78227c6b5bed/comment/649c441830c0ca9898ddc279#reply-649c472630c0ca9898ddc305)

Nice! Let me know if you have any questions :)
