# Day 2: GitHub Profile #AI Analyzer [Update #02]

## Метаданные

- **Канал:** n8n
- **YouTube:** https://www.youtube.com/watch?v=n8MxjRtaXeQ
- **Дата:** 03.09.2024
- **Длительность:** 10:13
- **Просмотры:** 1,887
- **Источник:** https://ekstraktznaniy.ru/video/15619

## Описание

In day #02 of Max's 30 Day AI Sprint 👇

0:14 - Day 02 Recap

01:33  Building backend flow for "GitHub profile analyzer" 
Project in notion: https://bit.ly/profileanalyzer

Build along with me! Get a 2 week free trial of n8n then 50% off 12 months with coupon MAX50: https://n8n.partnerlinks.io/buildwithmax or self-host n8n for free: https://docs.n8n.io/hosting/

#buildinpublic #automation #ai #claude3

## Транскрипт

### Day 02 Recap [0:14]

Germany what did I get done today so I was mostly focused on the backend workflow for the GitHub profile analyzer for the results page so successfully using GitHub API to fetch Repose and profile information it's ingesting that into a AI chain which is outputting structured data we're using nnn's structured output data which means it comes out in a predictable jacent object which I then transform a little bit and can send back to we web in a structured way now in we web I've got that populating the results page so it still doesn't look very good that's going to be the one of the last things that I do I may take a stab at it tonight but let's see bit of a cheeky night session so the next thing need to do tomorrow is add a few more sections to the GitHub results page we only have a roast topics which I intend to do as tags and a profile description so we'll get a couple more of those we'll make it look fancy that's going to be Wednesday we're working on that and I'm going to plan for Friday release for that because we've also got the AI newsletter that ideally I work on as well I'm going to prioritize getting the GitHub profile analyzer out because could have people using it interacting with it and then go back to the newsletter what you're going to see next is a stitch together throughout the

### Building backend flow for "GitHub profile analyzer" [1:33]

day here's the nadn workflow that's going to populate the GitHub profile analysis results page it's triggered by we web here and I'm using the pin data feature once I've gotten a payload from we web which is great because I can click the edit button here and change something for example the profile handle that I'm checking if I need a different case to test my workflow up here we're using an HTP request route and the GitHub API to fetch a user we got to update that so it dynamically fetches this user great and so if I run this we see it's outputting information on the user what I do next is I have an edit Fields node where it creates some new key values uh for the item to clean it up because we want uh just the relevant information to pipe into my AIS for summarizing that sort of thing we do the same thing for getting the last 40 St reposts what happens is NN outputs this as NN item so we have an array of objects in here each one of these is a repo I then again strip that down same reason so we run this we for each one we've got a smaller item and then I aggregate that so that we have one Ed end item so it's a Repose array of 40 items and now what I'm testing is to summarize that so we have nice concise text to pipe into a classification AI step and what I'm testing now is whether it's better to pipe in 40 items that get summarized and then aggregate those after the step or to aggregate first and then into the AI step a few moments later I'm trying to decide whether I want to First aggregate my items of repose and then summarize or just Summarize each item individually and then aggregate later so what I did is I have one version of that I duplicated that and then from here I just connected two output branches that's sending the same data I added in this limit node um which is very simple I can just add how many items to limit so 40 items coming in only five coming out and then both of these ran and what I can do is in here I can see that this took 2,600 milliseconds or 2. 6 seconds and in here I can see that this took almost half that time so now I can compare the ODS to see which one I want to go for but it's a really nice quick way to Benchmark this is a great example how I can use NN quickly not some other dedicated tool to quickly compare those different options available to me I could do the same with different models right duplicate the out couple run against three different models and you know quickly inspect and see which one's the best model in terms of efficiency but then also qualitatively compare the different answers more moments later there were a few snafus in getting sort of structured output data and one of the cruxs of that was I was getting confused why there's an output parent object wrapping my expected output so what I'm doing here I have a basic llm chain and in most of these Ed end chain noes that we have we can require specific output which adds this output Passa Branch here and with the output Passa there's a few different ones I can use like the structured out the Passa that's what I'm using here and what that does is I can either just specify the example of how I'd like it to look the output from the node or use Jason schema which you can Define data types and whatnot but even with just doing a example I've got some context in the answers outputed here and that does help I was testing if I just provide lauram ipsum versus something like a real value I do recommend real values and so what we have so far is we are aggregating prior to uh outputting that is far than running 50 separate calls and there was no benefit really to that I could see I'm using anthropic model for now we can test that with open AI as well later one thing I love about nadn is you know I was trying a few different things this still in my workflow here I haven't pushed off to the side obviously we'll clean it up but it feels like got more my Lego set up anyways in the prompt itself we can see I'm saying return the following insights based on the GitHub repos that I follow each one of these here links up to each one of these in here and I was rather surprised that it's working really nicely and I run it you know a bunch of times and it's giving me expected response um and then in the system message what I'm experimenting with now I was doing a version of this in the in chbt uh specifically I use chbt to uh generate an example of the roast in um my output so I have a good again relevant example that work great I had done some prompting in here like you are hilarious comic you have a background software engineering you understand things like hack and us and Reddit humor so I'm now in this LM chain experimenting with these chat messages where you can add system messages user messages AI messages to um get a better response I'm not an expert on the system messages so I'm just popping this in here and see if it improves result it seems to right now but this is something I might come back to as we're optimizing perhaps post launch and understand how we can optimize this even further but so far I've got topics which we can sort of have some outut to tags projects I like to follow this could be the base of one of the cards that we generate in results and the user roast so what I do next is we've got the user profile because this information is only coming from the repos they follow which I think is a great data source but I'm also now going to add a merge node and what the merge node will do is we'll combine this is the user profile details we'll combine with the repos they follow and in the merge node what's nice is we could add more inputs so if we get a third data stream we can combine that all pipe it into here so as the project evolves we can add even more data sources and then it'll sort of list in here we might need to update how we paste it in basically into this node but then we have a strategy for getting multiple of these different data into this LM chain to see if we get some better results a few minutes later now we have the user profile data and the repo data being merged together in the merge node so we're doing a combined operation and doing it by position because we each just have one item coming in and we just want one item coming out with the profile information and then the repost array that we made I was also in testing this it was working fine with 40 items 40 repost so I've increased that to the 50 latest repost just as it seem we haven't hit any context limits yet and then in the Lim chain step itself we have in the system message we've also added a little bit of guidance um on the specific output on how we'd like to have it a little bit better modified a little bit I was referencing the Alpa key name that I'm using in my structured alasa anthropic at least did seem to listen to that and improve the result there I'm using Corde 3. 5 uh for this and yeah so we have a everything being outputed here and so the next step in the respond to webook node we respond with Jason because we just want to construct the response to send back to Wei web and in the response body it's rather simple we have the topics the project summary and the profile roast or being outputed here everything was dragg and dropped for the topic specifically what I had to do I'll redo it quickly here is I drag and drop the parent um array and then in here we don't have in the right structure so we can period it opens autoc complete and we can use the 2 Json string function here which then gets in the right format so now I'm going to in we web hook up the results page to show these three bits of information and once that's working come back and for the rest of the day see how much more information we can add in here and leave probably we styling either to a sneaky session tonight or 4 to tomorrow morning so that's a wrap for day two I'll see you tomorrow for day three of the 30-day AI Sprint
