Your LLM Powered Financial Analyst

LARRUZ demos SCC Insight, an open-source tool that uses Llama Index to search SEC filings for companies like Amazon and Tesla. Ask it questions about revenue or risk factors and get answers with links to the exact source documents. Built with React, FastAPI, and OpenAI.
Chapters
If you want to learn about a company's financial situation, one of the best place is to start from their annual financial statements such as 10k forms. These form holds a lot of information regarding the company's financial situation, where they're spending and making money, what are different types of risks. But these financial statements are not a fun read. That's why you can really use the power of LLMs to derive insights from these complex documents. Recently I have started looking at LLAMA Index. They actually have a very interesting open source project called SCC Insight that uses retrieval augmented generation capabilities of LLAMA Index to answer questions about SEC, 10K and 10Q documents. This project actually highlights the different capabilities of LLAMA Index and that's why I have been actually focusing on Llama Index more recently now using LLMs for financial documents is a very complex task because financial documents contains text, images and tables. It's a very hard problem to solve and I think that's why it's a perfect application for RAG pipelines. Here is the system architecture of the SCC Insight. It has a full front end as well as backend implementation. There is an S3 bucket for storing the PDF files as well as the vector store, but that is in a private bucket and it's making calls to OpenAI services as well as some other APIs for retrieving financial data. In this video I will give you a quick demo of the application on how it works, but in a later video I'll break it down and we will specifically focus on how the retrieval is done with a special focus on how the data is being read from tables. Okay, so they are hosting this application on a website called sccinsight AI. I'll put a link in the description of the video. So let's quickly look at how this works. So currently you cannot upload your own documents, but here is a list of companies that you can use. So for example we can select something like Tesla, then what type of form we want. So let's say we are looking at the annual report year. So it has data for last three years. So let's select 2022. We can add this and let's say another one is Nvidia, same annual report 2022 and add this as well and you can I think upload up to or select up to 10 different companies, but we're going to just select three different companies. So I think I included Amazon, Nvidia, Tesla, or maybe let's make it four, we're going to do Apple as well. All right, once you select your companies, then simply click on start your conversation. Okay, so you're going to be presented with something like this. On the right hand side you can actually see different 10k forms for different companies. And here are simple links to each one of them. Okay, so on the left hand side here are some pre populated questions for you. Or you can simply start typing your question in here. So let's use the pre populated question. So for example, here's one. Which company had the highest revenue? So now if we click on this. So basically it has to go to the revenue of each of these four companies and then figure out which company had the highest revenue. So let's simply ask this question. So we're going to hit enter. So it basically goes through the whole process. So if you look here, it's actually asking this question individually for each of the earning reports that we have provided, right? And it is getting an answer for each of the company individually. And then there is an agent which compare all of these together to give us the final answer. Now you can see based on the individual answers, it's able to deduce that Amazon has the highest revenue among the companies mentioned. Now this is a really great application of Rag. Let's ask it another question. So we're going to ask it what were different risk factors for each of the companies? And let's see if it can come up with an answer based on the annual reports that we have provided. Okay, so here's the answer that we got. It says the risk factor for each companies are as follows. So it lists risk factors for Amazon, Apple, Nvidia and then even for Tesla as well. Now the thing that I'm interested in is this progress section. So if you look at here, what it did was based on a question. It generated a subquery and then it queried the document. Let's say it generated a subquery for Amazon and then it basically queried the information from that specific document and it came up with the answer. Similarly, it did it for Apple, Nvidia and Tesla as well. Now one great feature that they have included is the answers are actually grounded in the documents. So for example, if you see here, these are the highlighted sections. So let's say if you click on this now here you can see which part or chunk of text from the original document was used to generate the answer. So this is very critical when you are creating answers based on documents provided. So this ensures that the answers are actually grounded in the context rather than the LLM is generating something from its own knowledge. Base. Here's another example. So in this case we are looking at the answer for Tesla and actually I wanted to see which portion of the document or like the annual report was used so you can come back here. And this is the part of the document that was used to generate the answer. Now for SAC Insight, the great thing is this whole thing in terms of both the front end as well as backend is open source so you can actually go to their GitHub repo and look at the code. Here's the tech stack that they're using. So the front is front end is based on react and tailwind CSS. In the back end you have a fast API. OpenAI is used for actually both the embedding as well as the LLM part, right? There's a vector store in there and everything is put together using Llama Index and for infrastructure they're using render.comvercel and AWS. Now if you are interested in learning more about Llama Index, I have an ongoing series on that so I'll put a link to the playlist. You can watch that and learn more about it. I'll be adding more videos to it. I'll highly recommend to check out the SCC Insight project and play around with it. I hope you found this video useful. If you did, consider liking the video and subscribe to the channel. Thanks for watching and as always, see you in the next one. Thanks.










