Your Data Analyst AI Agent
AI Agents are among the top ways to utilize the LLM in business. They equip you with practical tools to navigate the AI landscape. An AI agent designed for data analysis can perform tasks such as querying databases, running data processing scripts, generating visualizations, and providing insights based on the analyzed data.
This article, ‘AI Agents: The Future of Enterprise AI… or Automation Repackaged?’, written by Umang Varma, already covered the basic concepts.
Based on the cookbook provided by Cohere, here’s what I did to practice an AI agent for data analysis.
It connects Cohere’s Command models to external tools such as search engines, APIs, databases, and other software tools. Similar to how Retrieval-Augmented Generation (RAG) enables a model to utilize an external data source for improving factual generation, tool use allows retrieving data from multiple sources.
The AI Agent was built in this notebook to create a simple data analyst capable of searching the web and running code in a Python interpreter. This agent leverages Cohere’s Command R+ mode and Langchain to perform its tasks efficiently.
Cookbook: A Data Analyst Agent Built with Cohere and Langchain |
I have set up my environment by installing:
! pip install –quiet langchain langchain_cohere langchain_experimental
After this, the connection to the Cohere API is made, and the Cohere chat model is created.
Then, the agent needs to be able to search the web; to achieve this, Tavily AI is used. I created the account and got the API key.
Now, we need to have a Python interpreter so that.
The complete notebook is available here.
Now, let’s ask our Data analyst to complete the task.
Parameter passed:
“Create a plot of the top Generative AI use cases the organizations are considering for implementation.”
The output:
Another Parameter:
“Create a plot of the number of full-time employees at the three tech companies with the highest market cap in the United States in 2024.”
Then, it summarizes the information so that the plot can be created.
The output:
If you want fully managed AI agents, Oracle has released the OCI Generative AI Agents. This fully managed service combines the power of large language models (LLMs) with an intelligent retrieval system to create contextually relevant answers by searching your knowledge base, making your AI applications intelligent and efficient. It is in beta, and you can sign up to test your subsequent use case.