978: Should a New Coder Use AI?

## Document Notes
## Highlights
- **Prime AI With Clear Constraints**
- Do prepare detailed prompts and project constraints before asking AI to write code.
- Do review and test every AI-generated change to avoid duplicated or sloppy code.
Transcript:
Wes Bos
But Paige says, hey, Scott and Wes, I want to ask if you use multiple AI agents while you're writing code with Cloud Code, Cursor, etc. I've become a big fan of using Cloud Code to work on features day to day, but I still don't trust it to write new code unsupervised that follows conventions that are already established In the code base. Use existing utility functions, keep the code dry. It wasn't repeating itself, etc., etc. TLDR, I prove every code change Claude makes before it does them, and I want to watch it like a hawk to avoid the sight of refactoring and rewriting at the end of the features. Online, however, I see folks are how they're able to spin up multiple agents and work on five separate features at once. AI companies like cursor are touting how devs can have multiple different LLMs working on the same feature and then pick the implementation they look best. Yeah, that's that's a thing in cursor. You can you can like set it up to rip. Yeah. On like you can say, hey, make five and I'll choose the best. To me, it seems like a recipe for fatigue from trying to review all of this AI-generated code, too much contact switching, et cetera, et cetera. Am I being too controlling by handling all of my agents to higher standards than other devs? I'd like to think not. And it just goes on to say, like, are you guys using multiple AI agents at a single time? And I wrote a bit of a book to this because I feel like this is a such a good question for kind of where we're at right now. Everyone's talking about how like you just got to have five running at a single time. And if you're not, you're you're falling behind. Totally. But yeah, I find and I'm curious what you think about this, Scott, is I find that the longest part of AI generated code is on either end. First, it's planning what needs to happen for the thing. So whether that is code styles, whether that's how you need to actually solve the problem, whether that's what the actual problem is and how to interact with it and what packages to use, Et cetera, et cetera. That like making sure that you type everything in what is actually happening and giving it all of the context upfront is, is probably takes the most time. Right. Um, and then the second last second longest part is, is actually reviewing it after the fact, right? Like testing that it actually works, that it didn't make a mess somewhere that it didn't just copy paste and duplicate a whole bunch of styles and make a problem for down the road. But I do. I was just saying this. Scott and I were working on this Sinhax code base. We've got an episode coming up on that. But that was a code base that was very well defined with how pages are made, how components are made, how CSS is done, how mutations are done. And because Scott spent a whole bunch of time up front sort of like detailing how rigid it will be, I found that it did a very good job. Not perfect. There's certainly some messes that we made. But I think because it was a, had everything sort of documented as to how it should work ahead of time, it actually did a better job than a lot of these other like Greenfield projects where It just kind of goes nuts on it. Right. So multiple agents at a time. What do you think? I am not at a spot where I'm running five of them at a time because simply like the actual generation of the code is not the slow part right now. Right. It's simply the two things that I talked about. So much of software development is not just writing code. It's me thinking about like, what's next? So what I'll do is I'll let an agent rip. And while it's working on that problem, I will then shift to looking at, okay, what am I working on next? How should I approach something? What needs to be done? Can I log some issues? Do I need to talk to somebody on Slack about this, this specific problems? That is where I find it is really, really helpful where I can like, just like where time where I would normally just be like actually writing the code. I can then just like, while that thing is running, I can go switch to what is next. And because of that, I can often like not running two or three at a time, but they do overlap each other. ([Time 0:01:39](https://share.snipd.com/snip/5e7a3e52-991e-4f86-b853-406480ab0402))
- **Feed AI With Root-Cause Bug Data**
- Do use tools like Sentry to gather bug context and feed that into AI workflows.
- Do convert errors into indexed tasks with root-cause info before asking agents to fix them.
Transcript:
Scott Tolinski
Like, I'm not typically doing a lot of agents YOLOing on stuff. I'm not just going to throw a bash loop and give it a name of the AI repeatedly working on something. I'm going to validate these things every step of the way for code. And I'm going to do the work up front. I'm going to give it clear prompts. And I'm going to have very clear instructions. Speaking of which, Wes, you know what does a great job of this is Sentry. And Sentry actually just has a new CLI that came out, the Sentry CLI, which is really, really good at this kind of stuff because it can give you the root cause of bugs and uses the SEER, their AI SEER, to give you the root cause of a bug and return that directly from the CLI, which works really well with some of these AI tools, because you could say, use the century CLI, get me All of the errors, catalog them as tasks. And however you manage tasks, I use something called decks, and then use the seer root cause in the descriptions. And then you can go and have that fix bugs really easily. So Sentry does such a good job of having all that information. But again, to reiterate my point, you're priming the AI with all of the information that's needed. It has the bug, it has the root cause, it has the files, it knows what to do, it can go off and do it. ([Time 0:09:19](https://share.snipd.com/snip/a494c1c4-19df-4a23-a9b1-3702d75d5e51))
- **Assign Low-Risk Jobs To Agents First**
- Try delegating small, low-risk tasks or long-neglected bugs to autonomous agents.
- Avoid trusting agents unsupervised on critical or unfamiliar code paths.
Transcript:
Wes Bos
Like you could just say like, oh, something's logged in in Sentry, just automatically maybe try to suggest a fix. And sometimes it's as simple as just like checking if a property exists before assuming that it is there, right? But like a lot of people, and I have not gone down this path yet, but a lot of people are like setting up multiple work trees on their thing. So like a work tree is in Git. If you check out a work tree, you're essentially just like duplicating the code into a second folder. So you can have like two or three versions of your code base running on your computer at the same time or like wherever it is that you're running these agents. It might be in like a cloud as well. If you set up your like thing properly with like work trees and your npm scripts are aware of of the work trees then you can run multiple at a time but i've not gone down that path just yet One more thing i know we're talking a lot about this but i think like another huge use case is simply just like those bugs that you have been meaning to fix for a very long time but just like Haven't got around to it because it's like i don't know it takes a little bit to get set up you gotta research it you gotta and it might be relatively two or three line fix but the the overhead Of just having to get into it is the reason why you just never go and fix it that is such good stuff that you can just set an agent on and let her rip like even what do we have like The sound was Too loud on one of our audio things that played. And yeah, I could have like branched out and made a pull request and all that, but like just let an agent rip on it, find out where in the code base it is. And it's just a simple, just one thing, make the volume 20%, boom. Yeah. Let it go. ([Time 0:11:01](https://share.snipd.com/snip/abb45597-fbe7-4811-b22f-31747fe29f24))
- **Pick Pagination By Content Dynamics**
- Choose pagination based on content behavior and user needs, not just aesthetics.
- Use cursor pagination for frequently-updating feeds and update URLs for infinite scroll.
Transcript:
Scott Tolinski
Oh, okay. So for me, I'll tell you this, this is definitely a vibes thing. I'm sure there is a hard number here. But for me, it's a lot of dogfooding your own stuff, using your own work, your applications, seeing what feels good, what feels bad, the things that work well for I would say something Like infinite scroll is more of like, like a feed, right? A feed is always going to just continue to give you the next thing. It's like a never ending well of content. You can just keep mindlessly scrolling it hard lists of a lot of data. To me that that tracks more for pagination because you'll want people to be able to navigate to a specific page like syntax has nearly 1000 episodes now. And we wouldn't put our main listing of all of the episodes as an infinite scroll, because you could never say link to page 19 and get like the early or those episodes here or there. To me, that makes sense for pagination. However, how many do you have is totally a vibes thing. Like, for instance, the syntax listing, I believe, is a three card per row.
Wes Bos
And then therefore, it makes sense to have multiples of three right it never works with responsive though you always got oh yeah yeah when they go down to two and you've got like that weird
Scott Tolinski
That weird one thing missing well you know you just go from three to to one yeah no you have some views where the css looks bad. No, to me personally, that's it. And that's the distinction. But a lot of that comes from just using your stuff and knowing what feels good and what doesn't feel good and predicting the needs of your users, right?
Wes Bos
We should also say there's kind of like two types of pagination, right? There's offset pagination where like you have listing one to 10 and you have 10 per page and you click on page two and then you see 11 through 20, right? That that's offset where offset pagination does not make sense is where the content is updating frequently right so you might be for example if if you had a list of like like tweets and And those are updating every minute or so um you might be reading page like one through ten and then you push page two and then the tenth one from the page one is now now the 11th one. Right. Because it got pushed down. And if that's the case, you have to use something called cursor based pagination, where instead of saying, give me the 50th one, give me 10 from the 50th one forward when you sort by date, Et cetera. You simply just say, give me all of the items that are between these cursors, meaning that this is the ID of the last item that I saw. Now, the next page will be the items that are after that. And often they simply don't even have page numbers associated with them. They are simply based on the piece of content that you are viewing. And that's helpful if you want to bookmark something long term, or if you have constantly updating data. My favorite pagination is infinite scroll, but when they update the URL. Because I find like a lot of infinite scroll, if you accidentally bump something, we're looking at the restoration hardware website with my wife they have I don't know probably 80 different Items in their um sideboards category side tables and sideboards and we were scrolling for like probably 10 minutes and I clicked something by accident and it was over it that was it I screwed it up and I had to go back and I spent like three minutes trying to get to the fricking bottom of the thing and it just kept loading more in. And what they should have done there is that every single time that you load a new page or you pass a new piece of content, you should just update the URL with push state so that if somebody Then refreshes that page, you go back to where you were in that specific. That was a problem with Pinterest as well. It's less of a problem with like discovery things where you're just like, I don't know, this feed is different every single time that I refresh it. ([Time 0:13:03](https://share.snipd.com/snip/70978d7f-0323-408e-800b-7131534d1539))
- **Use AI To Learn, Not To Replace Learning**
- Use AI to research, explain, and break down concepts while you learn.
- Avoid letting AI be a crutch; practice solving problems yourself to build mental models.
Transcript:
Wes Bos
Much would you use AI like cloud code if you were learning to code today? I am learning to code, having completed the web development bootcamp, JS, CSS, and HMO, and I have a basic level of Python. I am debating how much I should be using AI to help program in a paralysis analysis situation. Should I fully embrace AI and be prompting with cloud code to develop projects, or do I just like put that aside and simply learn it myself? This, I honestly have changed my opinion on this many times over the years, right? Because there's something to be said for like, no, don't touch it. Like learn the fundamentals first and then like suffer through that. And then you can use it. But the reality of a lot of that is that everybody else is using it and you are probably going to get like left behind in a lot of these things. But if you simply are just boop, boop, boop into the box and hoping the answer comes out and not actually learning anything and not actually solving any problems, you're not going to Make it. Right. Because are much smarter people there are much more experienced people in this industry that will be able to do that as well and they're smart and they can they can solve problems right Yeah so like should you use it i think you should use it to help you to research to find problems to understand features i use ai all of the time to sort of supercharge my learning and understanding Of areas that I do not quite understand, right? Like you are a problem solver. And part of that problem solver is understanding the code base, understanding what errors might be, understanding how these pieces work together. And AI can really help you with that, right? Like, yes, it can write the code for you as well. But like one huge thing is that it can help you figure out how to solve a problem and how to do that research very productively and not get like, not get hung up on these just obtuse problems. Like we used to spend days. I used to sometimes have bugs that would give me days and days of problems where like now it's just, oh, what do you think this could be? How do these things interact? You know, like help me debug this, add some logging into here. It's just so much faster to be able to do those things. So you have to, as a web developer getting into this industry you have to figure out how to solve problems how how to become smart in this and this is a tool that you're going to use how to Do this if you use it simply as a crutch like it almost comes back to this like like a calculator and like learning math you know like my kids are are learning multiplication and division Right now and it's like yes of course you can just bo boop, boop those numbers into the calculator.
Scott Tolinski
Yeah, right.
Wes Bos
It's it out. But like you kind of do need to understand how this stuff works and why it is working. Not because you're going to need to do long division one day without a calculator. You have one in your pocket. But because the way that you think and solve problems with that in your head, that's such a such a crucial skill for life. So that's that's my thoughts there. Oh, yeah. I have some more more examples here. But you go ahead, Scott. I've been.
Scott Tolinski
Your brain needs to work through concepts for you to be able to even know like what the problems are, what the solutions are, what the general flow is of things. Me is taking things that are difficult for my brain to really parse and break it down into ways that I can learn more better. So like, for instance, one of the things I really like diagrams for stuff, I really like bulleted lists, I really like technical explanations and code. What I don't like is big paragraphs of text. Again, I talk about dyslexia on this show all the time. But when I see a big paragraph of text, I lose my place in it, I retain nothing. And another big problem is that a lot of developers are not good at technical writing in a way that makes things approachable. They're either too close to the problem or they're too nerdy to even really understand what the average person is going to think about while they're like trying to learn a tech. Like people who are knee deep into difficult technical problems are oftentimes going to give explanations of how things work in a way that makes sense to them. And because they're so much smarter than most people, it's not going to land. So I really use AI to distill not to be like go into the AI and be like, tell me about this. But to give the AI someone else's documentation that I'm having a hard time parsing and saying, break this down into bulleted lists, create diagrams for me, create like ASCII diagrams Of how this thing actually works, what connects, what are the major technical pieces here? What are the things and how do they speak to each other? Like those types of questions that you can ask to the AI, when you're presenting it with actual documentation for it to get its information from and it's not like going to be hallucinating, You still have to like validate these things. But like, if you just ask an AI, like, how does this thing work, it will often just tell you even if it doesn't have the information in front of you. But if you present it with hard documentation and say, read through this documentation and distill it into diagrams, give me bulleted lists, technical explanations, blah, blah, Blah. To me, that's how I personally use it. And then that way I'm reading, I'm consuming, my brain is doing work, not just fix a problem for me, whatever. Because you do need to know how this stuff works. Today, you still need to know how this stuff works. ([Time 0:18:20](https://share.snipd.com/snip/0d4b3bdd-b891-4025-b354-ed3c5c8cf5d8))
- **Pixel Diffing And Team Problem Solving**
- Wes describes iterating on visual-diff algorithms for Sinhacks with AI-assisted research.
- The team then paired and designed a final scoring approach that improved results significantly.
Transcript:
Wes Bos
Example in the Sinhacks platform that we just made on. So part of the platform is taking a target and taking what somebody had coded in and comparing them. We we export them to a png and then you you basically diff them and figure out what the score is and one of the problems we've had in the past is like slight variations in it could like like A box shadow that's 10 pixels more than it should be or a color that is slightly off those things can just throw it off and it's just like kind of unfair because like you clearly got it but It wasn't it just wasn't wasn't great right so like I started that like okay we need to build like an algorithm to compare these two things so I asked like look what are ways to compare things Right and we figured out like there's actual pixel diffing just straight up is this pixel red and is the other one red? If so, then you got it. If not, you didn't. Then there was also this structural similarity index measure. And then there was also like weighting the pixels a little bit differently and figuring out like if the pixels are up and down. But like so I researched that with AI and I figured, OK, these are a couple of different ways. So I said, all right, let's let it rip. Give me an example in each of them. And we can, I was able to test them all fairly quickly. And then we realized like, okay, like the structural similarity doesn't work in a lot of cases, right? There's so many little edge cases. So we threw that out the actual, like straight up pixel diffing, not very good. And then the actual like weighted comparison algorithm it made, it wasn't very good either at all right so like but but that wasn't a waste that was really quick research that I did and It was able to scaffold it out then I we did a whole bunch of work or our I did a whole bunch of work on figuring out different weights and and how to weight different types of pixels and if There's transparency we did a little bit less and we got it to a pretty good spot and then we all tested it and then we found like some major flaw where like if you set the background image It would bring you to like 98 percent or like yeah or background color we're like no i've spent so much time on just like trying to figure out what a good solution for this wasn't like of Course i asked the ai and it it just kept spitting out these just garbage solutions there yeah then the actual fix was just like, like Scott, CJ and I, we just like talked about it for like Probably half an hour. And we're like, can we scale up the score, maybe figure out what the score is with the background? And then but like that, like half an hour of actually problem solving and looking at it and figuring out, like, why is it causing this? What are our possible options? And then finally, we had this idea. We'll talk about the actual solution in another episode. But the actual solution that we came up with, then we just typed that solution into the box, and it was able to actually generate the code for you. And it works awesome now. ([Time 0:24:33](https://share.snipd.com/snip/f798a5dc-a6fd-4fa3-b8f9-92e5c741235d))
- **AI Use Raises Security And Responsibility Needs**
- Using AI without understanding systems increases security and correctness risks.
- Developers must know where data flows to avoid exposing secrets or sensitive inputs.
Transcript:
Scott Tolinski
Yeah i do think that is it you you should be like using it to help you save time not to just do things for you i mean primogen said it really well like it's making you dumb if you're just letting It push all the buttons for you yeah and especially if you're first starting man yeah it is crazy i keep going back to that tweet about people being lazy now that they have access to ai because Like that really like with this clodbot stuff man people would rather hot potato all of their data through discord servers through other people's servers when like you could just tell The ai to write you a chat and have it available with tail scale or whatever and people are just like i just want it in my uh discord because that's easy like okay but now you're you're just Sending your like these same people are the same people who don't understand that whatever personal data they're plugging or API keys or whatever are not just going now to Anthropic And OpenAI servers. They're now going and saving permanently on Discord servers and going through, just increasing your attack vectors. It's increasing your insecurity. Like, you got to know how this stuff works you gotta use your brain people and i think that's becoming such a major problem just yeah there's so many there's so many instances of yeah if
Wes Bos
You are a developer thinking that i find this stuff so hard to talk about because i'm so bullish on it but i also like i think so many of these people are like wrong about it. You know, if you think that you're a developer and that it's just going to do absolutely everything for you, it certainly is doing a lot more for you. And it's certainly affecting the job landscape and everything in web development. ([Time 0:27:31](https://share.snipd.com/snip/539fb551-9af8-431e-bdca-7231c2b1ce5b))
- **Attempted XSS In Potluck Submission**
- Someone submitted an XSS payload in the potluck form to exfiltrate document.cookie via fetch.
- Wes explains frameworks' escaping and the danger of dangerouslySetInnerHTML executing such scripts.
Transcript:
Wes Bos
I thought this was kind of interesting. We'll put the thing up on the video, but I'll explain it as well. When people submit potlet questions, you can type whatever you want in the box. And somebody wrote closing text area, open script tag, fetch webhook.site forward slash some URL, and then encode URI component document.cookie. So what they were trying to do here is they were hoping that we were pulling in this user input and simply just setting it as HTML. And this used to be a much more prevalent thing where frameworks didn't take care of it for you. Meaning that like if you are displaying some text from a user and inputting it as HTML, if somebody were to type HTML into that box, they could possibly run JavaScript code on your browser. Right? And what this one was trying to do was to try to run a script tag that when loaded runs a fetch request, takes the entire document cookies, not server-side cookies, just simply client-side Cookies that you can access with JavaScript, and then send them over to this random website, which it seems like it's been taken down already, probably was some sort of bot. But that was kind of interesting. And if we were to ever build something, and like we've done this in React, we have something called dangerously set inner HTML. That's exactly why it's called dangerously set inner HTML, because if you were to take this comment and dangerously use it as HTML, instead of just dump it into like a React component, Then it would execute the JavaScript and run that fetch and you would be out of luck. So kind of interesting one. You don't see XSS too often because like all of the frameworks make it very hard to actually XSS yourself. But it's still doable, especially with like a lot of these AI agents where they are returning markdown. If you're not properly sanitizing that markdown, that could have like a script tag in it. ([Time 0:36:02](https://share.snipd.com/snip/8f144a65-b519-43ed-a5e1-cddb835fece2))
- **Reskill With Targeted Side Projects**
- Build side projects using current stacks employers hire for to reskill quickly.
- Target popular combos like React + Prisma + Tailwind and demonstrate real projects.
Transcript:
Wes Bos
Says hey guys I've been working as a front end dev small software house for about five years. I'm looking to move to a larger company. I'm finding it difficult given my background. I'm overqualified for junior roles, but due to the tech stack PHP and jQuery, I don't fully meet expectation for mid-level positions in bigger companies. How would you approaching the situation? I feel like we've talked about this 7,000 times on this podcast is that you are a problem solver and your tools are out of date, all right? Obviously, people still use PHP, but like that stack of PHP and jQuery is very old by now, right? Like we are many, like React is what? Like 12, 15 years old by now? Your tech stack is out of date and you need to skill up and very quickly on modern tech stacks because that is a, like you probably have several decades old of, like you probably missed Two or three waves. You know, you missed GraphQL. What else did you miss? You know, we're on local first now. So I would probably use that. You got to build a side project. You got to scale up. You got to get better at this things. You got to build something. And if you can't do it at work, you got to go and build a couple little side projects so you can scale up and understand how these things work. Right. Like I would probably do a good balance of keyword stuffing because like this is don't choose i'm curious what scott thinks as well but like if you are going to build a side project you Kind of have to aim it at what do employers want um and not necessarily just what you personally want to use and i think today that would probably be react drizzle or Prisma using vanilla And Tailwind. Yeah, see this, but like the thing is that Prisma is, even if you don't like Prisma, it's absolutely huge and used in so many massive companies right now. And that's a very hireable skill. Zod is really popular. And then like you have to skill up on using AI APIs. So integrating these AI LLMs into products, as well as using LLM AI coding tools to build your things. I think if you were to get good at all of those things, you'd probably be ready for applying to these mid-level jobs. ([Time 0:42:00](https://share.snipd.com/snip/ee87e8f3-bd1a-4a39-aa5b-40c7114d6c7b))
- **Find Time By Focusing And Using Dead Time**
- Schedule bite-sized learning and pick one thing to master before moving on.
- Use dead time for asynchronous learning like podcasts and short articles.
Transcript:
Scott Tolinski
I've been following you and heard that you all have kids, jobs and a lot of side projects. I am in a similar boat, but I have no idea how to make a time to truly dive deep on a side project or learn how to set up hardware, etc. How are you able to balance your time between family, work and extracurriculars, so to speak? The biggest thing for both of us, I would say is that a big part of our jobs is to explore and to learn and to teach. And you don't do that without getting deep into side projects as a part of my job. So while I am maintaining code bases, and I am working on things long term and managing the syntax team and that kind of stuff that does take up time, but I would say in obviously recording The podcast, I would say it's still a good 50% of my time is spent exploring and diving into topics and getting to work on side projects as a part of my actual job. So the things outside of that, though, oftentimes now are like diving more into like, what are things that I can do with my kids, like my 3d printing stuff was entirely like a project to Do with my kids from the start, to the point where both of our kids can load and unload the 3D printer. They can do things with it. They can choose what they want to print. They can explore ideas on it and those types of things. Coding side projects oftentimes are like the things I actually get into that aren't work related are things that are making my day-to life process better. Like for instance, a thing I just built that was going to be very useful to my wife and I is we're going on a big trip this year to celebrate our 40th birthdays. And I was like, you know, what'd be really cool would be like a trip hub where every single day of the trip has the itinerary, it would have on maps, all the locations. And then if you select a day, it would have all the addresses and phone numbers of anything you're doing that day, it would have budgeting built in. So you could see how much the entire triple cost, I could use AI to estimate costs of dinners and stuff like that, like point it to the restaurants and say, hey, estimate me a cost of dinner For all these restaurants. And it's like that is an app that my wife can get behind because it is taking the things that I'm bad at, which is planning and augmenting them so I can help her plan better and therefore Is an a useful use of my time that's not just me wasting time on my computer when I'm outside of work.
Wes Bos
People ask me this all the time and I would say my like biggest frustration in life is simply just not having enough time to do all the things that I want to do and probably everybody has That but I don know, some tips that I do have is I like to start an idea, dive in, master it and finish it. Right. Like I'm not into 10,000 things at once. I'm simply just like, I want to learn this, dive in, I figure it out, I move on and I move on to the next thing where I've done that with electronics, small engines, 3D printing, home reno, Cooking, like so many different things. And then I just feel like I have a very good, like I still do lots of 3D printing, but I'm not like, I'm not learning the 3D modeling software for hours on end. Like I know how to use it now and I'm pretty good at it. ([Time 0:45:44](https://share.snipd.com/snip/46aa1e73-8972-44bd-af9a-aec9086515fb))
- **Coding In Line With Tailscale**
- Scott admits he was coding and prompting AI while standing in a long pharmacy line.
- He uses Tailscale and code-server to do quick work from his phone.
Transcript:
Scott Tolinski
Interrupt here with something that I did yesterday that I'm not super proud of there was a long line at the pharmacy at Target, like, like 15 people. And since setting up my tail scale network, I have open code serve running. I was vibe coding in line at the pharmacy. Instead of just like existing there, I was like prompting AI agents to work on something stupid and i'm just thinking to myself like i can't shut this off right now why can't i shut this Off that that's a problem i ([Time 0:50:15](https://share.snipd.com/snip/14facdb1-fb79-451e-aad6-9536606347a4))
- **Choose Models By Task, Not Hype**
- Local small models suit narrow tasks better than general chat.
- For RAG chat over CV/LinkedIn data you likely need a larger model or richer retrieval context.
Transcript:
Wes Bos
This is a JavaScript library that will allow you to load in LLM models generally from Hugging Face. It's built by Hugging Face. And you can just run them in JavaScript, whether that's in the browser or in Node.js. I'm working on a personal dev site. The idea is to use a small in-browser model, feed it my CV and LinkedIn data, and then build a chat GPT style rag search that can answer questions about my work history, mostly in a fun way To learn rag and LLMs and something genuinely useful for recruiters and potential clients. I've had a very rough working version. I've embedded my CV data into JSON and passed relevant chunks to the model from console logs. It does seem to retrieve the right context, but the responses come back as, I don't know or say there's no context. I can't tell if this is a prompting issue, a limitation of smaller models, or I need a larger model with better reasoning. So this is kind of interesting. So RAG, what that means is that you take something, like we use RAG on, we don't actually have it on the syntax site right now, but I've used it with the syntax transcripts, where you take Like what's called an utterance, like two or three sentences that somebody has said, and then you vectorize that. You store in a vector DB, and that vector is just a representation of what you said in numbers. And then it's mapped in like a thousand different dimensions. And then you can use vector search to find things that are similar to that, right? So I could search for like, like react pitfalls. And then it would bring up all the utterances where we talked about things that are similar to that without actually having to like say the words react pitfalls. So what he's done here is he's vectorized his whole LinkedIn and cover letter and all that stuff. And then what you do is before you run the LLM chat, you do a vector search based on what the user has asked. And then you put those retrievals. It's called retrieval augmented generation. You put those things that you found in the prompt, and then you ask the question given this data and it'll spit out an answer for you. Right. So he's having a problem where it's like, yeah, it gets the right context, but it's not doing it. So like your rag might not be picking up the right bits. So when I was doing the transcript utterances, sometimes it would find the actual utterance that I wanted, but it was missing context from like maybe what was said before or after. So I modified it. So like, yeah, you can get the one utterance, but maybe pull the last two before it and the other two after it and then use that as as context. If you are 100% sure that you're getting all the right context, then yeah, the model is probably just not good enough. I don't find that Transformers JS in local models is very good for simply just straight up chat where Transformers JS in smaller local models make more sense is that models that do a very Specific thing, depth detection, face segmentation, object detection, toxicity detection, text to speech, translation, things that are tuned and trained exactly to do one thing Well, and not, I find it not as good as like these like just massive LLMs that you can give it text and it will return it to you. So yeah, get a bigger model. ([Time 0:52:49](https://share.snipd.com/snip/db31a634-2ac2-419f-9da7-1f29c2c80389))