{"id":131532,"date":"2025-03-13T21:21:08","date_gmt":"2025-03-13T21:21:08","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/building-a-financial-report-retrieval-system\/"},"modified":"2025-03-13T21:21:08","modified_gmt":"2025-03-13T21:21:08","slug":"building-a-financial-report-retrieval-system","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=131532","title":{"rendered":"Building a Financial Report Retrieval System"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>Financial reports are critical for assessing a company\u2019s health. They span hundreds of pages, making it difficult to extract specific insights efficiently. Analysts and investors spend hours sifting through balance sheets, income statements and footnotes just to answer simple questions such as \u2013 <em>What was the company\u2019s revenue in 2024?<\/em> With recent advancements in <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/03\/an-introduction-to-large-language-models-llms\/\" target=\"_blank\" rel=\"noreferrer noopener\">LLM <\/a>models and vector search technologies, we can automate financial report analysis using <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/10\/rag-pipeline-with-the-llama-index\/\" target=\"_blank\" rel=\"noreferrer noopener\">LlamaIndex<\/a> and related frameworks. This blog post explores how we can use LlamaIndex, ChromaDB, <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/12\/gemini-2-0\/\" target=\"_blank\" rel=\"noreferrer noopener\">Gemini2.0<\/a>, and Ollama to build a robust financial <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/09\/retrieval-augmented-generation-rag-in-ai\/\" target=\"_blank\" rel=\"noreferrer noopener\">RAG <\/a>system that answers queries from lengthy reports with precision.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-learning-objectives\">Learning Objectives<\/h3>\n<ul class=\"wp-block-list\">\n<li>Understand the need for financial report retrieval systems for efficient analysis.<\/li>\n<li>Learn how to preprocess and vectorize financial reports using LlamaIndex.<\/li>\n<li>Explore ChromaDB for building a robust vector database for document retrieval.<\/li>\n<li>Implement query engines using Gemini 2.0 and Llama 3.2 for financial <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/04\/what-is-data-analytics\/\" target=\"_blank\" rel=\"noreferrer noopener\">data analysis<\/a>.<\/li>\n<li>Discover advanced query routing techniques using LlamaIndex for enhanced insights.<\/li>\n<\/ul>\n<p><em><strong>This article was published as a part of the\u00a0<\/strong><\/em><a href=\"https:\/\/www.analyticsvidhya.com\/datahack\/blogathon\" target=\"_blank\" rel=\"noreferrer noopener\"><em><strong>Data Science Blogathon.<\/strong><\/em><\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-why-do-we-need-a-financial-report-retrieval-system\">Why do we need a Financial Report Retrieval System?<\/h2>\n<p>Financial reports contain critical insights about a company\u2019s performance, including revenue, expenses, liabilities, and profitability. However, these reports are huge, lengthy, and full of technical jargon, making it extremely time consuming for analysts, investors, and executives to extract relevant information manually.<\/p>\n<p>A financial Report Retrieval System can automate this process by enabling natural language queries. Instead of searching through PDFs, users can simply ask questions like, \u201c<em>What was the revenue in 2023?<\/em>\u201d or \u201c<em>Summarize the liquidity concerns for 2023.<\/em>\u201d The system quickly retrieves and summarizes relevant sections, saving hours of manual effort.\u00a0<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-project-implementation\">Project Implementation<\/h2>\n<p>For project implementation we need to first set up the environment and install the required libraries:<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-1-setting-up-the-environment\">Step 1: Setting Up the Environment<\/h3>\n<p>We will start by creating and conda env for our development work.<\/p>\n<pre class=\"wp-block-code\"><code>$conda create --name finrag python=3.12\n\n$conda activate finrag<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-step-2-install-essential-python-libraries\">Step 2: Install essential Python libraries<\/h3>\n<p>Installing libraires is the crucial step for any project implementation:<\/p>\n<pre class=\"wp-block-code\"><code>$pip install llama-index llama-index-vector-stores-chroma chromadb\n$pip install llama-index-llms-gemini llama-index-llms-ollama\n$pip install llama-index-embeddings-gemini llama-index-embeddings-ollama\n$pip install python-dotenv nest-asyncio pypdf<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-step-3-creating-project-directory\">Step 3: Creating Project Directory<\/h3>\n<p>Now create a project directory and create a file named .env and on that file put all your API keys for secure API key management.<\/p>\n<pre class=\"wp-block-code\"><code># on .env file\n\nGOOGLE_API_KEY=\"<your-api-key>\"<\/your-api-key><\/code><\/pre>\n<p>We load the environment variable from that .env file to store the sensitive API key securely. This ensures that our Gemini API or Google API remains protected.<\/p>\n<p>We will do our project using Jupyter Notebook.<br \/>Create a Jupyter Notebook file and start implementing step by step.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-step-4-loading-api-key\">Step 4: Loading API key<\/h3>\n<p>Now we will load the API key below:<\/p>\n<pre class=\"wp-block-code\"><code>import os\nfrom dotenv import load_dotenv\n\nload_dotenv()\n\nGEMINI_API_KEY = os.getenv(\"GOOGLE_API_KEY\")\n\n# Only to check .env is accessing properly or not.\n# print(f\"GEMINI_API_KEY: {GEMINI_API_KEY}\")<\/code><\/pre>\n<p>Now, our enviroment ready so we can go to the next most important phase.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-documents-processing-with-llamaindex\">Documents Processing with Llamaindex<\/h2>\n<p>Collecting Motorsport Games Inc. financial report from AnnualReports website.<\/p>\n<p>Download Link <a href=\"https:\/\/www.annualreports.com\/Company\/motorsport-games-inc\" target=\"_blank\" rel=\"nofollow noopener\">here<\/a>.<\/p>\n<p>First page looks like:<\/p>\n<p>This reports have a total of 123 pages, but I just take the financial statements of the reports and create a new PDF for our project.<\/p>\n<p>How I do it? It is very easy with PyPDF libraries.<\/p>\n<pre class=\"wp-block-code\"><code>from pypdf import PdfReader\nfrom pypdf import PdfWriter\n\nreader = PdfReader(\"NASDAQ_MSGM_2023.pdf\")\nwriter = PdfWriter()\n\n# page 66 to 104 have financial statements.\npage_to_extract = range(66, 104)\n\nfor page_num in page_to_extract:\n    writer.add_page(reader.pages[page_num])\n\n\noutput_pdf = \"Motorsport_Games_Financial_report.pdf\"\nwith open(output_pdf, \"wb\") as outfile:\n    writer.write(output_pdf)\n\nprint(f\"New PDF created: {output_pdf}\")<\/code><\/pre>\n<p>The new report file has only 38 pages, which will help us to embed the document quickly.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-loading-and-splitting-financial-reports\">Loading and Splitting Financial Reports<\/h3>\n<p>In your project data directory, put your newly created\u00a0Motorsport_Games_Financial_report.pdf file, which will be indexed for the project.<\/p>\n<p>Financial reports are typically in PDF format, containing extensive tabular data, footnotes, and legal statements. We use LlamaIndex\u2019s SimpleDirectoryReader to load these documents and convert them to documents.<\/p>\n<pre class=\"wp-block-code\"><code>from llama_index.core import SimpleDirectoryReader\n\ndocuments = SimpleDirectoryReader(\".\/data\").load_data()<\/code><\/pre>\n<p>Since reports are very large to process as a single documents, we slit them into smaller chunk or nodes. Each chunk corresponds to a page or section, it helps retrieval more efficiently.<\/p>\n<pre class=\"wp-block-code\"><code>from copy import deepcopy\nfrom llama_index.core.schema import TextNode\n\ndef get_page_nodes(docs, separator=\"\\n---\\n\"):\n    \"\"\"Split each document into page node, by separator.\"\"\"\n    nodes = []\n    for doc in docs:\n        doc_chunks = doc.text.split(separator)\n        for doc_chunk in doc_chunks:\n            node = TextNode(\n                text=doc_chunk,\n                metadata=deepcopy(doc.metadata),\n            )\n            nodes.append(node)\n\n    return nodes<\/code><\/pre>\n<p>To understand the process of the document ingestion see below diagram.<\/p>\n<figure class=\"wp-block-image size-full is-resized figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"815\" height=\"2560\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/document-ingestion-flow-scaled.webp\" alt=\"document-ingestion-flow\" class=\"wp-image-225679\" style=\"width:137px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/document-ingestion-flow-scaled.webp 815w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/document-ingestion-flow-917x2880.webp 917w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/document-ingestion-flow-768x2411.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/document-ingestion-flow-489x1536.webp 489w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/document-ingestion-flow-652x2048.webp 652w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/document-ingestion-flow-150x471.webp 150w\" sizes=\"auto, (max-width: 815px) 100vw, 815px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<p>Now our financial data is ready for vectorizing and storing for retrieval.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-building-the-vector-database-with-chromadb\">Building the Vector Database with ChromaDB<\/h2>\n<p>We will use ChromaDB for fast, accurate, and local vector database. Our embedded representation of financial text will be stored into ChromaDB.<\/p>\n<p>We initialize the vector database and configure Nomic-embed-text model using Ollama for local embedding generation.<\/p>\n<pre class=\"wp-block-code\"><code>import chromadb\nfrom llama_index.llms.gemini import Gemini\nfrom llama_index.embeddings.ollama import OllamaEmbedding\nfrom llama_index.vector_stores.chroma import ChromaVectorStore\nfrom llama_index.core import Settings\n\nembed_model = OllamaEmbedding(model_name=\"nomic-embed-text\")\n\nchroma_client = chromadb.PersistentClient(path=\".\/chroma_db\")\nchroma_collection = chroma_client.get_or_create_collection(\"financial_collection\")\n\nvector_store = ChromaVectorStore(chroma_collection=chroma_collection)<\/code><\/pre>\n<p>Finally, we create a Vector Index using LLamaIndex\u2019s VectorStoreIndex. This index links our vector database to LlamaIndex\u2019s query engine.<\/p>\n<pre class=\"wp-block-code\"><code>from llama_index.core import VectorStoreIndex, StorageContext\n\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\nvector_index = VectorStoreIndex.from_documents(documents=documents, storage_context=storage_context, embed_model=embed_model)<\/code><\/pre>\n<p>The above code will create the Vector Index using nomic-embed-text from financial text documents. It will take time, depending on your local system specification.<\/p>\n<p>When your indexing is done, then you can use the code for reuse that is embedded when necessary without re-indexing again.<\/p>\n<pre class=\"wp-block-code\"><code>vector_index = VectorStoreIndex.from_vector_store(\n    vector_store=vector_store, embed_model=embed_model\n)<\/code><\/pre>\n<p>This will allow you use chromadb embedding file from the storage.<\/p>\n<p>Now our heavy loading was done, time for query the report and relax.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-query-financial-data-with-gemini-2-0\">Query Financial Data with Gemini 2.0<\/h2>\n<p>Once our financial data is indexed, we can ask natural language questions and receive accurate answers. For querying we will use Gemini-2.0 Flash model which interacts with our vector database to fetch relevant sections and generate insights responses.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-setting-up-gemini-2-0\">Setting-up Gemini-2.0<\/h3>\n<pre class=\"wp-block-code\"><code>from llama_index.llms.gemini import Gemini\n\nllm = Gemini(api_key=GEMINI_API_KEY, model_name=\"models\/gemini-2.0-flash\")\n<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-initiate-query-engine-using-gemini-2-0-with-vector-index\">Initiate query engine using Gemini 2.0 with vector index<\/h3>\n<pre class=\"wp-block-code\"><code>query_engine = vector_index.as_query_engine(llm=llm, similarity_top_k=5)<\/code><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-exa-mple-queries-and-response\"><b>Exa<\/b>mple Queries and Response<\/h3>\n<p>Below we have multiple queries with different responses: <\/p>\n<h4 class=\"wp-block-heading\" id=\"h-query-1\">Query-1<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\"what is the revenue of on 2022 Year Ended December 31?\")\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response\">Response<\/h4>\n<figure class=\"wp-block-image size-full is-resized figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"63\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response1.webp\" alt=\"response1\" class=\"wp-image-225179\" style=\"width:763px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response1.webp 707w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response1-300x27.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response1-150x13.webp 150w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\"\/><\/figure>\n<p><strong>Corresponding image from Report:<\/strong><\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1780\" height=\"924\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img1.webp\" alt=\"Corresponding image from Report:\" class=\"wp-image-225900\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img1.webp 1780w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img1-300x156.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img1-768x399.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img1-1536x797.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img1-150x78.webp 150w\" sizes=\"auto, (max-width: 1780px) 100vw, 1780px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-query-2\">Query-2<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\n    \"what is the Net Loss Attributable to Motossport Games Inc. on 2022 Year Ended December 31?\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-0\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"968\" height=\"77\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse2.webp\" alt=\"response2\" class=\"wp-image-225183\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse2.webp 968w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse2-300x24.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse2-768x61.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse2-150x12.webp 150w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\"\/><\/figure>\n<p><strong>Corresponding image from Report:<\/strong><\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1794\" height=\"355\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img2.webp\" alt=\"netloss: Financial Report Retrieval System\" class=\"wp-image-225903\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img2.webp 1794w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img2-300x59.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img2-768x152.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img2-1536x304.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img2-150x30.webp 150w\" sizes=\"auto, (max-width: 1794px) 100vw, 1794px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-query-3\">Query-3<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\n    \"What are the Liquidity and Going concern for the Company on December 31, 2023\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-1\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"975\" height=\"222\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response3.webp\" alt=\"response3: Financial Report Retrieval System\" class=\"wp-image-225187\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response3.webp 975w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response3-300x68.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response3-768x175.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response3-150x34.webp 150w\" sizes=\"auto, (max-width: 975px) 100vw, 975px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-query-4\">Query-4<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\n    \"Summarise the Principal versus agent considerations of the company?\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-2\">Response<\/h4>\n<figure class=\"wp-block-image size-full is-resized figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"537\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response4.webp\" alt=\"response4\" class=\"wp-image-225189\" style=\"width:583px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response4.webp 964w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response4-300x167.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response4-768x428.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response4-150x84.webp 150w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\"\/><\/figure>\n<p><strong>Corresonding image from Report:<\/strong><\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1800\" height=\"613\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img3.webp\" alt=\"summarie1\" class=\"wp-image-225905\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img3.webp 1800w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img3-300x102.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img3-768x262.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img3-350x120.webp 350w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img3-1536x523.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img3-150x51.webp 150w\" sizes=\"auto, (max-width: 1800px) 100vw, 1800px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-query-5\">Query-5<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\n    \"Summarise the Net Loss Per Common Share of the company with financial data?\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-3\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"958\" height=\"305\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response5.webp\" alt=\"response5\" class=\"wp-image-225193\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response5.webp 958w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response5-300x96.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response5-768x245.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response5-150x48.webp 150w\" sizes=\"auto, (max-width: 958px) 100vw, 958px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<p><strong>Corresonding image from Report:<\/strong><\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1796\" height=\"547\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img4.webp\" alt=\"common share\" class=\"wp-image-225907\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img4.webp 1796w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img4-300x91.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img4-768x234.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img4-1536x468.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img4-150x46.webp 150w\" sizes=\"auto, (max-width: 1796px) 100vw, 1796px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-query-6\">Query-6<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\n    \"Summarise Property and equipment consist of the following balances as of December 31, 2023 and 2022 of the company with financial data?\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-4\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"351\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse6.webp\" alt=\"reponse6\" class=\"wp-image-225195\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse6.webp 964w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse6-300x109.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse6-768x280.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/reponse6-150x55.webp 150w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<p><strong>Corresponding image from Report:<\/strong><\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1790\" height=\"557\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img5.webp\" alt=\"properties\" class=\"wp-image-225908\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img5.webp 1790w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img5-300x93.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img5-768x239.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img5-1536x478.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img5-150x47.webp 150w\" sizes=\"auto, (max-width: 1790px) 100vw, 1790px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-query-7\">Query-7<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\n    \"Summarise The Intangible Assets on December 21, 2023 of the company with financial data?\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-5\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"345\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response6.webp\" alt=\"response7\" class=\"wp-image-225198\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response6.webp 957w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response6-300x108.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response6-768x277.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response6-150x54.webp 150w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h4 class=\"wp-block-heading\" id=\"h-query-8\">Query-8<\/h4>\n<pre class=\"wp-block-code\"><code>response = query_engine.query(\n    \"What are leases of the company with yearwise financial data?\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-6\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"963\" height=\"265\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response8.png\" alt=\"response8\" class=\"wp-image-225199\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response8.png 963w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response8-300x83.png 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response8-768x211.png 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response8-150x41.png 150w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<p><strong>Corresponding image from Report:<\/strong><\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1811\" height=\"380\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img6.webp\" alt=\"leases\" class=\"wp-image-225909\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img6.webp 1811w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img6-300x63.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img6-768x161.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img6-1536x322.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img6-150x31.webp 150w\" sizes=\"auto, (max-width: 1811px) 100vw, 1811px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\" id=\"h-local-query-using-llama-3-2\">Local Query Using Llama 3.2<\/h2>\n<p>Leverage Llama 3.2 locally to query financial reports without relying on cloud-based models.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-seting-up-llama-3-2-1b\">Seting Up Llama 3.2:1b<\/h3>\n<pre class=\"wp-block-code\"><code>local_llm = Ollama(model=\"llama3.2:1b\", request_timeout=1000.0)\nlocal_query_engine = vector_index.as_query_engine(llm=local_llm, similarity_top_k=3)<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-query-9\">Query-9<\/h4>\n<pre class=\"wp-block-code\"><code>response = local_query_engine.query(\n    \"Summary of chart of Accrued expenses and other liabilities using the financial data of the company\"\n)\n\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-7\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"948\" height=\"393\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/responsee.webp\" alt=\"response: Financial Report Retrieval System\" class=\"wp-image-225202\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/responsee.webp 948w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/responsee-300x124.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/responsee-768x318.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/responsee-150x62.webp 150w\" sizes=\"auto, (max-width: 948px) 100vw, 948px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<p><strong>Corresonding image from Report:<\/strong><\/p>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"1789\" height=\"648\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img7.webp\" alt=\"accrued expenses: Financial Report Retrieval System\" class=\"wp-image-225911\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img7.webp 1789w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img7-300x109.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img7-768x278.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img7-1536x556.webp 1536w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/img7-150x54.webp 150w\" sizes=\"auto, (max-width: 1789px) 100vw, 1789px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\" id=\"h-advanced-query-routing-with-llamaindex\">Advanced Query Routing with LlamaIndex<\/h2>\n<p>Sometimes, we need both detailed retrieval and summarized insights. We can do this by combining both vector index and summary index.<\/p>\n<ul class=\"wp-block-list\">\n<li>Vector Index for precise document retrieval<\/li>\n<li>Summary Index for concise financial summaries<\/li>\n<\/ul>\n<p>We have already built the Vector Index, now we will create a summary Index that uses a hierarchical approach to summarizing financial statements.<\/p>\n<pre class=\"wp-block-code\"><code>from llama_index.core import SummaryIndex\n\nsummary_index = SummaryIndex(nodes=page_nodes)<\/code><\/pre>\n<p>Then integrate RouterQueryEngine, which conditionally decides whether to retrieve data from the summary index or the vector index based on the query type.<\/p>\n<pre class=\"wp-block-code\"><code>from llama_index.core.tools import QueryEngineTool\nfrom llama_index.core.query_engine.router_query_engine import RouterQueryEngine\nfrom llama_index.core.selectors import LLMSingleSelector<\/code><\/pre>\n<p>Now creating summary query engine<\/p>\n<pre class=\"wp-block-code\"><code>summary_query_engine = summary_index.as_query_engine(\n    llm=llm, response_mode=\"tree_summarize\", use_async=True\n)<\/code><\/pre>\n<p>This summary query engine goes into the summary tool. and the vector query engine into the vector tool.<\/p>\n<pre class=\"wp-block-code\"><code># Creating summary tool\nsummary_tool = QueryEngineTool.from_defaults(\n    query_engine=summary_query_engine,\n    description=(\n        \"Useful for summarization questions related to Motorsport Games Company.\"\n    ),\n)\n\n\n# Creating vector tool\n\nvector_tool = QueryEngineTool.from_defaults(\n    query_engine=query_engine,\n    description=(\n        \"Useful for retriving specific context from the Motorsport Games Company.\"\n    ),\n)<\/code><\/pre>\n<p>Both of the tools is done now we connect these tools through Router so that when query ass through the router it will decide which tool to use by analyzing user query.<\/p>\n<pre class=\"wp-block-code\"><code># Router Query Engine\n\nadv_query_engine = RouterQueryEngine(\n    llm=llm,\n    selector=LLMSingleSelector.from_defaults(llm=llm),\n    query_engine_tools=[summary_tool, vector_tool],\n    verbose=True,\n)<\/code><\/pre>\n<p>Our advanced query system is fully set up, now query our newly favored advanced query engine.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-query-10\">Query-10<\/h4>\n<pre class=\"wp-block-code\"><code>response = adv_query_engine.query(\n    \"Summarize the charts describing the revenure of the company.\"\n)\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-8\">Response<\/h4>\n<figure class=\"wp-block-image size-full is-resized figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"962\" height=\"596\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response10.webp\" alt=\"response10: Financial Report Retrieval System\" class=\"wp-image-225208\" style=\"width:662px;height:auto\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response10.webp 962w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response10-300x186.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response10-768x476.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response10-150x93.webp 150w\" sizes=\"auto, (max-width: 962px) 100vw, 962px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<p>You can see that our intelligent router will decide to use the summary tool because in the query user asks for summary.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-query-11\">Query-11<\/h4>\n<pre class=\"wp-block-code\"><code>response = adv_query_engine.query(\"What is the Total Assets of the company Yearwise?\")\nprint(str(response))<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-response-9\">Response<\/h4>\n<figure class=\"wp-block-image size-full figure mt-2 mb-2 d-table mx-auto\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"194\" src=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response12.webp\" alt=\"response11: Financial Report Retrieval System\" class=\"wp-image-225209\" srcset=\"https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response12.webp 970w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response12-300x60.webp 300w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response12-768x154.webp 768w, https:\/\/cdn.analyticsvidhya.com\/wp-content\/uploads\/2025\/03\/response12-150x30.webp 150w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\"\/><figcaption class=\"wp-element-caption\">Source: Author<\/figcaption><\/figure>\n<p>And here the Router selects Vector tool because the user asks for specific information, not summary.<\/p>\n<p>All the code used in this article is <a href=\"https:\/\/github.com\/avizyt\/blog-post-code\/tree\/main\/financial_report_rag\" target=\"_blank\" rel=\"nofollow noopener\">here<\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>We can efficiently analyze the financial reports with LlamaIndex, ChromaDB and Advanced LLMs. This system enables automated financial insights, real-time querying, and powerful summarization. This type of system makes financial analysis more accessible and efficient to take better decisions during investing, trading, and doing business.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-key-takeaways\">Key Takeaways<\/h3>\n<ul class=\"wp-block-list\">\n<li>LLM powered document retrieval system can drastically reduce the time spent on analyzing complex financial reports.<\/li>\n<li>A hybrid approach using cloud and local LLMs ensures a cost-effective, privacy, and flexible way to design a system.<\/li>\n<li>LlamaIndex\u2019s modular framework allows for an easy way to automate the financial report rag workflows<\/li>\n<li>This type of system can be adapted for different domains such as legal documents, medical reports and regulatory filing, which makes it a versatile RAG solution.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-frequently-asked-questions\">Frequently Asked Questions<\/h2>\n<div class=\"schema-faq wp-block-yoast-faq-block\">\n<div class=\"schema-faq-section\" id=\"faq-question-1741335871288\"><strong class=\"schema-faq-question\">Q<b>1. How does the system handles different financial reports?<\/b><\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. The system is designed to process any structured financial documents by breaking them into text chunks, embedding them and storing them in ChromaDB. New reports can be added dynamically without requiring a complete re-indexing.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1741335887659\"><strong class=\"schema-faq-question\">Q<b>2. Can this be extended to generate financial charts and visualizations?<\/b><\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. Yes, by integrating Matplotlib, Pandas and Streamlit, you can visualize trends such as revenue growth, net loss analysis, or asset distribution.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1741335902773\"><strong class=\"schema-faq-question\">Q3. <b>How does the query routing system improve accuracy?<\/b><\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. The RouterQueryEngine automatically detects whether a query requires a summarized response or specific financial data retrieval. This reduces irrelevant outputs and ensures precision in responses.<\/p>\n<\/p><\/div>\n<div class=\"schema-faq-section\" id=\"faq-question-1741335922211\"><strong class=\"schema-faq-question\">Q<b>4. In this system suitable for real-time financial analysis?<\/b><\/strong> <\/p>\n<p class=\"schema-faq-answer\">A. It can, but it depends on how frequently the vector store is updated. You can use OpenAI embedding API for continuous ingestion pipeline for real-time financial report query dynamically.\u00a0<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><strong>The media shown in this article is not owned by Analytics Vidhya and is used at the Author\u2019s discretion.<\/strong><\/p>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/avizyt\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_9z6Gys1.webp\" width=\"48\" height=\"48\" alt=\"Avijit Biswas\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>         A self-taught, project-driven learner, love to work on complex projects on deep learning, Computer vision, and NLP. I always try to get a deep understanding of the topic which may be in any field such as Deep learning, Machine learning, or Physics. Love to create content on my learning. Try to share my understanding with the worlds.              <\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Financial reports are critical for assessing a company\u2019s health. They span hundreds of pages, making it difficult to extract specific insights efficiently. Analysts and investors spend hours sifting through balance sheets, income statements and footnotes just to answer simple questions such as \u2013 What was the company\u2019s revenue in 2024? With recent advancements in LLM [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":131533,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[5815,2539,10912,10930,38576,2345],"dealstore":[],"offerexpiration":[],"class_list":["post-131532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-blogathon","tag-building","tag-financial","tag-report","tag-retrieval","tag-system"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Building a Financial Report Retrieval System - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=131532\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a Financial Report Retrieval System - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Financial reports are critical for assessing a company\u2019s health. They span hundreds of pages, making it difficult to extract specific insights efficiently. Analysts and investors spend hours sifting through balance sheets, income statements and footnotes just to answer simple questions such as \u2013 What was the company\u2019s revenue in 2024? With recent advancements in LLM [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=131532\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-13T21:21:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"872\" \/>\n\t<meta property=\"og:image:height\" content=\"473\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=131532#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=131532\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Building a Financial Report Retrieval System\",\"datePublished\":\"2025-03-13T21:21:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=131532\"},\"wordCount\":1478,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=131532#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp\",\"keywords\":[\"Blogathon\",\"Building\",\"Financial\",\"Report\",\"Retrieval\",\"SYSTEM\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=131532#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=131532\",\"url\":\"https:\/\/fivemor.com\/?p=131532\",\"name\":\"Building a Financial Report Retrieval System - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=131532#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=131532#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp\",\"datePublished\":\"2025-03-13T21:21:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=131532#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=131532\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=131532#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp\",\"width\":872,\"height\":473},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=131532#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Financial Report Retrieval System\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building a Financial Report Retrieval System - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=131532","og_locale":"en_US","og_type":"article","og_title":"Building a Financial Report Retrieval System - Som2ny Network","og_description":"Financial reports are critical for assessing a company\u2019s health. They span hundreds of pages, making it difficult to extract specific insights efficiently. Analysts and investors spend hours sifting through balance sheets, income statements and footnotes just to answer simple questions such as \u2013 What was the company\u2019s revenue in 2024? With recent advancements in LLM [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=131532","og_site_name":"Som2ny Network","article_published_time":"2025-03-13T21:21:08+00:00","og_image":[{"width":872,"height":473,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=131532#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=131532"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Building a Financial Report Retrieval System","datePublished":"2025-03-13T21:21:08+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=131532"},"wordCount":1478,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=131532#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp","keywords":["Blogathon","Building","Financial","Report","Retrieval","SYSTEM"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=131532#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=131532","url":"https:\/\/fivemor.com\/?p=131532","name":"Building a Financial Report Retrieval System - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=131532#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=131532#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp","datePublished":"2025-03-13T21:21:08+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=131532#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=131532"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=131532#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/Implementation-of-REAcT-Agent-using-LlamaIndex-and-Gemini.webp.webp","width":872,"height":473},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=131532#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Building a Financial Report Retrieval System"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/131532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=131532"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/131532\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/131533"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=131532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=131532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=131532"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=131532"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=131532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}