{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "John Adeojo",
  "title_listed": "Putting an AI-Powered Data Analyst to the Test",
  "keywords": "",
  "domain": "大模型算法",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://towardsdatascience.com/putting-an-ai-powered-data-analyst-to-the-test-e8971337264/",
  "publish_date": "2023-07-12",
  "corpus_stage": "",
  "notes": "",
  "id": "a6a9e67c6b8a",
  "collected_at": "2026-10-02T07:00:27",
  "title": "Putting an AI-Powered Data Analyst to the Test | Towards Data Science",
  "body_markdown": "![Revisit consent button](../images/body-df29beacd7496220cc94.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](../images/body-2159bb67f3de8ad870eb.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\n# Putting an AI-Powered Data Analyst to the Test\nExploring the Automation of Ad Hoc Analytics with Langchain and OpenAI\n[John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\nJuly 12, 20237 min read\n![Image by Author: Generated with Midjourney](../images/000.png)\nImage by Author: Generated with Midjourney\n## Background - The need for Efficient Analytics\nIn my opinion, analytics has been one of the toughest arenas to operate in due to the immense volumes of ad hoc requests. Typically, it involves writing a SQL query or conducting some analysis on a spreadsheet that ends up taking longer than anticipated. This results in analytics teams spending most of their time firefighting, building tactical solutions, and never having the chance to be proactive.\nI have frequently pondered on the idea of an AI assistant that could manage ad hoc analytics requests, much akin to the chatbots that are now ubiquitous in customer service. However, this always felt rather far-fetched due to the perceived complexity surrounding some analytics queries. Now, with advances in generative AI, we are at a stage where automating mundane, ad hoc requests is feasible. In this article, I present a prototype analytics bot. I evaluate the performance of the bot on some \"typical\" analytics requests and briefly discuss the implications for commercial analytics.\n* * *\nLearn this step by step with the interactive [AI Engineer](https://roadmap.sh/ai-engineer), [AI and Data Scientist](https://roadmap.sh/ai-data-scientist), [Computer Science](https://roadmap.sh/computer-science) and [Product Manager](https://roadmap.sh/product-manager) roadmaps.\n## AI-Powered Data Analyst\nThe analytics bot serves as an AI data analyst through a chat-like interface. Anyone requesting ad hoc analytics can pose questions to the bot in the same manner they would to a data analyst. The bot interprets queries in natural language, converts them into SQL, and queries the data behind it to produce a response in natural language. I have linked to the bot at the end of the article; you will need an [OpenAI](https://www.howtogeek.com/885918/how-to-get-an-openai-api-key/) API key and a data source URL to try it.\n* * *\n## Some Technical Bits - How to Build Your Own\nBuilding your own prototype analytics bot is readily achieved in seven lines of Python code. The core functionality of the bot centres around [Langchain](https://python.langchain.com/docs/get_started) and [OpenAI](https://platform.openai.com/docs/introduction) (although you can leverage any large language model for the task). However, if you are using OpenAI, you will need an API key, for which you can register here. The bot utilises the [SQLDatabaseChain](https://python.langchain.com/docs/modules/chains/popular/sqlite) API, which employs SQLAlchemy to connect to SQL databases. It can be used with any SQL dialect supported by SQLAlchemy. You can construct a basic bot in Jupyter notebooks with the following code:\n* * *\n## Testing the Analytics Bot\nI tested the analytics bot on a CO2 emissions dataset sourced from [Kaggle](https://www.kaggle.com/datasets/nehalbirla/vehicle-dataset-from-cardekho) recording emissions, engine size, and fuel consumption data for various vehicles.\n_Please note the data is available for both commercial and non-commercial purposes under the_[ _Open Data Commons License_](https://opendatacommons.org/licenses/dbcl/1-0/\\]) _._\nThe test comprises three sets of questions of varying difficulty, designed to evaluate the analytical capability of the bot.\n**Beginner Level** : These are straightforward univariate statistics that require beginner-level analytics reasoning. There is no requirement for domain knowledge as everything the analyst needs to understand to answer the query lies within the dataset.\n![Image by Author: Illustration of the thought process of an analyst receiving a beginner level query](../images/001.png)\nImage by Author: Illustration of the thought process of an analyst receiving a beginner level query\n**Intermediate Level** : These involve bivariate analysis, requiring additional steps to calculate further variables from the data before arriving at the answer. The main difference between the intermediate and beginner-level queries is the additional computational steps required in writing the pandas query.\n![Image by Author: Illustration of the thought process of an analyst receiving an intermediate level query](../images/002.png)\nImage by Author: Illustration of the thought process of an analyst receiving an intermediate level query\n**Higher Level** : These types of questions necessitate a level of understanding about the domain context to correctly answer. Notice in the diagram that the actual python query is the same as the beginner level, but the thought process is more complex.\n![Image by Author: Illustration of the thought process of an analyst receiving a higher level query](../images/003.png)\nImage by Author: Illustration of the thought process of an analyst receiving a higher level query\nI have manually completed each test as an analyst would do using pandas. The notebook for my test responses is linked [here](https://mybinder.org/v2/gh/john-adeojo/test_notebook_analyst_ai/14b6948dd0f928ca3afa610e1f6dfdfa0e5d562d?urlpath=lab%2Ftree%2Ftest.ipynb). You should make yourself comfortable that the responses from the bot are aligned with my own.\n* * *\n## Beginner Level Queries\n> **Question 1** - Which vehicle has the highest CO2 emissions on Average?\n![Image by author: Response to u0026quot;Which vehicle has the highest CO2 emissions on Average?u0026quot;](../images/004.png)\nImage by author: Response to \"Which vehicle has the highest CO2 emissions on Average?\"\n> **Question 2** - Which vehicle has the lowest CO2 emissions on average?\n![Image by author: Response to u0026quot;Which vehicle has the lowest CO2 emissions on average?u0026quot;](../images/005.png)\nImage by author: Response to \"Which vehicle has the lowest CO2 emissions on average?\"\nIn each case, the bot returns the correct answers, demonstrating basic data manipulation skills - something one would expect from a junior data analyst.\n* * *\n## Intermediate Level Queries\n> Question 1 - Which vehicle has the highest ratio of emissions to engine size?\n![Image by Author: Response to u0026quot;Which vehicle has the highest ratio of emissions to engine size?u0026quot;](../images/006.png)\nImage by Author: Response to \"Which vehicle has the highest ratio of emissions to engine size?\"\n> Question 2 - Which vehicle has the lowest ratio of emissions to engine size?\n![Image by Author: Response to u0026quot;Which vehicle has the lowest ratio of emissions to engine size?u0026quot;](../images/007.png)\nImage by Author: Response to \"Which vehicle has the lowest ratio of emissions to engine size?\"\nThe bot returns the correct answers, showing the capacity to respond to slightly more intricate queries, though still relatively basic. This time, the bot needed to create a ratio variable and then perform a sort on the table to locate the highest and lowest values.\n* * *\n## Higher Level Queries\n> Question 1 - Which vehicle is the most fuel-efficient?\n![Image by Author: Response to u0026quot;Which vehicle is the most fuel-efficient?u0026quot;](../images/008.png)\nImage by Author: Response to \"Which vehicle is the most fuel-efficient?\"\n> Question 2 - Which car is the least fuel-efficient?\n![Image by Author: Response to u0026quot;Which car is the least fuel-efficient?u0026quot;](../images/009.png)\nImage by Author: Response to \"Which car is the least fuel-efficient?\"\n> Question 3 - Which vehicle is the worst for the environment?\n![Image by Author: Response to u0026quot;Which vehicle is the worst for the environment?u0026quot;](../images/010.png)\nImage by Author: Response to \"Which vehicle is the worst for the environment?\"\nThe bot correctly answered all three questions. What sets these questions apart is that they require some degree of domain knowledge. The bot had to \"understand\" fuel efficiency and environmental impact to answer these questions. An analyst adept in data manipulation but lacking knowledge about these subjects may have perhaps struggled. These types of higher-level queries are typically posed by product managers or even CXO-level stakeholders.\n* * *\n## Commercial Implications\nLet's explore some of the commercial implications of implementing an analytics bot.\n**Shift Towards Engineering** : If you're an analyst, you might be concerned about redundancy through AI. However, I would like to take this opportunity to reassure you that I don't believe that this will happen - although the roles of data analysts will evolve. Here is how I see that occurring. For these AI bots to function effectively, they need clean and well-curated data sources to query from, much like a data analyst would require. Therefore, I envisage analytics roles shifting their focus more towards data engineering or analytics engineering. This will involve ensuring data generating processes are up to scratch, concentrating on curation, scaling, and acquisition of high-quality data sources rather than ad hoc analytics.\n**On-Demand Insights:** Product managers, portfolio directors, CEOs, or just anyone needing insights, your frustrations will be alleviated. It will be a gradual transition, due to the necessary engineering work, but these bots will make obtaining quick insights about your business easier than ever. However, with great power comes great responsibility. The onus will be on the consumers of insights to be well-trained in interpreting these insights, asking the right questions, and making data-driven decisions. This takes us further into the realm of decision sciences.\n**Advancement of ML & Data Sciences**: As analytics resources are redirected towards data curation, acquisition, and management at scale, a byproduct is the enablement of data sciences and machine learning. These types of well-engineered data management structures are precisely what's required for data scientists and machine learning engineers to build custom machine learning solutions, thereby accelerating the adoption of AI within a business.\n* * *\n## Try for Yourself\nYou're welcome to try out the [analytics bot](https://analytics-bot.streamlit.app/) yourself. You will need an API key, and it's recommended that you link to a data source hosted on GitHub. Try it with the [CO2 emissions dataset](https://raw.githubusercontent.com/john-adeojo/open_datasets/main/CO2%20Emissions_Canada.csv) if you wish. You will need to present the raw link to the GitHub file as shown below:\nperl\n\n```\nhttps://raw.githubusercontent.com/john-adeojo/open_datasets/main/CO2%20Emissions_Canada.csv\n```\n\n* * *\n## Watch the Live Demonstration\n* * *\n## Conclusion\nDespite only being tested on a small sample size, the analytics bot has demonstrated the potential of AI for automating ad hoc analytics queries that are the bane of many commercial analytics teams. The next challenges in analytics will be effective data management, necessitating a transition for analysts towards more engineering-focused roles. Decision-makers will also have to evolve, learning the discipline of decision science to help them ask the right questions and make data-informed decisions.\nIf you're interested in deploying an analytics bot solution within a commercial setting, there are a few considerations you should take into account:\n  * **Data Privacy** : This prototype utilises the OpenAI API. Data privacy must be prioritised when utilising any similar solution whenever data is being transferred to a third party.\n  * **Scaling** : The prototype is designed to hold a single dataset in memory at a time and cannot execute queries across relational datasets. Implementing this in a commercial setting would necessitate a consideration of infrastructure requirements at scale.\n  * **Data Management** : I alluded to this earlier, but data management will be key here. Datasets should be well curated and the data-generating process must be thoroughly understood for any insights to be meaningful.\n  * **Hallucinations** : The bots have a propensity to return inaccurate responses, and it's challenging to quantify the rate at which this happens. It's true that human analysts also make errors. Decision makers seeking to utilise these bots will need to be aware of their tendency to hallucinate and learn to view responses with a healthy degree of scepticism and apply appropriate scrutiny.\n\n\n* * *\n_Follow me on_[ _LinkedIn_](https://www.linkedin.com/in/john-adeojo/)\n_Subscribe to medium to get more insights from me:_\n> [**Join Medium with my referral link - John Adeojo**](https://johnadeojo.medium.com/membership)\n_Should you be interested in integrating AI or data science into your business operations, we invite you to schedule a complimentary initial consultation with us:_\n> [**Book Online | Data-Centric Solutions**](https://www.data-centric-solutions.com/book-online)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](../images/body-ead068aa953e7b688a96.png)\nWritten By\n## [John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[See all from John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[AI](https://towardsdatascience.com/tag/ai/)[Artificial Intelligence](https://towardsdatascience.com/tag/artificial-intelligence/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Innovation](https://towardsdatascience.com/tag/innovation/)[Technology](https://towardsdatascience.com/tag/technology/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fputting-an-ai-powered-data-analyst-to-the-test-e8971337264%2F&title=Putting%20an%20AI-Powered%20Data%20Analyst%20to%20the%20Test)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fputting-an-ai-powered-data-analyst-to-the-test-e8971337264%2F&title=Putting%20an%20AI-Powered%20Data%20Analyst%20to%20the%20Test)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fputting-an-ai-powered-data-analyst-to-the-test-e8971337264%2F&text=Putting%20an%20AI-Powered%20Data%20Analyst%20to%20the%20Test)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](../images/011.jpeg)](https://towardsdatascience.com/imbalanced-data-oversampling-using-genetic-crossover-operators-bb581150a9a8/)\n## [Imbalanced Data - Oversampling Using Genetic Crossover Operators](https://towardsdatascience.com/imbalanced-data-oversampling-using-genetic-crossover-operators-bb581150a9a8/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nCrossover oversampling adds novelty to a dataset and can score well on classification metrics vs. SMOTE and random oversampling\n[Bassel Karami](https://towardsdatascience.com/author/bassel-karami/)\nDecember 28, 20208 min read\n  * [![](../images/012.jpg)](https://towardsdatascience.com/linear-discriminant-analysis-lda-in-real-life-dimensionality-reduction-in-a-real-estate-dataset/)\n## [Linear Discriminant Analysis (LDA) in Real-Life: Dimensionality Reduction in a Real-Estate Dataset](https://towardsdatascience.com/linear-discriminant-analysis-lda-in-real-life-dimensionality-reduction-in-a-real-estate-dataset/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nUsing LDA for dimensionality reduction in classification problems\n[Carolina Bento](https://towardsdatascience.com/author/carolina%20bento/)\nSeptember 6, 202623 min read\n  * [![](../images/013.jpg)](https://towardsdatascience.com/fuzzytm-a-python-package-for-fuzzy-topic-models-fd3c3f0ae060/)\n## [FuzzyTM: A Python package for Fuzzy Topic Models](https://towardsdatascience.com/fuzzytm-a-python-package-for-fuzzy-topic-models-fd3c3f0ae060/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nIn my previous posts, I showed how to get started with the Python package OCTIS, a package to compare and optimize state-of-the-art topic...\n[Emil Rijcken](https://towardsdatascience.com/author/emilrijcken/)\nFebruary 21, 20226 min read\n  * [![](../images/014.jpeg)](https://towardsdatascience.com/pandas-in-practice-64be9228062a/)\n## [Pandas in Practice](https://towardsdatascience.com/pandas-in-practice-64be9228062a/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nA hands-on tutorial which demonstrates how to utilize the Pandas package to clean, manipulate, and analyze data.\n[Sultan Al Awar](https://towardsdatascience.com/author/sultanawar321/)\nJanuary 2, 20229 min read\n  * [![](../images/015.jpg)](https://towardsdatascience.com/an-introduction-to-surrogate-modeling-part-i-fundamentals-84697ce4d241/)\n## [An introduction to surrogate modeling, Part I: fundamentals](https://towardsdatascience.com/an-introduction-to-surrogate-modeling-part-i-fundamentals-84697ce4d241/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nA machine learning approach to accelerate engineering design\n[Shuai Guo](https://towardsdatascience.com/author/shuaiguo/)\nOctober 29, 20206 min read\n  * [![](../images/016.jpeg)](https://towardsdatascience.com/how-is-sample-size-related-to-standard-error-power-confidence-level-and-effect-size-c8ee8d904d9c/)\n## [How is Sample Size Related to Standard Error, Power, Confidence Level, and Effect Size?](https://towardsdatascience.com/how-is-sample-size-related-to-standard-error-power-confidence-level-and-effect-size-c8ee8d904d9c/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nUsing graphs to demonstrate the correlations\n[Zijing Zhu, PhD](https://towardsdatascience.com/author/zzhu17/)\nSeptember 30, 20206 min read\n  * [![](../images/017.jpg)](https://towardsdatascience.com/the-ultimate-guide-to-linear-regression-4f31ae937a86/)\n## [The Ultimate Guide to Linear Regression](https://towardsdatascience.com/the-ultimate-guide-to-linear-regression-4f31ae937a86/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nMath, Code, and All!\n[Tyler Folkman](https://towardsdatascience.com/author/tylerfolkman/)\nMay 4, 202020 min read\n  * [![](../images/018.jpg)](https://towardsdatascience.com/navigating-networks-with-networkx-a-short-guide-to-graphs-in-python-c16cbafe8063/)\n## [Navigating Networks with NetworkX: A Short Guide to Graphs in Python](https://towardsdatascience.com/navigating-networks-with-networkx-a-short-guide-to-graphs-in-python-c16cbafe8063/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nExplore NetworkX for building, analyzing, and visualizing graphs in Python. Discovering Insights in Connected Data.\n[Diego Penilla](https://towardsdatascience.com/author/technologger/)\nNovember 18, 202415 min read\n  * [![](../images/019.jpg)](https://towardsdatascience.com/track-your-ml-experiments-9d2ea8cbeb02/)\n## [Track Your ML Experiments](https://towardsdatascience.com/track-your-ml-experiments-9d2ea8cbeb02/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nA guide to Neptune for tracking your machine learning experiments in Python\n[Haden Pelletier](https://towardsdatascience.com/author/pelletierhaden/)\nMarch 29, 20248 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500) How Relevance Models Foreshadowed Transformers for NLP ](https://towardsdatascience.com/how-relevance-models-foreshadowed-transformers-for-nlp/ \"How Relevance Models Foreshadowed Transformers for NLP\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n\n\n",
  "metadata": {
    "title": "Putting an AI-Powered Data Analyst to the Test | Towards Data Science",
    "description": "Exploring the Automation of Ad Hoc Analytics with Langchain and OpenAI",
    "keywords": null,
    "author": "John Adeojo",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "Putting an AI-Powered Data Analyst to the Test",
    "og:description": "Exploring the Automation of Ad Hoc Analytics with Langchain and OpenAI",
    "og:url": "https://towardsdatascience.com/putting-an-ai-powered-data-analyst-to-the-test-e8971337264/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/07/1WCtQdOhJl-eehEtTJwuLjw.png",
    "og:image:width": "1024",
    "og:image:height": "1024",
    "og:image:type": "image/png",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "John Adeojo",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "7 min read",
    "article:published_time": "2023-07-12T17:01:32.000Z",
    "article:modified_time": "2023-07-12T17:01:32.000Z",
    "article:author": "https://towardsdatascience.com/author/johnadeojo/"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/a6a9e67c6b8a/code/block_000.txt",
      "chars": 92
    }
  ],
  "images": [
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:55:03Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:55:03Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:55:04Z"
    },
    {
      "status": "http_404",
      "url": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "src": "https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500",
      "alt": "",
      "downloaded": false,
      "discovery": "saved_markdown",
      "retried_at": "2026-10-20T17:55:04Z"
    }
  ],
  "audio": [],
  "videos": [
    {
      "url": "https://www.youtube.com/c/TowardsDataScience",
      "kind": "channel_reference",
      "status": "reference_only"
    }
  ],
  "links": [
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/latest/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/editors-pick/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/the-variable/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/shipai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/submissions/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/johnadeojo/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/ai/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/artificial-intelligence/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/data-science/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/innovation/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/tag/technology/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/imbalanced-data-oversampling-using-genetic-crossover-operators-bb581150a9a8/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/bassel-karami/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/linear-discriminant-analysis-lda-in-real-life-dimensionality-reduction-in-a-real-estate-dataset/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/category/artificial-intelligence/machine-learning/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/carolina bento/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/fuzzytm-a-python-package-for-fuzzy-topic-models-fd3c3f0ae060/"
    },
    {
      "type": "internal",
      "href": "https://towardsdatascience.com/author/emilrijcken/"
    },
    {
      "type": "external",
      "href": "https://write.insightmediagroup.io"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/company/towards-data-science/"
    },
    {
      "type": "external",
      "href": "https://x.com/TDataScience"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-engineer"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/ai-data-scientist"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/computer-science"
    },
    {
      "type": "external",
      "href": "https://roadmap.sh/product-manager"
    },
    {
      "type": "external",
      "href": "https://www.howtogeek.com/885918/how-to-get-an-openai-api-key/"
    },
    {
      "type": "external",
      "href": "https://python.langchain.com/docs/get_started"
    },
    {
      "type": "external",
      "href": "https://platform.openai.com/docs/introduction"
    },
    {
      "type": "external",
      "href": "https://python.langchain.com/docs/modules/chains/popular/sqlite"
    },
    {
      "type": "external",
      "href": "https://www.kaggle.com/datasets/nehalbirla/vehicle-dataset-from-cardekho"
    },
    {
      "type": "external",
      "href": "https://opendatacommons.org/licenses/dbcl/1-0/]"
    },
    {
      "type": "external",
      "href": "https://mybinder.org/v2/gh/john-adeojo/test_notebook_analyst_ai/14b6948dd0f928ca3afa610e1f6dfdfa0e5d562d?urlpath=lab%2Ftree%2Ftest.ipynb"
    },
    {
      "type": "external",
      "href": "https://analytics-bot.streamlit.app/"
    },
    {
      "type": "external",
      "href": "https://raw.githubusercontent.com/john-adeojo/open_datasets/main/CO2%20Emissions_Canada.csv"
    },
    {
      "type": "external",
      "href": "https://www.linkedin.com/in/john-adeojo/"
    },
    {
      "type": "external",
      "href": "https://johnadeojo.medium.com/membership"
    },
    {
      "type": "external",
      "href": "https://www.data-centric-solutions.com/book-online"
    },
    {
      "type": "external",
      "href": "https://www.facebook.com/sharer/sharer.php?title=Putting+an+AI-Powered+Data+Analyst+to+the+Test&u=https%3A%2F%2Ftowardsdatascience.com%2Fputting-an-ai-powered-data-analyst-to-the-test-e8971337264%2F"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-20T17:28:32Z",
  "source_url": "https://towardsdatascience.com/putting-an-ai-powered-data-analyst-to-the-test-e8971337264/",
  "delivery_status": "unverified",
  "discovery_status": "http_403",
  "missing_reason": "源页面未重新核验:http_403；已按保留正文补采图片",
  "repair_error": "",
  "actual_video_files": [
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/5aC4hruxBR4.f251.webm",
      "bytes": 7260088,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "492.661000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/5aC4hruxBR4.f298.mp4",
      "bytes": 21590071,
      "valid": true,
      "height": 720,
      "width": 1280,
      "duration": "492.650000",
      "status": "ok"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/BaV698rqTVE.f251.webm",
      "bytes": 3215355,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "241.581000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/BaV698rqTVE.f399.mp4",
      "bytes": 6200916,
      "valid": true,
      "height": 1080,
      "width": 1888,
      "duration": "241.533333",
      "status": "ok"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/DDG7AZo-t0M.f251.webm",
      "bytes": 8717799,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "693.981000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/DDG7AZo-t0M.f399.mp4",
      "bytes": 18251759,
      "valid": true,
      "height": 1080,
      "width": 1662,
      "duration": "693.966667",
      "status": "ok"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/J76h5loFn1I.f137.mp4",
      "bytes": 325979873,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "2942.733333",
      "status": "ok"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/dYSw-SV_fsI.f137.mp4",
      "bytes": 510118997,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "3502.466667",
      "status": "ok"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/dYSw-SV_fsI.f251.webm",
      "bytes": 50508020,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "3502.501000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/dw5Vff_fjoc.f251.webm",
      "bytes": 12502314,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "803.981000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/dw5Vff_fjoc.f399.mp4",
      "bytes": 33276990,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "803.966667",
      "status": "ok"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/zQ84HXl_kDc.f251.webm",
      "bytes": 43526388,
      "valid": false,
      "height": 0,
      "width": null,
      "duration": "3081.881000",
      "status": "invalid_or_wrong_resolution"
    },
    {
      "local_path": "attachments/a6a9e67c6b8a/videos/zQ84HXl_kDc.f299.mp4",
      "bytes": 1084902539,
      "valid": true,
      "height": 1080,
      "width": 1920,
      "duration": "3081.866667",
      "status": "ok"
    }
  ],
  "expected_saved_body_images": 4,
  "image_discovery": "saved_markdown",
  "source_body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\n# Putting an AI-Powered Data Analyst to the Test\nExploring the Automation of Ad Hoc Analytics with Langchain and OpenAI\n[John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\nJuly 12, 20237 min read\n![Image by Author: Generated with Midjourney](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/07/1WCtQdOhJl-eehEtTJwuLjw.png)\nImage by Author: Generated with Midjourney\n## Background - The need for Efficient Analytics\nIn my opinion, analytics has been one of the toughest arenas to operate in due to the immense volumes of ad hoc requests. Typically, it involves writing a SQL query or conducting some analysis on a spreadsheet that ends up taking longer than anticipated. This results in analytics teams spending most of their time firefighting, building tactical solutions, and never having the chance to be proactive.\nI have frequently pondered on the idea of an AI assistant that could manage ad hoc analytics requests, much akin to the chatbots that are now ubiquitous in customer service. However, this always felt rather far-fetched due to the perceived complexity surrounding some analytics queries. Now, with advances in generative AI, we are at a stage where automating mundane, ad hoc requests is feasible. In this article, I present a prototype analytics bot. I evaluate the performance of the bot on some \"typical\" analytics requests and briefly discuss the implications for commercial analytics.\n* * *\nLearn this step by step with the interactive [AI Engineer](https://roadmap.sh/ai-engineer), [AI and Data Scientist](https://roadmap.sh/ai-data-scientist), [Computer Science](https://roadmap.sh/computer-science) and [Product Manager](https://roadmap.sh/product-manager) roadmaps.\n## AI-Powered Data Analyst\nThe analytics bot serves as an AI data analyst through a chat-like interface. Anyone requesting ad hoc analytics can pose questions to the bot in the same manner they would to a data analyst. The bot interprets queries in natural language, converts them into SQL, and queries the data behind it to produce a response in natural language. I have linked to the bot at the end of the article; you will need an [OpenAI](https://www.howtogeek.com/885918/how-to-get-an-openai-api-key/) API key and a data source URL to try it.\n* * *\n## Some Technical Bits - How to Build Your Own\nBuilding your own prototype analytics bot is readily achieved in seven lines of Python code. The core functionality of the bot centres around [Langchain](https://python.langchain.com/docs/get_started) and [OpenAI](https://platform.openai.com/docs/introduction) (although you can leverage any large language model for the task). However, if you are using OpenAI, you will need an API key, for which you can register here. The bot utilises the [SQLDatabaseChain](https://python.langchain.com/docs/modules/chains/popular/sqlite) API, which employs SQLAlchemy to connect to SQL databases. It can be used with any SQL dialect supported by SQLAlchemy. You can construct a basic bot in Jupyter notebooks with the following code:\n* * *\n## Testing the Analytics Bot\nI tested the analytics bot on a CO2 emissions dataset sourced from [Kaggle](https://www.kaggle.com/datasets/nehalbirla/vehicle-dataset-from-cardekho) recording emissions, engine size, and fuel consumption data for various vehicles.\n_Please note the data is available for both commercial and non-commercial purposes under the_[ _Open Data Commons License_](https://opendatacommons.org/licenses/dbcl/1-0/\\]) _._\nThe test comprises three sets of questions of varying difficulty, designed to evaluate the analytical capability of the bot.\n**Beginner Level** : These are straightforward univariate statistics that require beginner-level analytics reasoning. There is no requirement for domain knowledge as everything the analyst needs to understand to answer the query lies within the dataset.\n![Image by Author: Illustration of the thought process of an analyst receiving a beginner level query](https://assets.insightmediagroup.io/media/1*ZXpbXGfQLoh5JR8QeOEeSA.png)\nImage by Author: Illustration of the thought process of an analyst receiving a beginner level query\n**Intermediate Level** : These involve bivariate analysis, requiring additional steps to calculate further variables from the data before arriving at the answer. The main difference between the intermediate and beginner-level queries is the additional computational steps required in writing the pandas query.\n![Image by Author: Illustration of the thought process of an analyst receiving an intermediate level query](https://assets.insightmediagroup.io/media/1*dUdYKKXB-Rufivnj4ztIsQ.png)\nImage by Author: Illustration of the thought process of an analyst receiving an intermediate level query\n**Higher Level** : These types of questions necessitate a level of understanding about the domain context to correctly answer. Notice in the diagram that the actual python query is the same as the beginner level, but the thought process is more complex.\n![Image by Author: Illustration of the thought process of an analyst receiving a higher level query](https://assets.insightmediagroup.io/media/1*Ah2IMcACHkVNeGIqx9aGzg.png)\nImage by Author: Illustration of the thought process of an analyst receiving a higher level query\nI have manually completed each test as an analyst would do using pandas. The notebook for my test responses is linked [here](https://mybinder.org/v2/gh/john-adeojo/test_notebook_analyst_ai/14b6948dd0f928ca3afa610e1f6dfdfa0e5d562d?urlpath=lab%2Ftree%2Ftest.ipynb). You should make yourself comfortable that the responses from the bot are aligned with my own.\n* * *\n## Beginner Level Queries\n> **Question 1** - Which vehicle has the highest CO2 emissions on Average?\n![Image by author: Response to u0026quot;Which vehicle has the highest CO2 emissions on Average?u0026quot;](https://assets.insightmediagroup.io/media/1*rv685VyxeFSj5hF-23iIBA.png)\nImage by author: Response to \"Which vehicle has the highest CO2 emissions on Average?\"\n> **Question 2** - Which vehicle has the lowest CO2 emissions on average?\n![Image by author: Response to u0026quot;Which vehicle has the lowest CO2 emissions on average?u0026quot;](https://assets.insightmediagroup.io/media/1*_hAEeVActOkSJ8mi15JwoA.png)\nImage by author: Response to \"Which vehicle has the lowest CO2 emissions on average?\"\nIn each case, the bot returns the correct answers, demonstrating basic data manipulation skills - something one would expect from a junior data analyst.\n* * *\n## Intermediate Level Queries\n> Question 1 - Which vehicle has the highest ratio of emissions to engine size?\n![Image by Author: Response to u0026quot;Which vehicle has the highest ratio of emissions to engine size?u0026quot;](https://assets.insightmediagroup.io/media/1*bKZhC_xGanJtgnWiSVx7bA.png)\nImage by Author: Response to \"Which vehicle has the highest ratio of emissions to engine size?\"\n> Question 2 - Which vehicle has the lowest ratio of emissions to engine size?\n![Image by Author: Response to u0026quot;Which vehicle has the lowest ratio of emissions to engine size?u0026quot;](https://assets.insightmediagroup.io/media/1*p1q1RcPGb1K7cIbtf4chCQ.png)\nImage by Author: Response to \"Which vehicle has the lowest ratio of emissions to engine size?\"\nThe bot returns the correct answers, showing the capacity to respond to slightly more intricate queries, though still relatively basic. This time, the bot needed to create a ratio variable and then perform a sort on the table to locate the highest and lowest values.\n* * *\n## Higher Level Queries\n> Question 1 - Which vehicle is the most fuel-efficient?\n![Image by Author: Response to u0026quot;Which vehicle is the most fuel-efficient?u0026quot;](https://assets.insightmediagroup.io/media/1*32XDlNvXWxThcuwZ8E7Opg.png)\nImage by Author: Response to \"Which vehicle is the most fuel-efficient?\"\n> Question 2 - Which car is the least fuel-efficient?\n![Image by Author: Response to u0026quot;Which car is the least fuel-efficient?u0026quot;](https://assets.insightmediagroup.io/media/1*Z4_c_g8sUwX1RvK6rplFxg.png)\nImage by Author: Response to \"Which car is the least fuel-efficient?\"\n> Question 3 - Which vehicle is the worst for the environment?\n![Image by Author: Response to u0026quot;Which vehicle is the worst for the environment?u0026quot;](https://assets.insightmediagroup.io/media/1*N1yPQfddHNDCTZSBPik-Qw.png)\nImage by Author: Response to \"Which vehicle is the worst for the environment?\"\nThe bot correctly answered all three questions. What sets these questions apart is that they require some degree of domain knowledge. The bot had to \"understand\" fuel efficiency and environmental impact to answer these questions. An analyst adept in data manipulation but lacking knowledge about these subjects may have perhaps struggled. These types of higher-level queries are typically posed by product managers or even CXO-level stakeholders.\n* * *\n## Commercial Implications\nLet's explore some of the commercial implications of implementing an analytics bot.\n**Shift Towards Engineering** : If you're an analyst, you might be concerned about redundancy through AI. However, I would like to take this opportunity to reassure you that I don't believe that this will happen - although the roles of data analysts will evolve. Here is how I see that occurring. For these AI bots to function effectively, they need clean and well-curated data sources to query from, much like a data analyst would require. Therefore, I envisage analytics roles shifting their focus more towards data engineering or analytics engineering. This will involve ensuring data generating processes are up to scratch, concentrating on curation, scaling, and acquisition of high-quality data sources rather than ad hoc analytics.\n**On-Demand Insights:** Product managers, portfolio directors, CEOs, or just anyone needing insights, your frustrations will be alleviated. It will be a gradual transition, due to the necessary engineering work, but these bots will make obtaining quick insights about your business easier than ever. However, with great power comes great responsibility. The onus will be on the consumers of insights to be well-trained in interpreting these insights, asking the right questions, and making data-driven decisions. This takes us further into the realm of decision sciences.\n**Advancement of ML & Data Sciences**: As analytics resources are redirected towards data curation, acquisition, and management at scale, a byproduct is the enablement of data sciences and machine learning. These types of well-engineered data management structures are precisely what's required for data scientists and machine learning engineers to build custom machine learning solutions, thereby accelerating the adoption of AI within a business.\n* * *\n## Try for Yourself\nYou're welcome to try out the [analytics bot](https://analytics-bot.streamlit.app/) yourself. You will need an API key, and it's recommended that you link to a data source hosted on GitHub. Try it with the [CO2 emissions dataset](https://raw.githubusercontent.com/john-adeojo/open_datasets/main/CO2%20Emissions_Canada.csv) if you wish. You will need to present the raw link to the GitHub file as shown below:\nperl\n\n```\nhttps://raw.githubusercontent.com/john-adeojo/open_datasets/main/CO2%20Emissions_Canada.csv\n```\n\n* * *\n## Watch the Live Demonstration\n* * *\n## Conclusion\nDespite only being tested on a small sample size, the analytics bot has demonstrated the potential of AI for automating ad hoc analytics queries that are the bane of many commercial analytics teams. The next challenges in analytics will be effective data management, necessitating a transition for analysts towards more engineering-focused roles. Decision-makers will also have to evolve, learning the discipline of decision science to help them ask the right questions and make data-informed decisions.\nIf you're interested in deploying an analytics bot solution within a commercial setting, there are a few considerations you should take into account:\n  * **Data Privacy** : This prototype utilises the OpenAI API. Data privacy must be prioritised when utilising any similar solution whenever data is being transferred to a third party.\n  * **Scaling** : The prototype is designed to hold a single dataset in memory at a time and cannot execute queries across relational datasets. Implementing this in a commercial setting would necessitate a consideration of infrastructure requirements at scale.\n  * **Data Management** : I alluded to this earlier, but data management will be key here. Datasets should be well curated and the data-generating process must be thoroughly understood for any insights to be meaningful.\n  * **Hallucinations** : The bots have a propensity to return inaccurate responses, and it's challenging to quantify the rate at which this happens. It's true that human analysts also make errors. Decision makers seeking to utilise these bots will need to be aware of their tendency to hallucinate and learn to view responses with a healthy degree of scepticism and apply appropriate scrutiny.\n\n\n* * *\n_Follow me on_[ _LinkedIn_](https://www.linkedin.com/in/john-adeojo/)\n_Subscribe to medium to get more insights from me:_\n> [**Join Medium with my referral link - John Adeojo**](https://johnadeojo.medium.com/membership)\n_Should you be interested in integrating AI or data science into your business operations, we invite you to schedule a complimentary initial consultation with us:_\n> [**Book Online | Data-Centric Solutions**](https://www.data-centric-solutions.com/book-online)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657091747_phu3q1.png)\nWritten By\n## [John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[See all from John Adeojo](https://towardsdatascience.com/author/johnadeojo/)\n[AI](https://towardsdatascience.com/tag/ai/)[Artificial Intelligence](https://towardsdatascience.com/tag/artificial-intelligence/)[Data Science](https://towardsdatascience.com/tag/data-science/)[Innovation](https://towardsdatascience.com/tag/innovation/)[Technology](https://towardsdatascience.com/tag/technology/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fputting-an-ai-powered-data-analyst-to-the-test-e8971337264%2F&title=Putting%20an%20AI-Powered%20Data%20Analyst%20to%20the%20Test)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fputting-an-ai-powered-data-analyst-to-the-test-e8971337264%2F&title=Putting%20an%20AI-Powered%20Data%20Analyst%20to%20the%20Test)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fputting-an-ai-powered-data-analyst-to-the-test-e8971337264%2F&text=Putting%20an%20AI-Powered%20Data%20Analyst%20to%20the%20Test)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/1Egup963YBrrfxrwW5y_54g.jpeg)](https://towardsdatascience.com/imbalanced-data-oversampling-using-genetic-crossover-operators-bb581150a9a8/)\n## [Imbalanced Data - Oversampling Using Genetic Crossover Operators](https://towardsdatascience.com/imbalanced-data-oversampling-using-genetic-crossover-operators-bb581150a9a8/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nCrossover oversampling adds novelty to a dataset and can score well on classification metrics vs. SMOTE and random oversampling\n[Bassel Karami](https://towardsdatascience.com/author/bassel-karami/)\nDecember 28, 20208 min read\n  * [![](https://assets.insightmediagroup.io/media/1788114977139_2qgt1z.jpg)](https://towardsdatascience.com/linear-discriminant-analysis-lda-in-real-life-dimensionality-reduction-in-a-real-estate-dataset/)\n## [Linear Discriminant Analysis (LDA) in Real-Life: Dimensionality Reduction in a Real-Estate Dataset](https://towardsdatascience.com/linear-discriminant-analysis-lda-in-real-life-dimensionality-reduction-in-a-real-estate-dataset/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nUsing LDA for dimensionality reduction in classification problems\n[Carolina Bento](https://towardsdatascience.com/author/carolina%20bento/)\nSeptember 6, 202623 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2022/02/0HWMhV3yBlEEgE-Mz-scaled.jpg)](https://towardsdatascience.com/fuzzytm-a-python-package-for-fuzzy-topic-models-fd3c3f0ae060/)\n## [FuzzyTM: A Python package for Fuzzy Topic Models](https://towardsdatascience.com/fuzzytm-a-python-package-for-fuzzy-topic-models-fd3c3f0ae060/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nIn my previous posts, I showed how to get started with the Python package OCTIS, a package to compare and optimize state-of-the-art topic...\n[Emil Rijcken](https://towardsdatascience.com/author/emilrijcken/)\nFebruary 21, 20226 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/12/1SABnYfT-DtAuwGOgkqs79g-scaled.jpeg)](https://towardsdatascience.com/pandas-in-practice-64be9228062a/)\n## [Pandas in Practice](https://towardsdatascience.com/pandas-in-practice-64be9228062a/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nA hands-on tutorial which demonstrates how to utilize the Pandas package to clean, manipulate, and analyze data.\n[Sultan Al Awar](https://towardsdatascience.com/author/sultanawar321/)\nJanuary 2, 20229 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/10/0PhQgsE0_wrSrcHvt-scaled.jpg)](https://towardsdatascience.com/an-introduction-to-surrogate-modeling-part-i-fundamentals-84697ce4d241/)\n## [An introduction to surrogate modeling, Part I: fundamentals](https://towardsdatascience.com/an-introduction-to-surrogate-modeling-part-i-fundamentals-84697ce4d241/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nA machine learning approach to accelerate engineering design\n[Shuai Guo](https://towardsdatascience.com/author/shuaiguo/)\nOctober 29, 20206 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/06/1P_Q5mEC4UfJCFtFjcpMH1g-scaled.jpeg)](https://towardsdatascience.com/how-is-sample-size-related-to-standard-error-power-confidence-level-and-effect-size-c8ee8d904d9c/)\n## [How is Sample Size Related to Standard Error, Power, Confidence Level, and Effect Size?](https://towardsdatascience.com/how-is-sample-size-related-to-standard-error-power-confidence-level-and-effect-size-c8ee8d904d9c/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nUsing graphs to demonstrate the correlations\n[Zijing Zhu, PhD](https://towardsdatascience.com/author/zzhu17/)\nSeptember 30, 20206 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2020/05/0DtBu4pf7I_6ncS3A-scaled.jpg)](https://towardsdatascience.com/the-ultimate-guide-to-linear-regression-4f31ae937a86/)\n## [The Ultimate Guide to Linear Regression](https://towardsdatascience.com/the-ultimate-guide-to-linear-regression-4f31ae937a86/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nMath, Code, and All!\n[Tyler Folkman](https://towardsdatascience.com/author/tylerfolkman/)\nMay 4, 202020 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/11/0Zka22wRTLLeRTfhO-scaled.jpg)](https://towardsdatascience.com/navigating-networks-with-networkx-a-short-guide-to-graphs-in-python-c16cbafe8063/)\n## [Navigating Networks with NetworkX: A Short Guide to Graphs in Python](https://towardsdatascience.com/navigating-networks-with-networkx-a-short-guide-to-graphs-in-python-c16cbafe8063/)\n[Data Science](https://towardsdatascience.com/category/data-science/)\nExplore NetworkX for building, analyzing, and visualizing graphs in Python. Discovering Insights in Connected Data.\n[Diego Penilla](https://towardsdatascience.com/author/technologger/)\nNovember 18, 202415 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/03/00YPnVfjYgyw-zp8c-scaled.jpg)](https://towardsdatascience.com/track-your-ml-experiments-9d2ea8cbeb02/)\n## [Track Your ML Experiments](https://towardsdatascience.com/track-your-ml-experiments-9d2ea8cbeb02/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nA guide to Neptune for tracking your machine learning experiments in Python\n[Haden Pelletier](https://towardsdatascience.com/author/pelletierhaden/)\nMarch 29, 20248 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607686/image?etag=1782161464448&width=500&height=500) How Relevance Models Foreshadowed Transformers for NLP ](https://towardsdatascience.com/how-relevance-models-foreshadowed-transformers-for-nlp/ \"How Relevance Models Foreshadowed Transformers for NLP\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607639/image?etag=1781250125848&width=500&height=500) Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1 ](https://towardsdatascience.com/javascript-fatigue-you-dont-need-js-to-build-chatgpt/ \"Javascript Fatigue: HTMX Is All You Need to Build ChatGPT — Part 1\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n\n\n",
  "body_base_path": "attachments/a6a9e67c6b8a/pages/",
  "body_markdown_path": "attachments/a6a9e67c6b8a/pages/archived-body.md",
  "local_html": "attachments/a6a9e67c6b8a/pages/archived-body.html",
  "body_source": "prior_capture"
}