Guides
Building High-Quality RAG for a Finance Q&A Bot
Use Pi's query fanout and custom ranking functions to improve performance over domain-specific natural language queries.

Follow along in the Colab notebook


This Quick Start guide shows how to improve the performance of a Retrieval Augmented Generation (RAG) Finance Question & Answer chatbot by using PIs Query Fanout SDK to improve the queries to the finance database. Specifically, we will:



Here's the code notebook for this example if you'd like to review and play with the real code!

Initializing our Pi Scoring system

Before we start any modeling efforts, we will define what a high quality answer from our chatbot will look like, and encapsulate this with our Pi Scoring System

python
from withpi.types import ScoringSpec summary_spec = ScoringSpec( name = "Default", description = "Summarizing Financial Documents to Answer Broad Queries\nThe Challenge of Financial Document Synthesis\nSummarizing financial documents to answer broad, complex queries is a demanding analytical task that requires several specialized skills:\n1. Financial Literacy and Contextual Understanding\nThe summarizer must possess strong financial literacy to interpret metrics, ratios, and terminology correctly within their proper business context. This includes understanding how different financial indicators relate to business performance and what they signal about a company's health.\n2. Cross-Document Integration\nFinancial insights often exist across multiple documents (quarterly reports, annual statements, investor presentations, industry analyses). The summarizer must connect related information scattered across these various sources to form a comprehensive picture.\n3. Temporal Analysis\nFinancial performance is inherently time-based. The summarizer must track performance trajectories, identify significant inflection points, distinguish between short-term fluctuations and long-term trends, and place current performance in historical context.\n4. Analytical Prioritization\nNot all financial information is equally relevant to the query at hand. The summarizer must filter through extensive data to extract and emphasize the most pertinent insights while appropriately contextualizing secondary factors that provide necessary background.\n5. Sector-Specific Contextualization\nFinancial metrics mean different things in different industries. The summarizer must adjust their interpretation based on sector-specific benchmarks, accounting for how metrics like margin expectations, growth rates, and valuation multiples vary across industries.\n6. Narrative Construction\nBeyond presenting data points, the summarizer must construct a coherent narrative that explains not just what happened but why it happened, connecting financial outcomes to strategic decisions, market conditions, and operational execution.\n7. Balancing Precision with Accessibility\nThe summarizer must maintain numerical accuracy while translating technical financial information into accessible insights, avoiding oversimplification while ensuring the summary remains intelligible to its intended audience.\n8. Objectivity and Balanced Perspective\nFinancial documents often present information with inherent corporate bias. The summarizer must maintain objectivity, balancing positive signals against risk factors, and providing a measured assessment that neither unduly emphasizes strengths nor disproportionately highlights weaknesses.\n9. Multi-Entity Comparative Analysis\nWhen queries involve multiple companies, the summarizer must provide fair comparisons that account for differences in company size, business model, market position, and reporting practices to deliver meaningful insights about relative performance.\n10. Query Relevance and Directness\nUltimately, the summary must directly address the original query, providing a concise yet comprehensive answer that synthesizes the most relevant financial information into a focused response tailored to the specific information need.\nThis complex analytical process transforms dense, technical financial documentation into targeted insights that directly address the information needs behind broad financial queries.", dimensions = [ { "label": "Comprehensiveness", "description": "Comprehensiveness", "sub_dimensions": [ { "label": "Comprehensiveness", "description": "Does the summary address each datapoint requested in the user prompt?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 }, { "label": "Financial Understanding", "description": "Financial Understanding", "sub_dimensions": [ { "label": "Financial Literacy", "description": "Does the summary demonstrate a correct understanding of financial metrics and terminology?", "scoring_type": "PI_SCORER" }, { "label": "Contextual Understanding", "description": "Is the financial information interpreted within its proper business context?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 }, { "label": "Integration and Analysis", "description": "Integration and Analysis", "sub_dimensions": [ { "label": "Cross-Document Integration", "description": "Does the summary integrate information from multiple financial documents?", "scoring_type": "PI_SCORER" }, { "label": "Integration of Insights", "description": "Are related financial insights connected to form a comprehensive picture?", "scoring_type": "PI_SCORER" }, { "label": "Temporal Analysis", "description": "Does the summary track financial performance over time?", "scoring_type": "PI_SCORER" }, { "label": "Inflection Points", "description": "Are significant inflection points in financial performance identified?", "scoring_type": "PI_SCORER" }, { "label": "Trend Distinction", "description": "Does the summary distinguish between short-term fluctuations and long-term trends?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 }, { "label": "Narrative and Clarity", "description": "Narrative and Clarity", "sub_dimensions": [ { "label": "Narrative Construction", "description": "Does the summary construct a coherent narrative explaining financial outcomes?", "scoring_type": "PI_SCORER" }, { "label": "Narrative Clarity", "description": "Is the narrative clear in explaining why financial outcomes occurred?", "scoring_type": "PI_SCORER" }, { "label": "Precision and Accessibility", "description": "Is the summary numerically accurate while remaining accessible to the intended audience?", "scoring_type": "PI_SCORER" }, { "label": "Avoiding Oversimplification", "description": "Does the summary avoid oversimplifying technical financial information?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 }, { "label": "Objectivity and Balance", "description": "Objectivity and Balance", "sub_dimensions": [ { "label": "Objectivity", "description": "Does the summary maintain objectivity and balance positive signals against risk factors?", "scoring_type": "PI_SCORER" }, { "label": "Balanced Perspective", # Good "description": "Is a balanced perspective provided without undue emphasis on strengths or weaknesses?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 }, { "label": "Comparative Analysis", "description": "Comparative Analysis", "sub_dimensions": [ { "label": "Comparative Analysis", "description": "Does the summary provide fair comparisons between multiple companies?", "scoring_type": "PI_SCORER" }, { "label": "Multi-Entity Comparison", "description": "Are differences in company size, business model, and market position accounted for in comparisons?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 }, { "label": "Relevance and Focus", "description": "Relevance and Focus", "sub_dimensions": [ { "label": "Query Relevance", "description": "Does the summary directly address the original query?", "scoring_type": "PI_SCORER" }, { "label": "Directness", "description": "Is the summary concise yet comprehensive in answering the query?", "scoring_type": "PI_SCORER" }, { "label": "Focused Response", "description": "Is the response focused on synthesizing the most relevant financial information?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 }, { "label": "Historical and Strategic Context", "description": "Historical and Strategic Context", "sub_dimensions": [ { "label": "Historical Context", "description": "Is current financial performance placed in historical context?", "scoring_type": "PI_SCORER" }, { "label": "Strategic Decisions", "description": "Are financial outcomes connected to strategic decisions, market conditions, and operational execution?", "scoring_type": "PI_SCORER" } ], "weight": 0.3 } ] )

Initializing our Scoring System

Status Quo: Have your LLM ping your database

Imagine you're building an AI application that can answer complex questions about companies’ financial data. It's a lot of data; too much to fit in a model’s context window, so you're currently storing it in a simple vector database. Your initial approach to question and answer with this data is straightforward.


You can see the vector database setup step in the accompanying code notebook for this walkthrough


# Define the user's financial query about Quantum Dynamics revenue user_query = "Get revenue for the last 2 years for Quantum Dynamics" # Query the financial database to retrieve the relevant revenue data retrieved_data = finance_database.query(user_query) # Use the LLM to generate a natural language summary of the retrieved financial data print(LLM.summarize(user_query, retrieved_data))
This gives you poor quality responses

You try a complex query:

“How does OceanicFusion Energy's performance in water usage efficiency and carbon offset metrics compare to TerraSustain Agriculture's environmental impact metrics, and how do analysts view both companies' sustainability efforts?”


Your system answers:

"The provided documents do not contain specific information on OceanicFusion Energy's performance in water usage efficiency and carbon offset metrics. However, they do highlight some challenges the company faces, such as damage to installations from extreme…" (see full response)


You know for a fact this information exists in your database, but you try out a few more queries and keep encountering the same issues in the answers (see examples in code notebook):

  • Missing data points even when they exist in your vector database
  • Incorrect figures for financial metrics
  • Inconsistent handling of time periods
  • The LLM occasionally fabricates data

This response also scores very low with our Pi Scoring System. It scores a 0.43 on a 1 point scale (see in code notebook)

A standard database simply can’t handle a query like the one you issued above. You need to break this query down into bite-sized pieces for your DB to handle. We’ve built a core SDK functionality just for this, and call these bite-sized pieces “Query Fanouts”

Implement Query Fanout for Better Data Retrieval with the PI SDK

Pi’s Query Fanout endpoint transforms a single user question into multiple targeted natural language queries:


For example, the question...

“How does OceanicFusion Energy's performance in water usage efficiency and carbon offset metrics compare to TerraSustain Agriculture's environmental impact metrics, and how do analysts view both companies' sustainability efforts?”


...generates these natural language queries:

  • “Water usage efficiency of OceanicFusion Energy”
  • “Carbon offset metrics of OceanicFusion Energy”
  • “Environmental impact metrics of TerraSustain Agriculture”
  • “Analyst views on OceanicFusion Energy's sustainability efforts”
  • “Analyst views on TerraSustain Agriculture's sustainability efforts”


You update your approach to use Pi's Fanout SDK. Adding in a step to generate fanout queries for the original query, and then use each of those fanout queries to retrieve results from your database.

# Define the user's financial query about Quantum Dynamics revenue user_query = "Get revenue for the last 2 years for Quantum Dynamics" # Generate a list of granular fanouts to address the original user query list_of_fanout_queries = withpi.generateFanouts(user_query) # Using the fanouts, query the financial database to retrieve the relevant revenue data retrieved_data = finance_database.query([list_of_fanout_queries]) # Use the LLM to generate a natural language summary of the retrieved financial data print(LLM.summarize(user_query, retrieved_data))


Query

How does OceanicFusion Energy's performance in water usage efficiency and carbon offset metrics compare to TerraSustain Agriculture's environmental impact metrics, and how do analysts view both companies' sustainability efforts?

Before Fanouts

Bolding indicates incorrect claims about missing information

After Fanouts

Bolding indicates correctly retrieved information

"The provided documents do not contain specific information on OceanicFusion Energy's performance in water usage efficiency and carbon offset metrics. However, they do highlight some challenges the company faces, such as damage to installations from extreme weather events, which raises concerns about the durability and sustainability of tidal power. Additionally, an analyst from UBS has given OceanicFusion a ""Neutral"" rating, noting that while tidal power is promising, it faces economic challenges compared to solar and wind energy, and the company needs additional capital to scale.

In contrast, TerraSustain Agriculture's environmental impact metrics are more detailed in the documents. The company is noted for its precision farming technologies, which have led to significant water savings (40%), yield improvements (23%), and reductions in fertilizer use (27%). These metrics indicate a positive environmental impact, particularly in terms of water usage efficiency. TerraSustain's efforts have been positively received on social media, with high engagement and positive sentiment, suggesting strong support for their sustainability initiatives.

Overall, TerraSustain Agriculture appears to have a more quantifiable and positively perceived impact on environmental sustainability compared to OceanicFusion Energy, which faces challenges in scaling and economic viability despite the potential of tidal power. Analysts view TerraSustain's sustainability efforts favorably, while OceanicFusion's sustainability efforts are seen as promising but economically challenging."


"OceanicFusion Energy and TerraSustain Agriculture both focus on sustainability, but they operate in different sectors and thus have distinct environmental impact metrics.

OceanicFusion Energy:

  • Water Usage Efficiency: As a tidal power company, OceanicFusion Energy does not directly report on water usage efficiency since its operations primarily involve harnessing tidal energy, which does not consume water in the traditional sense.
  • Carbon Offset Metrics: OceanicFusion Energy reported carbon offsets of 78,450 tons in Q1 2022, increasing to 89,720 tons in Q2, and then decreasing to 71,250 tons in Q4. This indicates a significant contribution to reducing carbon emissions through its renewable energy operations.

TerraSustain Agriculture:

  • Water Usage Efficiency: TerraSustain Agriculture focuses on precision farming technologies that improve water usage efficiency. They reported a 40% water savings for their partner farms, which is a substantial improvement in water conservation.
  • Carbon Offset Metrics: TerraSustain has launched a carbon credit program, allowing farmers to monetize sustainable practices. The program has generated an average of $45/hectare in additional income through carbon sequestration, indicating a positive impact on carbon offsetting.

Analysts' Views on Sustainability Efforts:

  • OceanicFusion Energy: Analysts have mixed views on OceanicFusion's sustainability efforts. While Barclays rated the company ""Overweight"" due to its technology validation in the Philippines and potential market expansion, UBS rated it ""Neutral,"" citing challenging economics compared to solar and wind energy. HSBC noted environmental risks due to typhoon damage, which could impact growth.
  • TerraSustain Agriculture: Analysts generally view TerraSustain positively. JP Morgan rated it ""Overweight,"" highlighting the relative outperformance of its technology during drought conditions as a strong proof point. The company's initiatives, such as the carbon credit program, are seen as innovative steps towards enhancing sustainability.

In summary, while OceanicFusion Energy contributes significantly to carbon offsetting through renewable energy, TerraSustain Agriculture excels in water usage efficiency and carbon sequestration through its precision farming technologies. Analysts recognize both companies' sustainability efforts, with TerraSustain receiving slightly more favorable views due to its direct impact on agricultural efficiency and innovative programs."

Total Pi Score (see details): .43

Total Pi Score (see details): .67


You see immediate quality improvements! Look at all the additional data you're able to retrieve with finer grained queries

You can see more side by side diffs and scores in the code notebook


Query

What patterns emerge when comparing capacity utilization metrics across different industries - from VerticalHarvest's grow area utilization to FusionGrid's renewable capacity deployment to QuasarPharm's clinical trial enrollment rates?

Before Fanouts

Bolding indicates incorrect claims about missing information

After Fanouts

Bolding indicates correctly retrieved information

"The provided documents do not include information about VerticalHarvest or QuasarPharm, so I can only analyze the data available for FusionGrid Energy. Here's a summary of the capacity utilization metrics for FusionGrid Energy:

  1. Renewable Capacity Deployment:
    • FusionGrid Energy's renewable capacity increased steadily over the quarters in 2021:
      • Q1: 450 MW
      • Q2: 487 MW
      • Q3: 525 MW
    • This indicates a consistent expansion in their renewable energy capacity, suggesting a strategic focus on increasing their ability to generate renewable energy.
  2. Battery Storage Capacity:
    • Similarly, their battery storage capacity also showed growth:
      • Q1: 320 MWh
      • Q2: 375 MWh
      • Q3: 425 MWh
    • This growth in battery storage capacity complements the increase in renewable capacity, enhancing their ability to store and manage energy more effectively.
  3. Grid Reliability:
    • FusionGrid Energy maintained a high grid reliability percentage throughout the quarters:
      • Q1: 99.92%
      • Q2: 99.94%
      • Q3: 99.95%
    • This high reliability indicates effective utilization of their capacity to ensure consistent energy supply.

Overall, the pattern for FusionGrid Energy shows a strategic expansion in both renewable capacity and battery storage, coupled with maintaining high grid reliability. This suggests a focus on scaling up their operations while ensuring stability and reliability in energy distribution. Without data on VerticalHarvest and QuasarPharm, a direct comparison across different industries cannot be made."

"When comparing capacity utilization metrics across the different industries represented by VerticalHarvest Agritech, FusionGrid Energy, and QuasarPharm, several patterns emerge:

  1. VerticalHarvest Agritech (Agriculture Technology - Vertical Farming):
    • Grow Area Utilization: VerticalHarvest has shown a consistent increase in grow area utilization over the quarters in 2023. The grow area in square meters increased from 124,500 in Q1 to 158,600 in Q4. This expansion indicates a strategic scaling of operations to enhance production capacity. The company also boasts a high water usage reduction percentage (up to 96.8%) and a significant number of crop cycles per year (up to 15), demonstrating efficient use of available resources to maximize yield per square meter.
  2. FusionGrid Energy (Utilities - Distributed Energy):
    • Renewable Capacity Deployment: FusionGrid Energy has steadily increased its renewable capacity from 450 MW in Q1 2021 to 525 MW by Q3 2021. This growth reflects the company's commitment to expanding its renewable energy footprint. The deployment of battery storage capacity also increased from 320 MWh to 425 MWh over the same period, indicating an integrated approach to enhancing grid reliability and energy storage capabilities. The grid reliability percentage remains exceptionally high, around 99.94% to 99.95%, showcasing effective utilization of its energy infrastructure.
  3. QuasarPharm (Healthcare - Biopharmaceuticals):
    • Clinical Trial Enrollment Rates: While specific enrollment rates are not detailed, QuasarPharm's progression from Phase 2 to Phase 3 trials for its Alzheimer's drug QSR-721 indicates successful capacity utilization in terms of clinical trial advancement. The company's ability to move forward with trials and the positive sentiment surrounding its research publications suggest efficient use of its research and development capabilities to push its drug pipeline forward.

Overall Patterns:

  • Expansion and Efficiency: All three companies demonstrate a pattern of expanding their operational capacities while maintaining or improving efficiency. VerticalHarvest expands its grow area and optimizes resource use, FusionGrid increases its renewable capacity and storage while maintaining high grid reliability, and QuasarPharm advances its clinical trials, indicating effective R&D utilization.
  • Strategic Scaling: Each company is strategically scaling its operations to enhance capacity utilization. VerticalHarvest is increasing its grow area, FusionGrid is expanding its renewable and storage capacities, and QuasarPharm is advancing its clinical trials, all of which are critical to their respective industries.
  • Resource Optimization: Efficient use of resources is a common theme. VerticalHarvest optimizes water usage, FusionGrid ensures high grid reliability, and QuasarPharm progresses through clinical trial phases, all indicating a focus on maximizing output from available resources.

These patterns highlight the importance of strategic capacity expansion and resource optimization across different industries to drive growth and maintain competitive advantages."

Total Pi Score (see details): .65

Total Pi Score (see details): 0.60



Query

How do technology companies like CyberShield Solutions and MindSphere Technologies differ from healthcare companies like QuasarPharm and NanoHarvest Therapeutics in balancing R&D expenditures against short-term profitability, based on their financial metrics and analyst recommendations?

Before Fanouts

Bolding indicates incorrect claims about missing information

After Fanouts

Bolding indicates correctly retrieved information

"Based on the provided data, we can analyze MindSphere Technologies, a technology company, to understand its approach to balancing R&D expenditures against short-term profitability. However, there is no specific data on CyberShield Solutions, QuasarPharm, or NanoHarvest Therapeutics in the documents provided. Therefore, the analysis will focus solely on MindSphere Technologies.

MindSphere Technologies:

  1. Analyst Ratings and Target Prices:
    • MindSphere Technologies has received positive analyst ratings, with recommendations ranging from ""Buy"" to ""Overweight"" and target prices between $95.0 and $125.0. This indicates a strong market confidence in the company's growth potential.
    • Analysts have highlighted MindSphere's leadership in technological innovation and commercial deployment, suggesting a significant investment in R&D to maintain its competitive edge.
  2. Strategic Partnerships:
    • The partnership with Mayo Clinic is a strategic move that enhances MindSphere's positioning in the healthcare sector, indicating a focus on long-term growth through strategic alliances. This partnership is likely a result of substantial R&D efforts to develop applicable AI solutions for healthcare.
  3. Privacy and Regulatory Concerns:
    • Some analysts have noted potential regulatory challenges, particularly related to privacy concerns in healthcare applications. This suggests that while R&D is a priority, MindSphere must also navigate regulatory landscapes, which could impact short-term profitability.
  4. Competitive Positioning:
    • Despite facing increased competition, MindSphere's proprietary neural architecture provides a defensible moat, indicating that R&D is focused on maintaining technological superiority and efficiency, which are critical for long-term success.

General Insights:

  • Technology Companies (e.g., MindSphere Technologies):
    • Tend to prioritize R&D to drive innovation and maintain competitive advantages.
    • Often engage in strategic partnerships to enhance market positioning and leverage technological advancements.
    • Face regulatory challenges that can impact short-term profitability, especially in sensitive sectors like healthcare.
  • Healthcare Companies (e.g., QuasarPharm, NanoHarvest Therapeutics):
    • Typically have a more direct focus on R&D for product development and regulatory approval processes, which are critical for bringing new therapies to market.
    • May experience longer timelines to profitability due to the extensive testing and approval processes required in the healthcare industry.
    • Analyst recommendations for healthcare companies often emphasize the potential for breakthrough therapies and long-term growth rather than immediate profitability.

In summary, technology companies like MindSphere Technologies balance R&D expenditures with short-term profitability by leveraging innovation and strategic partnerships, while healthcare companies may focus more on the long-term potential of their R&D investments due to the nature of the industry."

"Based on the provided data, we can observe some key differences in how technology companies like CyberShield Solutions and MindSphere Technologies balance R&D expenditures against short-term profitability compared to healthcare companies like QuasarPharm.

CyberShield Solutions (Technology - Cybersecurity)

  • R&D Expenditures: CyberShield Solutions consistently invests in R&D, with expenditures increasing from $40.1 million in Q3 2021 to $68.9 million in Q3 2023. This indicates a strong commitment to innovation and maintaining a competitive edge in cybersecurity.
  • Profitability: The company has shown a steady increase in revenue and profitability, with net income rising from $27.3 million in Q3 2021 to $67.7 million in Q3 2023. The gross and operating margins have also improved, suggesting efficient management of costs alongside R&D investments.
  • Analyst Recommendations: The financial data does not include specific analyst recommendations for CyberShield Solutions, but the financial performance suggests a positive outlook.

MindSphere Technologies (Technology - Artificial Intelligence)

  • R&D Expenditures: MindSphere Technologies also invests heavily in R&D, with expenditures ranging from $32.4 million in Q1 2023 to $45.6 million in Q4 2023. This reflects a focus on developing advanced AI technologies.
  • Profitability: The company has maintained healthy gross and operating margins, with net income figures indicating profitability. However, there are concerns about privacy and regulatory issues that could impact growth, as noted by analysts.
  • Analyst Recommendations: Analysts have mixed views, with ratings ranging from ""Neutral"" to ""Buy"" and ""Overweight."" The target prices vary, reflecting differing opinions on the impact of privacy concerns and competitive positioning.

QuasarPharm (Healthcare - Biopharmaceuticals)

  • R&D Expenditures: QuasarPharm allocates a significant portion of its budget to R&D, with expenditures reaching $156.3 million in Q4 2022. This is typical for biopharmaceutical companies, where R&D is crucial for developing new drugs.
  • Profitability: The company's profitability is more volatile, with a notable loss in Q4 2022 (net income of -$56.3 million). This reflects the high-risk nature of biopharmaceutical R&D, where substantial investments may not immediately translate into revenue.
  • Analyst Recommendations: Analysts have a positive outlook, with a ""Buy"" rating and a target price of $105.0, highlighting the potential of their drug pipeline despite short-term losses.

NanoHarvest Therapeutics (Healthcare - Biopharmaceuticals)

  • R&D Expenditures and Profitability: The data does not provide specific financial metrics for NanoHarvest Therapeutics, but similar companies in the sector typically face high R&D costs and variable profitability due to the long development cycles and regulatory hurdles in drug development.

Summary

  • Technology Companies: CyberShield Solutions and MindSphere Technologies balance R&D with profitability more effectively, showing steady financial growth and positive analyst sentiment. They manage to maintain profitability while investing in innovation.
  • Healthcare Companies: QuasarPharm and similar biopharmaceutical companies like NanoHarvest Therapeutics prioritize R&D heavily, often at the expense of short-term profitability. Their financial performance is more volatile, reflecting the high-risk, high-reward nature of drug development. Analyst recommendations are generally positive, focusing on long-term potential rather than immediate financial results.

In conclusion, technology companies tend to achieve a more balanced approach between R&D and profitability, while healthcare companies often accept short-term financial volatility in pursuit of long-term breakthroughs."

Total Pi Score (see details): 0.67

Total Pi Score (see details): 0.78


Conclusion

This Quick Start guide demonstrates how to dramatically improve the quality of a Finance Q&A bot by implementing Query Fanout to generate multiple targeted natural language queries for complex financial questions.

The result? A financial assistant that provides more accurate, comprehensive answers while still using your existing database of financial information.

Ready to go beyond the basics? More walkthroughs coming soon:

  • (Coming soon) Learn how to score and rank news articles so that you can handle even more complex queries such as: 
    • "What was Atlas's operating margin in 2022 compared to its top three competitors? Summarize their most recent bullish analyst reports”

  • (Coming soon) Learn how to turn this into an Agent to reason over harder queries that might require taking multiple steps such as:
    • “What was Atlas's operating margin in 2022 compared to its top three competitors in the same industry segment? 
    • How would a 2% reduction in interest expenses impact their operating margin relative to competitors?