Build an AI Research Agent: Apoorva Joshi
Science & Technology
Introduction
Hello everyone, and welcome to this workshop I like to call "The A to Z of Building AI Agents." During this session, we will spend approximately 20 to 30 minutes discussing the foundational concepts of AI agents, when to utilize them, their various components, and important concepts that will aid you during the hands-on portion of the workshop. Following this introduction, attendees will have the chance to build their own AI agents, with support from myself and my fantastic team members: Tom, Ben, and Fabian.
To introduce myself, I'm Apoorva Joshi, your lead instructor for today. Five months ago, I transitioned into my first role as a developer advocate at MongoDB. Prior to this, I worked for six years as a data scientist specializing in cybersecurity, focusing on machine learning applications for issues like phishing detection, malware, and ransomware identification. Outside of my professional work, I enjoy reading, practicing yoga, and discovering local coffee shops.
Workshop Overview
Let's kick things off with some basic ground rules: There are no stupid questions; we're all here to learn, so please ask anything you like. We'll cover key concepts before diving into our hands-on labs, and I encourage you to break into groups to collaborate where possible. At your tables, you’ll find a link and QR code to the slides and hands-on lab material. If you need a postcard with the QR code, don't hesitate to raise your hand.
The goal of this workshop is to familiarize you with the fundamental concepts of AI agents and provide hands-on experience in building an agent from start to finish. We'll begin by defining AI agents, discussing their use cases, exploring key components, and working together to construct an AI research agent. Depending on time, we may have a Q&A section at the end.
Understanding AI Agents
So, what is an AI agent? An AI agent is a system that leverages a large language model (LLM) to reason through a problem, devise a plan for resolution, and execute the plan using a set of tools. Distinctions between AI agents and other LLM interaction methods will help clarify when to use AI agents.
Simple Prompting: This method involves querying the LLM directly for information, which works well for straightforward questions but is limited in scope and depth.
Retrieval-Augmented Generation (RAG): RAG broadens LLM capabilities by integrating external knowledge from a database, but it still may not handle complex tasks effectively.
AI Agents: By giving LLMs access to external tools and retaining past interactions, agents provide iterative reasoning and action steps, allowing them to tackle complex, multi-stage tasks and offer personalized responses over time.
When deciding if a task necessitates an AI agent, consider the complexity and need for personalization. Simple inquiries may not require agents, while tasks needing multi-step solutions and integration across capabilities will benefit greatly.
Components of AI Agents
Planning and Reasoning: Agents discern their path forward through logical reasoning, with strategies like Chain of Thought and Tree of Thought for breakdown and evaluation.
Memory: Memory allows agents to store and recall conversations, leading to personalized interactions through both short-term and long-term memory.
Tools: Tools enable agents to interact with the outside world effectively, thereby facilitating the achievement of their objectives.
In today's exercise, we will build an AI research agent that offers research assistance by providing lists of papers, summarizing them, and answering relevant questions related to research topics. Our agent will utilize a free and open-source model, Fire Function V1.
Hands-on Workshop
The hands-on portion involves several tasks, beginning with setting up the development environment and prerequisites. Here, we will explore various libraries and concepts like datasets, document loaders, and tools for building and managing our agent.
You will eventually create tools using LangChain—an essential component of our agent for retrieving research papers, summarizing content, and maintaining chat history in MongoDB.
Once we set up the tools, we'll dive into developing the agent, implementing reasoning patterns, and integrating memory.
Final Steps and Feedback
As we conclude, we will finalize the AI research agent by adding short-term memory features, which will enhance its functionality and user experience.
I appreciate any feedback to improve this workshop for future sessions. Thank you for being here today!
Keywords: AI agents, large language models, MongoDB, research assistance, Chain of Thought, memory, tool integration, LangChain, workshops
FAQ
What is the goal of the workshop?
The goal is to introduce participants to AI agents and provide hands-on experience in building one from scratch.What are AI agents and how do they differ from traditional methods?
AI agents use LLMs to reason, plan, and execute tasks using tools, while traditional methods may simply query the LLM without any iterative logic.What components will we implement in our AI agent?
The agent will include elements like planning and reasoning, memory management, and tool integration.What hands-on experience will we have?
Participants will set up their development environment, create tools for the agent, and implement reasoning patterns as part of building the AI research agent.How can we provide feedback?
Participants can fill out a short survey provided during the session to share their experiences and suggestions.