AskReference
ProcessIntermediate

How does the Chef agent use the FAISS tool to respond to a user query like 'I want to use eggplants and tomatoes'?

For a query like "I want to use eggplants and tomatoes", the Chef agent recognizes that the user is offering ingredients and autonomously decides to invoke its toolified FAISS retriever. The FAISS tool searches the cookbook vector database for relevant recipe chunks mentioning those ingredients. After reading the retrieved chunks, the agent responds with the matching Italian Cook Book recipe, staying faithful to the source and not inventing content.

The Chef agent is an Agent component in Langflow that has been connected to a FAISS component set to Tool Mode. This toolified FAISS retriever searches the same vector database built earlier, using the index name 'cookbook' and an OpenAI embeddings component. The agent's instructions tell it to search the cookbook either by specific recipe names or by user-provided ingredients and to rely strictly on The Italian Cook Book by Maria Gentile (1919) as its only source of truth. So when a user says "I want to use eggplants and tomatoes", the agent reasons about the request, calls the FAISS tool to find recipe chunks that match those ingredients, reads the returned chunks, and then composes a structured response with the recipe's title, ingredients, and preparation steps. If no suitable recipe is found, the agent is instructed to clearly say the request cannot be fulfilled using the cookbook.

Key points

  • The Chef agent is connected to a FAISS component that has been enabled as a tool through Tool Mode.
  • The FAISS tool uses the same 'cookbook' vector database and an OpenAI embeddings component to retrieve relevant chunks.
  • The agent's prompt instructs it to search by recipe names or by ingredients the user provides.
  • When given 'eggplants and tomatoes', the agent autonomously decides to invoke the FAISS tool and then reads the retrieved chunks.
  • The agent returns the recipe in a structured format with title, ingredients, and preparation steps, without inventing or modifying recipes.
Source:AI Agents and Applications· Implementing agentic structures· p. 158–166

Related questions

Cover of AI Agents and Applications

AI Agents and Applications

Andrea De Mauro

MEAP Edition Version 7 · Manning Publications

View this ebook