Define tools
We first need to create the Passio NutritionAI tool.Passio Nutrition AI
We have a built-in tool in LangChain to easily use Passio NutritionAI to find food nutrition facts. Note that this requires an API key - they have a free tier. Once you create your API key, you will need to export that as:dotenv package. You an also explicitly control the key via constructor calls.
Tools
Now that we have the tool, we can create a list of tools that we will use downstream.Create the agent
Now that we have defined the tools, we can create the agent. We will be using an OpenAI Functions agent - for more information on this type of agent, as well as other options, see this guide First, we choose the LLM we want to be guiding the agent.Run the agent
We can now run the agent on a few queries! Note that for now, these are all stateless queries (it won’t remember previous interactions).Conclusion
That’s a wrap! In this quick start we covered how to create a simple agent that is able to incorporate food-nutrition information into its answers. Agents are a complex topic, and there’s lot to learn!Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.