1Z0-1157-26 practice question 8 of 10
You are implementing an AI agent using LangChain that must retrieve product information from a database and compose recommendations. The agent needs to handle cases where the product database is temporarily unavailable. Which LangChain core abstractions should you combine to accomplish this, and what is the correct flow?
Full set: 67 questionsIn LangChain, agents decouple reasoning from execution by using a chat model as the reasoning engine and wrapping external capabilities as standardized tools. When connecting to an external database that may experience transient failures, best practices dictate encapsulating the database client logic inside a tool function that incorporates explicit retry strategies and error handling. The agent orchestration loop evaluates user input, decides when to call the database tool, receives the tool's execution results or fallback responses, and synthesizes a recommendation. This abstraction maintains system resilience while allowing the language model to dynamically decide execution timing based on conversational context.
B: Hard-coding recommendations in prompt templates prevents dynamic data fetching and fails when database product inventories change frequently. C: Storing product data inside system prompts causes context window overflow and cannot accommodate real-time, large-scale database lookup requirements. D: Large language models cannot natively connect directly to database servers without an intermediary tool wrapper that handles API execution. E: LangChain agents support robust error handling and retry mechanisms within tool implementations and agent control loops.
- LangChain Documentation: Agents, Tools, and Custom Tool Integration with Retry Strategies. https://python.langchain.com/docs/modules/agents/
- Oracle Developer Documentation: Integrating Generative AI and LLM Orchestration Frameworks with Autonomous Databases.
- Chase, H. (2022). LangChain Framework for Large Language Model Applications. https://github.com/langchain-ai/langchain
Keep practicing
Take the free 1Z0-1157-26 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-1157-26 practice questions
- Question 1You are designing a healthcare AI agent using the OpenAI Agents SDK that must handle pati…
- Question 2Assume an agent has access to the tools multiply(a, b) and divide(a, b). A user asks: "Wh…
- Question 3You are implementing a financial reconciliation AI agent using LangChain. The agent needs…
- Question 4How do On-Demand serving and Dedicated AI Clusters differ for OCI Enterprise AI Models?
- Question 5In the context of MCP, what does the "USB-C for AI" analogy emphasize?
- Question 6Your organization is building an autonomous customer support agent that must handle finan…
