WhoBuilt

Build an AI Research Agent

Oct 25, 2024· 28 min· 19K views·Watch on YouTube

Speaker

Apoorva Joshi, a developer advocate at MongoDB with a background in cybersecurity data science, leads an AI Engineer workshop on building an AI research agent.

When agents are useful

Joshi defines an AI agent as an LLM that plans and uses tools to solve a problem. Simple prompting suits general knowledge questions, while RAG can answer from a knowledge base. Agents are a better fit for multi-step work, such as analyzing calorie trends and making a graph, or adapting a learning assistant to a student over time.

Planning, reasoning, and memory

Joshi distinguishes planning without feedback from approaches that refine plans using tool results. She covers Chain of Thought, Tree of Thoughts, ReAct, and reflection as ways to guide reasoning and action. She also describes short-term memory for a conversation and long-term memory for personalization across conversations, noting that long-term memory requires choosing what information to track and when to update it.

Tools and the research agent

Tools let agents interact with external services through functions described with names, descriptions, and argument types. The workshop project is a research assistant that finds papers, summarizes them, and answers questions using a MongoDB knowledge base. Its planned components include Fireworks FireFunction V1, three tools, and short-term chat memory stored in MongoDB.

Building the agent in LangChain

Joshi walks through workshop components including arXiv document loading, PyMongo, MongoDB Atlas as a vector store, Hugging Face embeddings, and LangChain Expression Language. Participants create tools, then build tool-calling and ReAct agents. An agent executor runs the chosen tools and returns their results to the agent, while RunnableWithMessageHistory connects chat history to MongoDB using a session ID.

Takeaways

  • Use simple prompting for general knowledge and RAG for answers grounded in a specific knowledge base.
  • Choose agents when a task needs multiple steps, tool use, analysis, or personalization.
  • Use feedback from tools to let an agent adjust its next action.
  • Design long-term memory around the specific information an application needs to retain.
  • Describe tools clearly so an LLM can select the right function and provide its arguments.

Mentioned in this talk

Search inside this talk

What was claimed 10

Show all 10 facts

Related talks