# Using AI Crew to Automate Fundamental Stock Analysis - Derek Cheung

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

- **Канал:** n8n
- **YouTube:** https://www.youtube.com/watch?v=ax_DwF0bw2g
- **Дата:** 08.04.2024
- **Длительность:** 9:23
- **Просмотры:** 4,061
- **Источник:** https://ekstraktznaniy.ru/video/15674

## Описание

During the n8n Community Hangout of March 2024, community member Derek Cheung showed us how he uses AI to run a fully automatic analysis on a company's financial SEC 10K data. Using AI Crew, he sets up two agents that first define the right questions to ask and then a second AI actually processes this data.

Links:

- Download this workflow: https://n8n.io/workflows/2183-ai-crew-to-automate-fundamental-stock-analysis-qanda-workflow/
- Full Community Hangout: https://www.youtube.com/watch?v=eZacuxrhCuo
- Sign up for future n8n Community Hangouts: https://lu.ma/u/n8n

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

### Intro []

this is really uh an investor Persona that is um that I'm going to show and I call it autonomous AI SEC 10K analysis so what first of all is an SEC 10K so for investors you know uh every company will have an annual report uh so this is uh a company that I invest in Nvidia uh so there's 169 pages of this PDF that really describes all their business and what they do um so this is really useful for uh value investors

### Use Case [0:35]

um and the use case I want to show is how to use entn as uh part of the investment process uh using uh also this idea of autonomous AI so uh the use case is to automatically analyze the SEC 10K to get a depth of insight of a company uh so what's really cool about this use casee is that we're actually going to use the AI to figure out even what the right questions to ask right so um as part of uh getting that insight and the approach that we're going to use

### Personas [1:10]

is kind of take two personas uh so one is um so so the mindset here is that think of it that you've got a virtual uh Team of of um uh crew members that uh perform different things so for example you have on your team a senior research analyst uh who uncovers insights into Nvidia and you also have a tech content strategy the person who then is able to articulate that information after the analyst is uh is um finish analyzing this s10k but here's the architecture here

### Architecture [1:47]

right so I'm uh it's somewhat similar to what uh Ole was showing earlier with respect to the vector store so um you know uh I'm using 0 uh to um and the Lang chain support to uh get this Vector store which I've populated it with um the SEC 10K information and then uh this is going to be uh used uh to kind of like um a web hook uh type of approach where my crew of AI agents will call into uh na10 and uh this will serve as uh a way to answer the questions right so uh I'll

### Results [2:32]

just give you ahead of time here's an example of the result that it generates just kind of give you a feeling on where we're going with this so this is actual output uh you know o was showing in his uh presentation you know you're trying to look at does the model actually produce good output right you know and the cloud models are really good but I'm using a actually for this one actually a much cheaper model right it's actually the mixt model uh that uh is actually 27 cents per million uh per million tokens right so it's very inexpensive uh model and look at the results that you can get right so all with sec1 K information you know you actually get this depth of reporting that as actually as an Nvidia investor I also learned something new uh from from working through this so let me show you first um uh the um my anti- workflow

### Workflow [3:38]

um let me show you my anti- workflow right so this workflow uh I mean it's not a very complicated workflow and it's uh um actually quite simple right so there's an up upserting part here where you chunk the data and put it in this case I'm using a uh Vector store a super based Vector store um and I was showing uh the a memory one um so this one will persist and so all I'm doing here is using a retrievable model I did something kind of cool there but I um I'll skip that for now uh but the idea here is that I used this for the Q& A for my SEC so I upload it I upload the SEC 10K information from here and then I now have this Q& A that I can do this so all right so here is then the thing that drives it so I am in this um uh I call it it's a riplet so uh this is python code very simple python code that uh I select what the model I'm using so this is very inexpensive uh very inexpensive model um and then I tell it you know here's the uh different personas different agents and the key thing here is the tools right so this is like I tell it here the SEC tools so I've specified the tool and this tool is a simple call to the webbook okay so I'm going to uh hook this up and have this uh senior research age agent uh call this uh when it needs to and then the tech content strategist uh they're going to uh summarize uh that information from the researcher and then here's the task right the first task is going to be done by the um by the researcher and they're going to conduct a comprehensive analysis and I've given it some starting points all right and what what's cool about this is that it gives some there's some starting points but the AI is able to kind of fill in the blanks in terms of like what questions to ask and so I've G on the right hand side is actually a result of the run so I I'll just run it right now just to show you uh what to expect okay so what this will do is I'll start up uh this uh this task here so I'm living a little bit dangerously I'm doing live demo uh recording maybe a better approach but okay so you can see here um that uh it's running right and and it's asking you know so the AI is actually figuring out what question to ask you know what are the primary business models of Nvidia right and then it's going to go and uh go to n10 and yeah so it's actually getting this response from the N workflow I can kind of show you that it's real right so see it's running right now and it's calling in it's calling it and you can actually see the answers from here right so it's actually getting that information from inen and the database and it will run through and uh so it it'll generate the different kinds of questions and uh you know kind of get the results based on on um you know doing the question answer and then summarize the report but you know it's really cool because it's uh you know generating this uh these questions and formulating uh getting the answers back from uh the vector store and then from there it's going to um it's going to put the answers back together so that's kind of the gist of this workflow and at the end of this it takes maybe like two or three minutes to run and um and you can see you know that uh you know it's uh what right so at the end it's going to produce something like this I mean there's a little bit of uh Randomness in terms of sometimes it just uh large larger context or larger output and sometimes uh less but um it's generally pretty good in terms of calling the U models and when calling the tools and whatnot but I guess what the other thing I wanted to quickly show is that one the cool things I really like about this use case uh with autonomous Ai and andent is that uh you can like the tools using connecting uh the uh the flows into the tools right the cruise into the tools is that you know it opens up uh all the sets of tools all the workflows that are and templates that are available in n10 and all these agents now would have access to all these different tools as they do different use cases right so I think it's super powerful right when you now have an agent that is uh souped up with all kinds of tools that are powered by end to end um so anyway that that's a short uh summary of the use case an example
