├── CrewAI-LlamaIndex-AIAgents.ipynb └── README.md /CrewAI-LlamaIndex-AIAgents.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"attachments":{},"cell_type":"markdown","id":"7242cfe8-fa00-443b-b7dd-0dec6d8ba2c1","metadata":{"language":"python"},"source":"# Financial Analyst Agent Using CrewAI and LlamaIndex"},{"attachments":{},"cell_type":"markdown","id":"3d697c05-911c-4cdd-ae8a-d456b5330dc3","metadata":{"language":"python"},"source":"### Install required dependencies"},{"cell_type":"code","execution_count":19,"id":"269f0335-b871-488d-beea-f607d844775b","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:06:44.991477Z","iopub.status.busy":"2024-07-13T15:06:44.990961Z","iopub.status.idle":"2024-07-13T15:07:09.946435Z","shell.execute_reply":"2024-07-13T15:07:09.945887Z","shell.execute_reply.started":"2024-07-13T15:06:44.991460Z"},"language":"python","trusted":true},"outputs":[],"source":"!pip install llama-index --quiet\n!pip install llama-index-llms-groq --quiet\n!pip install llama-index-core --quiet\n!pip install llama-index-readers-file --quiet\n!pip install llama-index-tools-wolfram-alpha --quiet\n!pip install llama-index-embeddings-huggingface --quiet\n!pip install 'crewai[tools]' --quiet"},{"attachments":{},"cell_type":"markdown","id":"8dae23be-ea75-4a9a-b3b2-3e7478a49f09","metadata":{"language":"python"},"source":"### Let's setup the LLM with Groq. Sign up at Groq, it is free. Go to Groq console and get the API keys."},{"cell_type":"code","execution_count":20,"id":"1f584e0c-a1fc-4701-9e37-9f9ed608756f","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:08:17.493213Z","iopub.status.busy":"2024-07-13T15:08:17.492866Z","iopub.status.idle":"2024-07-13T15:08:20.127034Z","shell.execute_reply":"2024-07-13T15:08:20.126597Z","shell.execute_reply.started":"2024-07-13T15:08:17.493188Z"},"language":"python","trusted":true},"outputs":[],"source":"from llama_index.llms.groq import Groq"},{"cell_type":"code","execution_count":25,"id":"b7fde01e-8cf9-4ee3-a803-9e37b25d5c74","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:08:28.311822Z","iopub.status.busy":"2024-07-13T15:08:28.311315Z","iopub.status.idle":"2024-07-13T15:08:28.314465Z","shell.execute_reply":"2024-07-13T15:08:28.313936Z","shell.execute_reply.started":"2024-07-13T15:08:28.311804Z"},"language":"python","trusted":true},"outputs":[],"source":"llm = Groq(model=\"llama3-70b-8192\", api_key=\"Add Your Groq API Key\")"},{"cell_type":"code","execution_count":26,"id":"e370bd44-3beb-4eb8-ad20-d935b1ee075e","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:09:02.179599Z","iopub.status.busy":"2024-07-13T15:09:02.179067Z","iopub.status.idle":"2024-07-13T15:09:04.655213Z","shell.execute_reply":"2024-07-13T15:09:04.654769Z","shell.execute_reply.started":"2024-07-13T15:09:02.179585Z"},"language":"python","trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"Large Language Models (LLMs) have revolutionized the field of Natural Language Processing (NLP) and have numerous applications across various industries. The importance of LLMs can be summarized as follows:\n\n1. **Improved Language Understanding**: LLMs have demonstrated remarkable capabilities in understanding human language, including nuances, context, and subtleties. This enables them to generate more accurate and informative responses, making them useful for applications like chatbots, virtual assistants, and language translation.\n2. **Enhanced Text Generation**: LLMs can generate coherent, context-specific, and often indistinguishable-from-human text. This has opened up new possibilities for content creation, such as automated writing, summarization, and even creative writing.\n3. **Advancements in AI Research**: LLMs have pushed the boundaries of AI research, enabling the development of more sophisticated models that can learn from large datasets and improve over time. This has led to breakthroughs in areas like question answering, sentiment analysis, and text classification.\n4. **Improved Customer Experience**: LLMs can be used to create personalized, human-like interactions with customers, enhancing their experience and improving customer satisfaction. This is particularly useful in industries like customer service, marketing, and e-commerce.\n5. **Increased Efficiency**: LLMs can automate many tasks, such as data entry, content generation, and language translation, freeing up human resources for more strategic and creative work.\n6. **Accessibility and Inclusion**: LLMs can help bridge language barriers, making information and services more accessible to people with disabilities, language limitations, or those in underserved communities.\n7. **Scientific Discovery**: LLMs can aid in scientific discovery by analyzing large amounts of text data, identifying patterns, and generating insights that can lead to new discoveries and breakthroughs.\n8. **Cybersecurity**: LLMs can be used to detect and prevent cyber threats, such as phishing attacks, spam, and malware, by analyzing language patterns and identifying anomalies.\n9. **Healthcare and Medicine**: LLMs can help analyze medical texts, identify patterns, and provide insights that can improve patient outcomes, disease diagnosis, and treatment.\n10. **Economic Growth**: The development and deployment of LLMs can create new job opportunities, stimulate economic growth, and increase productivity across various industries.\n11. **Improved Decision-Making**: LLMs can provide decision-makers with accurate, data-driven insights, enabling them to make more informed decisions and drive business success.\n12. **Environmental Sustainability**: LLMs can help analyze and process large amounts of environmental data, providing insights that can inform sustainable practices, climate modeling, and conservation efforts.\n13. **Education and Learning**: LLMs can create personalized learning experiences, provide real-time feedback, and enhance student engagement, making education more effective and accessible.\n14. **Social Impact**: LLMs can help address social issues, such as misinformation, hate speech, and social bias, by analyzing and mitigating harmful language patterns.\n15. **Future of Work**: LLMs can augment human capabilities, enabling workers to focus on higher-value tasks, and potentially leading to the creation of new job categories and industries.\n\nIn summary, LLMs have the potential to transform various aspects of our lives, from improving customer experience and language understanding to driving scientific discovery and economic growth. As the technology continues to evolve, we can expect to see even more innovative applications and benefits emerge.\n"}],"source":"response = llm.complete(\"Explain the importance of LLMs\")\nprint(response)"},{"attachments":{},"cell_type":"markdown","id":"6a5ae4f5-2c14-4205-8afc-f244c94834da","metadata":{"language":"python"},"source":"### Crew AI requires a chat based model for binding"},{"cell_type":"code","execution_count":27,"id":"cef42da2-13be-425f-a8b9-11b0f5adf79a","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:10:08.555937Z","iopub.status.busy":"2024-07-13T15:10:08.555542Z","iopub.status.idle":"2024-07-13T15:10:08.793464Z","shell.execute_reply":"2024-07-13T15:10:08.793034Z","shell.execute_reply.started":"2024-07-13T15:10:08.555920Z"},"language":"python","trusted":true},"outputs":[],"source":"from langchain_openai import ChatOpenAI\n\n# Define your API key here\ngroq_api_key = \"Add Your Groq API Key\"\n\nchat_llm = ChatOpenAI(\n openai_api_base=\"https://api.groq.com/openai/v1\",\n openai_api_key=groq_api_key,\n model=\"llama3-70b-8192\",\n temperature=0,\n max_tokens=1000,\n)"},{"attachments":{},"cell_type":"markdown","id":"194bd374-b442-4be6-8553-27af9b422449","metadata":{"language":"python"},"source":"### Download data"},{"cell_type":"code","execution_count":28,"id":"39dc0e23-9e71-44dc-a555-018b5649d453","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:12:04.440187Z","iopub.status.busy":"2024-07-13T15:12:04.439700Z","iopub.status.idle":"2024-07-13T15:12:20.341494Z","shell.execute_reply":"2024-07-13T15:12:20.340977Z","shell.execute_reply.started":"2024-07-13T15:12:04.440170Z"},"language":"python","trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"--2024-07-13 15:12:04-- https://www.infosys.com/investors/reports-filings/annual-report/annual/documents/infosys-ar-23.pdf\nResolving www.infosys.com (www.infosys.com)... 23.9.129.136\nConnecting to www.infosys.com (www.infosys.com)|23.9.129.136|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: unspecified [application/pdf]\nSaving to: ‘infy_nav.pdf’\n\ninfy_nav.pdf [ <=> ] 12.52M 49.7MB/s in 0.3s \n\n2024-07-13 15:12:20 (49.7 MB/s) - ‘infy_nav.pdf’ saved [13133646]\n\n"}],"source":"!wget \"https://www.infosys.com/investors/reports-filings/annual-report/annual/documents/infosys-ar-23.pdf\" -O infy_nav.pdf"},{"attachments":{},"cell_type":"markdown","id":"31554985-5684-473b-b7c4-8fcccbd5438d","metadata":{"language":"python"},"source":"### Parse the content of the data"},{"cell_type":"code","execution_count":35,"id":"ee5510a5-ddab-4dfa-8ce7-de608f968e70","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:12:45.424823Z","iopub.status.busy":"2024-07-13T15:12:45.424341Z","iopub.status.idle":"2024-07-13T15:12:45.427201Z","shell.execute_reply":"2024-07-13T15:12:45.426829Z","shell.execute_reply.started":"2024-07-13T15:12:45.424808Z"},"language":"python","trusted":true},"outputs":[],"source":"from llama_index.core import SimpleDirectoryReader, VectorStoreIndex\nfrom llama_index.llms.openai import OpenAI\nimport os\nfrom langchain_openai import ChatOpenAI"},{"cell_type":"code","execution_count":36,"id":"2effa602-5e70-4760-97f6-885019163fc0","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:13:13.723298Z","iopub.status.busy":"2024-07-13T15:13:13.722903Z","iopub.status.idle":"2024-07-13T15:13:29.019650Z","shell.execute_reply":"2024-07-13T15:13:29.019272Z","shell.execute_reply.started":"2024-07-13T15:13:13.723282Z"},"language":"python","trusted":true},"outputs":[{"data":{"text/plain":"Document(id_='1fac8a5d-dce6-4f9b-a1ed-86e9bfcc52d4', embedding=None, metadata={'page_label': '2', 'file_name': 'infy_nav.pdf', 'file_path': 'infy_nav.pdf', 'file_type': 'application/pdf', 'file_size': 13133646, 'creation_date': '2024-07-13', 'last_modified_date': '2023-06-02'}, excluded_embed_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], excluded_llm_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], relationships={}, text='The context surrounding \\nan enterprise, created, \\nand influenced by multiple \\ninherently uncertain forces, can \\nsignificantly impact the fortunes \\nof a business. While this volatility \\nhas come to be expected as normal, \\nnot every business emerges from it having \\ntackled the situation with the same resilience. \\nThose that get a head start in preparing and taking \\non the challenges are also the ones that come out of the \\nuncertainty with the ability to outperform in the recovery.\\nThat does not necessarily mean rethinking one’s business \\nstrategy, but rather rearticulating it to adapt. It’s really about being judicious where to lean in and where to pull back. In essence, it’s about protecting one’s capability to innovate and propel forward while being deeply disciplined when it comes to operations. Digitally transformed companies have a distinct advantage here. They can drive frictionless business throughout the supply chain, serve customers at lower costs, and avoid resource-intensive IT upgrades, unlike the digitally disadvantaged who may have to wait for economic conditions to improve before they can make progress.\\nAdvanced technologies – especially AI in tandem with \\ncloud – are creating performance opportunities that are reshaping these dynamics in significant ways. They are helping companies to amplify human potential to take on higher value work, boost people productivity and rapidly create business value. From unlocking efficiencies at scale and empowering the ecosystem to accelerating growth, cognitively capable companies are unshackling intelligence from data for experimentation as well as the scale-out of AI to power greater efficacy and create disruptive revenue streams. \\nInfosys is taking the AI-first approach to its own \\ntransformation. We are bringing the power of AI, analytics, and cloud to accelerate our own enterprise transformation, even as we build incremental value from micro-changes, to improve client service, reimagine business processes, and boost productivity. Nearly 50,000 reusable intelligent services, applied in over 25,000 instances, are amplifying our employees to boost their productivity.\\nIt is Infosys Topaz\\nTM – our AI-first services using generative \\nAI – that’s making it all possible. Both for us and our clients. \\nToday, 12,000+ AI use cases and 150+ pre-trained AI models delivered by AI-first specialists and data strategists are accelerating business value for enterprises the world over. All this, while ensuring uncompromising ethics, trust, privacy and compliance, and security of data and AI.\\nYou’ll no doubt catch interesting glimpses of these exciting \\npossibilities and progress in this Integrated Annual Report. It’s the same potential we see too, to help our clients navigate change and move into a future filled with more potential, and more shared advances.NAVIGATING CHANGE AT THE PACE OF AI\\nInfosys Integrated Annual Report 2022-23 3', mimetype='text/plain', start_char_idx=None, end_char_idx=None, text_template='{metadata_str}\\n\\n{content}', metadata_template='{key}: {value}', metadata_seperator='\\n')"},"execution_count":36,"metadata":{},"output_type":"execute_result"}],"source":"reader = SimpleDirectoryReader(input_files=[\"infy_nav.pdf\"])\ndocs = reader.load_data()\ndocs[1]"},{"attachments":{},"cell_type":"markdown","id":"22b6af2e-989b-48bd-8862-c24366b2a7fc","metadata":{"language":"python"},"source":"### Setup the embedding model"},{"cell_type":"code","execution_count":37,"id":"078d97e0-4f92-44ec-af5f-c4b4795bfa64","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:13:46.364111Z","iopub.status.busy":"2024-07-13T15:13:46.363694Z","iopub.status.idle":"2024-07-13T15:13:46.871065Z","shell.execute_reply":"2024-07-13T15:13:46.870645Z","shell.execute_reply.started":"2024-07-13T15:13:46.364096Z"},"language":"python","trusted":true},"outputs":[],"source":"from llama_index.embeddings.huggingface import HuggingFaceEmbedding"},{"cell_type":"code","execution_count":38,"id":"bd6731f6-f58b-44a2-8b8a-bcb65aa58915","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:13:56.746082Z","iopub.status.busy":"2024-07-13T15:13:56.745453Z","iopub.status.idle":"2024-07-13T15:13:57.129961Z","shell.execute_reply":"2024-07-13T15:13:57.129550Z","shell.execute_reply.started":"2024-07-13T15:13:56.746063Z"},"language":"python","trusted":true},"outputs":[],"source":"embed_model = HuggingFaceEmbedding(model_name=\"BAAI/bge-small-en-v1.5\")"},{"attachments":{},"cell_type":"markdown","id":"ea54122a-c910-48ad-8ae9-a36947c7846e","metadata":{"language":"python"},"source":"### Build Index"},{"cell_type":"code","execution_count":39,"id":"c523e4d8-9591-46d6-9c30-280082af53e0","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:14:09.330586Z","iopub.status.busy":"2024-07-13T15:14:09.330188Z","iopub.status.idle":"2024-07-13T15:16:12.819804Z","shell.execute_reply":"2024-07-13T15:16:12.819343Z","shell.execute_reply.started":"2024-07-13T15:14:09.330570Z"},"language":"python","trusted":true},"outputs":[],"source":"index = VectorStoreIndex.from_documents(docs,\n embed_model=embed_model,\n )"},{"attachments":{},"cell_type":"markdown","id":"24a7ac1e-a023-409e-b23c-d4508a3d41bc","metadata":{"language":"python"},"source":"### Build the Query Engine"},{"cell_type":"code","execution_count":44,"id":"7ee3af6a-3b04-484c-9f08-e85bd3a941b9","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:16:20.219977Z","iopub.status.busy":"2024-07-13T15:16:20.219708Z","iopub.status.idle":"2024-07-13T15:16:20.222845Z","shell.execute_reply":"2024-07-13T15:16:20.222446Z","shell.execute_reply.started":"2024-07-13T15:16:20.219961Z"},"language":"python","trusted":true},"outputs":[],"source":"query_engine = index.as_query_engine(similarity_top_k=5, llm=llm)"},{"attachments":{},"cell_type":"markdown","id":"c9b7c31d-f1e1-4db5-9038-72e2e64b4d6a","metadata":{"language":"python"},"source":"### Instantiate the query engine as a Tool"},{"cell_type":"code","execution_count":49,"id":"fdc08424-83f7-4c67-acae-baf881cb9c7d","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:18:42.615015Z","iopub.status.busy":"2024-07-13T15:18:42.614643Z","iopub.status.idle":"2024-07-13T15:18:43.046354Z","shell.execute_reply":"2024-07-13T15:18:43.045916Z","shell.execute_reply.started":"2024-07-13T15:18:42.614999Z"},"language":"python","trusted":true},"outputs":[],"source":"from crewai_tools import LlamaIndexTool\nquery_tool = LlamaIndexTool.from_query_engine(\n query_engine,\n name=\"infy Query Tool\",\n description=\"Use this tool to lookup the 2022-23 Infosys Annual Report\",\n)"},{"cell_type":"code","execution_count":50,"id":"beb116b7-c3e5-4ea2-acaa-da8a03e26c1a","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:18:54.122036Z","iopub.status.busy":"2024-07-13T15:18:54.121091Z","iopub.status.idle":"2024-07-13T15:18:54.125105Z","shell.execute_reply":"2024-07-13T15:18:54.124758Z","shell.execute_reply.started":"2024-07-13T15:18:54.122016Z"},"language":"python","trusted":true},"outputs":[{"data":{"text/plain":"{'title': 'QueryToolSchema',\n 'description': 'Schema for query tool.',\n 'type': 'object',\n 'properties': {'query': {'title': 'Query',\n 'description': 'Search query for the query tool.',\n 'type': 'string'}},\n 'required': ['query']}"},"execution_count":50,"metadata":{},"output_type":"execute_result"}],"source":"query_tool.args_schema.schema()"},{"attachments":{},"cell_type":"markdown","id":"236c897d-7d26-4cef-82ba-e64b6d8f1a0d","metadata":{"language":"python"},"source":"### Instantiate Researcher and Writer Agents"},{"cell_type":"code","execution_count":51,"id":"b2b08bfc-537d-4395-a9b8-12c76800d2a2","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:19:09.731479Z","iopub.status.busy":"2024-07-13T15:19:09.731233Z","iopub.status.idle":"2024-07-13T15:19:11.189186Z","shell.execute_reply":"2024-07-13T15:19:11.188726Z","shell.execute_reply.started":"2024-07-13T15:19:09.731465Z"},"language":"python","trusted":true},"outputs":[],"source":"import os\nfrom crewai import Agent, Task, Crew, Process"},{"cell_type":"code","execution_count":56,"id":"8f722f60-0ee1-42b6-9cac-d70771507a35","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:20:35.738510Z","iopub.status.busy":"2024-07-13T15:20:35.738080Z","iopub.status.idle":"2024-07-13T15:20:35.744053Z","shell.execute_reply":"2024-07-13T15:20:35.743618Z","shell.execute_reply.started":"2024-07-13T15:20:35.738494Z"},"language":"python","trusted":true},"outputs":[],"source":"researcher = Agent(\n role=\"Lead Financial Analyst\",\n goal=\"Uncover insights about different tech companies\",\n backstory=\"\"\"You work at an asset management firm.\n Your goal is to understand tech stocks like Infosys.\"\"\",\n verbose=True,\n allow_delegation=False,\n tools=[query_tool],\n llm=chat_llm,\n)\nwriter = Agent(\n role=\"Tech Content Strategist\",\n goal=\"Craft compelling content on tech advancements\",\n backstory=\"\"\"You are a renowned Content Strategist, known for your insightful and engaging articles.\n You transform complex concepts into compelling narratives.\"\"\",\n llm=chat_llm,\n verbose=True,\n allow_delegation=False,\n)"},{"attachments":{},"cell_type":"markdown","id":"1844a679-fc85-4a33-a745-6d05c3ca3421","metadata":{"language":"python"},"source":"### Define respective tasks"},{"cell_type":"code","execution_count":61,"id":"f9d737a6-3561-4a2d-87e3-cb75364f127d","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:25:14.419058Z","iopub.status.busy":"2024-07-13T15:25:14.418508Z","iopub.status.idle":"2024-07-13T15:25:14.422448Z","shell.execute_reply":"2024-07-13T15:25:14.422069Z","shell.execute_reply.started":"2024-07-13T15:25:14.419042Z"},"language":"python","trusted":true},"outputs":[],"source":"task1 = Task(\n description=\"\"\"Conduct a comprehensive analysis of Infosys's use of artificial intelligence in their integrated annual report 2022-23.\"\"\",\n expected_output=\"Full analysis report in bullet points\",\n agent=researcher,\n)\n\ntask2 = Task(\n description=\"\"\"Using the insights provided, develop an engaging blog\n post that highlights the importance of artificial intelligence at Infosys.\n Your post should be informative yet accessible, catering to a casual audience.\n Make it sound cool, avoid complex words.\"\"\",\n expected_output=\"Full blog post of at least 4 paragraphs\",\n agent=writer,\n)"},{"attachments":{},"cell_type":"markdown","id":"27fbbee5-a050-4cf0-bb55-45e4ff1736e3","metadata":{"language":"python"},"source":"### Instantiate the Crew with a sequential process"},{"cell_type":"code","execution_count":62,"id":"3e251504-9969-42ec-a2d5-a688292c1908","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:25:29.978618Z","iopub.status.busy":"2024-07-13T15:25:29.978054Z","iopub.status.idle":"2024-07-13T15:25:29.984067Z","shell.execute_reply":"2024-07-13T15:25:29.983698Z","shell.execute_reply.started":"2024-07-13T15:25:29.978603Z"},"language":"python","trusted":true},"outputs":[],"source":"crew = Crew(\n agents=[researcher, writer],\n tasks=[task1, task2],\n verbose=2, # You can set it to 1 or 2 to different logging levels\n)"},{"attachments":{},"cell_type":"markdown","id":"477f67b2-92e6-4220-892c-2df5a856a7ee","metadata":{"language":"python"},"source":"### Initiate the agent workflow: Let the magic begin!"},{"cell_type":"code","execution_count":63,"id":"5e852d0c-32da-44dd-8429-44331a2a6719","metadata":{"execution":{"iopub.execute_input":"2024-07-13T15:25:42.636581Z","iopub.status.busy":"2024-07-13T15:25:42.636100Z","iopub.status.idle":"2024-07-13T15:29:25.574205Z","shell.execute_reply":"2024-07-13T15:29:25.573771Z","shell.execute_reply.started":"2024-07-13T15:25:42.636565Z"},"language":"python","trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":"\u001b[1m\u001b[95m [2024-07-13 15:25:42][DEBUG]: == Working Agent: Lead Financial Analyst\u001b[00m\n\u001b[1m\u001b[95m [2024-07-13 15:25:42][INFO]: == Starting Task: Conduct a comprehensive analysis of Infosys's use of artificial intelligence in their integrated annual report 2022-23.\u001b[00m\n\n\n\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n\u001b[32;1m\u001b[1;3mThought: I need to understand Infosys's use of artificial intelligence in their integrated annual report 2022-23, so I should start by looking up the 2022-23 Infosys Annual Report.\n\nAction: infy Query Tool\nAction Input: {\"query\": \"2022-23 Infosys Annual Report\"}\u001b[0m\u001b[95m \n\nThe provided context information appears to be the Infosys Integrated Annual Report for 2022-23.\n\u001b[00m\n\u001b[32;1m\u001b[1;3mThought: Now that I have the 2022-23 Infosys Annual Report, I should search for keywords related to artificial intelligence to understand Infosys's use of AI.\n\nAction: infy Query Tool\nAction Input: {\"query\": \"artificial intelligence\"}\u001b[0m\u001b[95m \n\nIn today's uncertain landscape, companies must become more resilient and adaptable to thrive. Infosys is embracing this era of optionality by leveraging advanced digital technologies like AI and cloud to imagine and execute multiple options for the future. Our AI-first strategy enables us to continually transform and innovate, architecting for challenges that may emerge in the future. With Infosys Topaz, we're bringing the power of AI to our clients, helping them accelerate business value and amplify human potential.\n\u001b[00m\n\u001b[32;1m\u001b[1;3mThought: I need to understand more about Infosys Topaz and its role in Infosys's AI strategy.\n\nAction: infy Query Tool\nAction Input: {\"query\": \"Infosys Topaz\"}\u001b[0m\u001b[95m \n\nInfosys Topaz is a set of capabilities in generative artificial intelligence that enhance how Infosys enables clients to derive value. These capabilities are available to all clients.\n\u001b[00m\n\u001b[32;1m\u001b[1;3mThought: I need to understand more about Infosys's AI strategy and how it is being implemented across the organization.\n\nAction: infy Query Tool\nAction Input: {\"query\": \"AI strategy\"}\u001b[0m\u001b[95m \n\nInfosys is taking an AI-first approach to its own transformation, bringing the power of AI, analytics, and cloud to accelerate its enterprise transformation. Infosys Topaz, an AI-first service using generative AI, is making it possible.\n\u001b[00m\n\u001b[32;1m\u001b[1;3mThought: I need to understand more about how Infosys is using AI to accelerate business value for its clients.\n\nAction: infy Query Tool\nAction Input: {\"query\": \"accelerate business value\"}\u001b[0m\u001b[95m \n\nTo accelerate business value, Infosys focuses on broad-based growth to reduce concentration in any single region, client, or industry, and operational agility to assess and respond to situations, including enablement of remote working and working out of multiple DCs/locations. Additionally, the company invests in research and development, has a robust alliance strategy, and develops innovative new offerings to customers leveraging next-generation technologies.\n\u001b[00m\n\u001b[32;1m\u001b[1;3mThought: I now know the final answer\nFinal Answer: \n\nHere is a comprehensive analysis of Infosys's use of artificial intelligence in their integrated annual report 2022-23:\n\n• Infosys is embracing the era of optionality by leveraging advanced digital technologies like AI and cloud to imagine and execute multiple options for the future.\n• The company has an AI-first strategy that enables it to continually transform and innovate, architecting for challenges that may emerge in the future.\n• Infosys Topaz is a set of capabilities in generative artificial intelligence that enhance how Infosys enables clients to derive value.\n• Infosys Topaz is available to all clients and is making it possible for the company to bring the power of AI to its clients, helping them accelerate business value and amplify human potential.\n• Infosys is taking an AI-first approach to its own transformation, bringing the power of AI, analytics, and cloud to accelerate its enterprise transformation.\n• The company is using AI to accelerate business value for its clients by focusing on broad-based growth, operational agility, and investing in research and development.\n• Infosys has a robust alliance strategy and develops innovative new offerings to customers leveraging next-generation technologies.\n• The company's AI strategy is implemented across the organization, enabling it to respond to situations, including enablement of remote working and working out of multiple DCs/locations.\u001b[0m\n\n\u001b[1m> Finished chain.\u001b[0m\n\u001b[1m\u001b[92m [2024-07-13 15:29:17][DEBUG]: == [Lead Financial Analyst] Task output: Here is a comprehensive analysis of Infosys's use of artificial intelligence in their integrated annual report 2022-23:\n\n• Infosys is embracing the era of optionality by leveraging advanced digital technologies like AI and cloud to imagine and execute multiple options for the future.\n• The company has an AI-first strategy that enables it to continually transform and innovate, architecting for challenges that may emerge in the future.\n• Infosys Topaz is a set of capabilities in generative artificial intelligence that enhance how Infosys enables clients to derive value.\n• Infosys Topaz is available to all clients and is making it possible for the company to bring the power of AI to its clients, helping them accelerate business value and amplify human potential.\n• Infosys is taking an AI-first approach to its own transformation, bringing the power of AI, analytics, and cloud to accelerate its enterprise transformation.\n• The company is using AI to accelerate business value for its clients by focusing on broad-based growth, operational agility, and investing in research and development.\n• Infosys has a robust alliance strategy and develops innovative new offerings to customers leveraging next-generation technologies.\n• The company's AI strategy is implemented across the organization, enabling it to respond to situations, including enablement of remote working and working out of multiple DCs/locations.\n\n\u001b[00m\n\u001b[1m\u001b[95m [2024-07-13 15:29:17][DEBUG]: == Working Agent: Tech Content Strategist\u001b[00m\n\u001b[1m\u001b[95m [2024-07-13 15:29:17][INFO]: == Starting Task: Using the insights provided, develop an engaging blog\n post that highlights the importance of artificial intelligence at Infosys.\n Your post should be informative yet accessible, catering to a casual audience.\n Make it sound cool, avoid complex words.\u001b[00m\n\n\n\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n\u001b[32;1m\u001b[1;3mI now can give a great answer!\n\nFinal Answer:\n\n**\"Revolutionizing the Future: How Infosys is Leading the Charge with Artificial Intelligence\"**\n\nIn today's fast-paced digital landscape, the ability to adapt and innovate is crucial for businesses to stay ahead of the curve. Infosys, a global leader in technology services, is embracing the era of optionality by harnessing the power of artificial intelligence (AI) to imagine and execute multiple options for the future. With an AI-first strategy, Infosys is continually transforming and innovating, architecting for challenges that may emerge in the future.\n\nAt the heart of Infosys's AI strategy is Topaz, a set of capabilities in generative artificial intelligence that enhances how the company enables clients to derive value. This cutting-edge technology is available to all clients, empowering them to accelerate business value and amplify human potential. By leveraging Topaz, Infosys is bringing the power of AI to its clients, helping them navigate complex business challenges and stay ahead of the competition.\n\nBut Infosys's AI journey doesn't stop there. The company is taking an AI-first approach to its own transformation, harnessing the power of AI, analytics, and cloud to accelerate its enterprise transformation. By leveraging AI, Infosys is able to focus on broad-based growth, operational agility, and investing in research and development, ultimately driving business value for its clients. With a robust alliance strategy and innovative new offerings, Infosys is developing solutions that cater to the unique needs of its clients, leveraging next-generation technologies to drive success.\n\nThe impact of Infosys's AI strategy is far-reaching, with the company's ability to respond to situations, including enablement of remote working and working out of multiple DCs/locations. This has enabled Infosys to stay agile and adaptable, even in the face of uncertainty. As the company continues to push the boundaries of what is possible with AI, one thing is clear: Infosys is leading the charge in the AI revolution, and its clients are set to reap the benefits. With its AI-first approach, Infosys is revolutionizing the future of business, and we can't wait to see what's next.\u001b[0m\n\n\u001b[1m> Finished chain.\u001b[0m\n\u001b[1m\u001b[92m [2024-07-13 15:29:25][DEBUG]: == [Tech Content Strategist] Task output: **\"Revolutionizing the Future: How Infosys is Leading the Charge with Artificial Intelligence\"**\n\nIn today's fast-paced digital landscape, the ability to adapt and innovate is crucial for businesses to stay ahead of the curve. Infosys, a global leader in technology services, is embracing the era of optionality by harnessing the power of artificial intelligence (AI) to imagine and execute multiple options for the future. With an AI-first strategy, Infosys is continually transforming and innovating, architecting for challenges that may emerge in the future.\n\nAt the heart of Infosys's AI strategy is Topaz, a set of capabilities in generative artificial intelligence that enhances how the company enables clients to derive value. This cutting-edge technology is available to all clients, empowering them to accelerate business value and amplify human potential. By leveraging Topaz, Infosys is bringing the power of AI to its clients, helping them navigate complex business challenges and stay ahead of the competition.\n\nBut Infosys's AI journey doesn't stop there. The company is taking an AI-first approach to its own transformation, harnessing the power of AI, analytics, and cloud to accelerate its enterprise transformation. By leveraging AI, Infosys is able to focus on broad-based growth, operational agility, and investing in research and development, ultimately driving business value for its clients. With a robust alliance strategy and innovative new offerings, Infosys is developing solutions that cater to the unique needs of its clients, leveraging next-generation technologies to drive success.\n\nThe impact of Infosys's AI strategy is far-reaching, with the company's ability to respond to situations, including enablement of remote working and working out of multiple DCs/locations. This has enabled Infosys to stay agile and adaptable, even in the face of uncertainty. As the company continues to push the boundaries of what is possible with AI, one thing is clear: Infosys is leading the charge in the AI revolution, and its clients are set to reap the benefits. With its AI-first approach, Infosys is revolutionizing the future of business, and we can't wait to see what's next.\n\n\u001b[00m\n######################\n**\"Revolutionizing the Future: How Infosys is Leading the Charge with Artificial Intelligence\"**\n\nIn today's fast-paced digital landscape, the ability to adapt and innovate is crucial for businesses to stay ahead of the curve. Infosys, a global leader in technology services, is embracing the era of optionality by harnessing the power of artificial intelligence (AI) to imagine and execute multiple options for the future. With an AI-first strategy, Infosys is continually transforming and innovating, architecting for challenges that may emerge in the future.\n\nAt the heart of Infosys's AI strategy is Topaz, a set of capabilities in generative artificial intelligence that enhances how the company enables clients to derive value. This cutting-edge technology is available to all clients, empowering them to accelerate business value and amplify human potential. By leveraging Topaz, Infosys is bringing the power of AI to its clients, helping them navigate complex business challenges and stay ahead of the competition.\n\nBut Infosys's AI journey doesn't stop there. The company is taking an AI-first approach to its own transformation, harnessing the power of AI, analytics, and cloud to accelerate its enterprise transformation. By leveraging AI, Infosys is able to focus on broad-based growth, operational agility, and investing in research and development, ultimately driving business value for its clients. With a robust alliance strategy and innovative new offerings, Infosys is developing solutions that cater to the unique needs of its clients, leveraging next-generation technologies to drive success.\n\nThe impact of Infosys's AI strategy is far-reaching, with the company's ability to respond to situations, including enablement of remote working and working out of multiple DCs/locations. This has enabled Infosys to stay agile and adaptable, even in the face of uncertainty. As the company continues to push the boundaries of what is possible with AI, one thing is clear: Infosys is leading the charge in the AI revolution, and its clients are set to reap the benefits. With its AI-first approach, Infosys is revolutionizing the future of business, and we can't wait to see what's next.\n"}],"source":"result = crew.kickoff()\n\nprint(\"######################\")\nprint(result)"},{"cell_type":"code","execution_count":null,"id":"323015f7-16e6-43d8-97dc-24dd43bb19e9","metadata":{"language":"python","trusted":true},"outputs":[],"source":""}],"metadata":{"jupyterlab":{"notebooks":{"version_major":6,"version_minor":4}},"kernelspec":{"display_name":"Python 3 (ipykernel)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.11.6"},"singlestore_cell_default_language":"python","singlestore_connection":{"connectionID":"a22b6f8b-b11b-4979-98da-98513e9876e6","defaultDatabase":""},"singlestore_row_limit":300},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Creating a Multi-Agent AI System 2 | ### This is a financial analyst agent using CrewAI, LlamaIndex & Groq. 3 | --------------------------------------------------------------------------------