Application development Study Guide — Generative AI Engineer Associate

30% of the exam · domain 3 of 6 · Databricks Generative AI Engineer Associate · Free Application development practice questions

0 of 36 topics covered
What the exam asks here — tap to tick off0 / 8 covered
Domain 3 of 6

Application Development on Databricks Generative AI

This domain tests your ability to design, build, and deploy production-grade generative AI applications on Databricks—including RAG pipelines, LangChain integrations, agent systems, and model serving patterns. It covers the full stack from vector indexing through prompt engineering to MLflow packaging. At 30% of the exam, this is the highest-weighted domain and the primary differentiator between passing and failing candidates.


Mosaic AI Vector Search: Creating and Querying Indexes

Mosaic AI Vector Search is Databricks' managed vector database service, tightly integrated with Unity Catalog and Delta Lake. It stores and queries high-dimensional embeddings for similarity search.

Index Types

Index TypeSourceSync ModeWhen to Use
Delta Sync IndexDelta table (Unity Catalog)Automatic (triggered or continuous)Production RAG; source data changes regularly
Direct Vector Access IndexAPI write onlyManual via APICustom pipelines; non-Delta sources
  • Delta Sync Index – Triggered: syncs on demand (via API call or schedule). Lower cost.
  • Delta Sync Index – Continuous: streams changes in near-real-time. Higher cost but fresher data.
  • Direct Vector Access Index: embeddings are written and updated entirely through the Vector Search API; no Delta table backing.

Creating an Index (Key Parameters)

client.create_delta_sync_index(
    endpoint_name="vs_endpoint",
    index_name="catalog.schema.my_index",
    source_table_name="catalog.schema.source_table",
    pipeline_type="TRIGGERED",          # or CONTINUOUS
    primary_key="id",
    embedding_dimension=1536,
    embedding_vector_column="embedding",
    embedding_model_endpoint_name=None  # optional: auto-embed via endpoint
)
  • The primary key must be a column in the source Delta table.
  • embedding_dimension must match the output dimension of the model used to create embeddings.
  • If embedding_model_endpoint_name is provided, Vector Search calls that endpoint to compute embeddings automatically (Managed Embeddings mode).

Querying

results = index.similarity_search(
    query_text="explain transformers",   # or query_vector=[...]
    columns=["id", "content"],
    num_results=5,
    filters={"category": "NLP"}         # metadata filtering
)
  • query_text requires a managed-embeddings index (endpoint auto-embeds at query time).
  • query_vector requires a pre-computed vector of the correct dimension.
  • Metadata filtering uses exact-match predicates on non-vector columns.

Common Traps

  • Assuming you can use query_text on a Direct Vector Access Index—you cannot unless an embedding endpoint is attached.
  • Confusing endpoint (the compute cluster serving Vector Search) with index (the data structure). An endpoint hosts one or more indexes.
  • Forgetting that Delta Sync indexes require the source table to be in Unity Catalog.
  • Believing "continuous" sync means zero latency—there is still a short propagation delay.

LangChain Integration Patterns on Databricks

Databricks provides first-class LangChain integration through the databricks-langchain package (formerly langchain-community Databricks classes).

Key Integration Classes

ClassPurpose
ChatDatabricksChat-style LLM calls against Model Serving endpoints
DatabricksEmbeddingsGenerate embeddings via a Model Serving endpoint
DatabricksVectorSearchUse Mosaic AI Vector Search as a LangChain retriever
DatabricksChatMessageHistoryPersist conversation history (MLflow-backed)

Standard RAG Chain Pattern

RAG chain data flow: query to answer

from databricks_langchain import ChatDatabricks, DatabricksVectorSearch, DatabricksEmbeddings
from langchain.chains import RetrievalQA
from langchain_core.prompts import ChatPromptTemplate

embeddings = DatabricksEmbeddings(endpoint="databricks-bge-large-en")
retriever = DatabricksVectorSearch(
    index_name="catalog.schema.my_index",
    embedding=embeddings,
    columns=["content"]
).as_retriever(search_kwargs={"k": 5})

llm = ChatDatabricks(endpoint="databricks-meta-llama-3-1-70b-instruct", temperature=0)

chain = RetrievalQA.from_chain_type(llm=llm, retriever=retriever)

LCEL (LangChain Expression Language)

Modern chains use the | pipe operator:

chain = prompt | llm | output_parser
  • LCEL chains are natively compatible with MLflow langchain flavor logging.
  • Use mlflow.langchain.log_model() to log LCEL chains with automatic dependency inference.

Common Traps

  • Using ChatOpenAI instead of ChatDatabricks—OpenAI classes do not route to Databricks Model Serving.
  • Logging a chain with mlflow.pyfunc when the mlflow.langchain flavor provides richer metadata and schema inference.
  • Forgetting that DatabricksVectorSearch needs either a query_text path (managed embeddings) or an embedding object passed explicitly.
  • Assuming LangChain ConversationBufferMemory is always the right memory class—for long contexts, ConversationSummaryMemory is more appropriate.

Unlock with a paid plan

9 more sections (about 2,179 words) continue below. Every paid plan unlocks all Generative AI Engineer Associate study guides, the full question bank and mock exams, from $4.97/month.