GENERATIVE-AI-ENGINEER-ASSOCIATE practice question 13 of 15

A Generative AI Engineer is creating an LLM-powered application that will need access to up-to-date news articles and stock prices. The design requires the use of stock prices which are stored in Delta tables and finding the latest relevant news articles by searching the internet. How should the Generative AI Engineer architect their LLM system?

Full set: 61 questions
Answer options
A: Use an LLM to summarize the latest news articles and lookup stock tickers from the summaries to find stock prices.
B: Query the Delta table for volatile stock prices and use an LLM to generate a search query to investigate potential causes of the stock volatility.
C: Download and store news articles and stock price information in a vector store. Use a RAG architecture to retrieve and generate at runtime.
D: Create an agent with tools for SQL querying of Delta tables and web searching, provide retrieved values to an LLM for generation of response. Correct answer
Correct Answer:
D. Create an agent with tools for SQL querying of Delta tables and web searching, provide retrieved values to an LLM for generation of response.
Explanation

The scenario requires the LLM system to perform actions on external, real-time data sources: querying a structured database (Delta tables) and searching the unstructured web. An agent-based architecture is the most suitable design pattern for this. An LLM agent uses a reasoning engine to determine which "tools" to use to fulfill a request. In this case, the engineer would create a tool for executing SQL queries against the Delta tables and another tool for performing web searches. The agent would then orchestrate these tools, retrieve the necessary real-time data, and provide it as context to the LLM to generate a final, informed response.

Why Incorrect

A. This describes a specific, linear workflow, not a flexible system architecture. It fails to explain how the LLM initially accesses the "latest news articles" from the web.
B. This is another example of a specific use case (investigating volatility) rather than a robust, general-purpose architecture that can handle various queries about news and stocks.
C. A RAG architecture with a vector store is ill-suited for highly dynamic, real-time data like stock prices and breaking news due to the latency and cost of continuous ingestion and indexing.

References

1. Databricks Documentation, "LLM agent on Databricks": This documentation explains the concept of LLM agents, stating, "An agent has access to a set of tools and can reason through which tools to use in which order to answer a question." It explicitly mentions tools for looking up data in a database or accessing a web API, which directly maps to the question's requirements.

Source: Databricks Official Documentation > Machine Learning > Generative AI and LLMs > LLM agent on Databricks.

2. Databricks E-book, "The Big Book of MLOps": In the chapter on LLMOps, the book distinguishes between different LLM application patterns. It describes agentic workflows as systems that "can take actions, such as querying a database, calling an API, or running a piece of code." This aligns perfectly with the need to query Delta tables and search the web.

Source: Databricks E-books, "The Big Book of MLOps", Chapter 6: LLMOps, Section: "Common LLM Application Patterns".

3. Databricks Blog, "Building a Q&A Bot on Your Own Data With Llama 2 & Databricks": While focused on RAG, this article implicitly highlights its limitations for real-time data. It states RAG is for "asking questions of your own private data," which is typically a static or semi-static corpus. This contrasts with the agent pattern needed for live, external data sources like web search and real-time databases.

Source: Databricks Official Blog, August 2, 2023, "Building a Q&A Bot on Your Own Data With Llama 2 & Databricks".

Scroll to Top