Building a Knowledge Assistant with Agent Bricks on Databricks
From the publisher’s feed, collected in the ZeroLabs newsroom.
Leverage Agent Bricks to transform unstructured data into intelligent searchable knowledge.Note: I don’t claim expertise in this field. I’m summarizing concepts for learning purposes, while the heavy lifting is done by researchers and engineers (please check their papers and docs for depth). This article is personal study material and may simplify details. Use it as a starting point to dig deeper and if you spot inaccuracies, I’d love your corrections.Agent Bricks prompted by Alessandro Armillotta using GPTIn this article, we’ll explore how to create a Knowledge Assistant using Agent Bricks. We will see how to ingest pdf files from a volume interacting with them. We’ll se also how to evaluate the feedback and how to increase the performance based on Human Feedback.Note: Agent Bricks is in Beta preview. Before the GA there will be changes and some features are not available. In the future this article will be updated with new things.Table of contentsWhat is Agent Bricks?- What can Agent Bricks do?- Agents Types.- Built-in Evaluation & Feedback Loop.- What is a Knowledge Assistant Agent?Create a Knowledge Assistant Agent- Step 0 : Setup Environment- Step 1: Create and Configure the Agent- Step 2: Test the Agent- Step 3: Evaluate & Improve Your AgentFinal Thoughts📁 A GitHub repo with all required scripts and files is available here.Let’s get started 🚀What is Agent Bricks?Agent Bricks is a native framework within Databricks that empowers teams to build, optimize, and deploy domain-specific AI agents directly in the Lakehouse. Leveraging Mosaic AI, Agent Bricks streamlines agent development – automating evaluation, optimization, and iteration.What can Agent Bricks do?Task definition and data connection: Simply declare your agent’s mission in natural language and point to your data – Agent Bricks handles the rest.Automatic evaluation: It auto-generates test benchmarks and custom LLM-based judges tailored to your task for consistent performance measurement.Optimization: It fine-tunes prompts, evaluation criteria, even models – and balances quality versus cost using techniques like prompt engineering, reward modeling and test-adaptive optimization (TAO).Continuous improvement: Built-in feedback loops – including Agent Learning from Human Feedback (ALHF) – let you refine retrieval, prompts, and behavior over time, without retraining the LLM. .Supported Agent TypesAgent Bricks currently supports the following four distinct agent types, each optimized for common enterprise workflows:Information Extraction Agent: Transform large volumes of unlabeled text documents into structured tables with extracted information.Custom LLM Agent: Custom text generation tasks, such as summarization, classification, and text transformation.Knowledge Assistant Agent: Turn your documents into a high-quality chatbot that can answer questions and cite its sources.Multi-Agent Supervisor Agent: Design a multi-agent AI system that brings Genie spaces and agents together.This lineup aligns with the official agent types highlighted in the Databricks documentation and credible third-party sources.Built-in Evaluation & Feedback LoopA cornerstone of Agent Bricks is its seamless support for continuous evaluation and optimization:Automated benchmarks: Builds evaluation datasets and judges tailored to your task automatically.Quality – cost trade-off: Enables you to choose between cost-optimized or quality-optimized options. Agent Bricks continuously tests and evolves configurations to meet your priorities.Human feedback integration: Through ALHF, you can specify refinements in natural language – “ignore data before 1990,” for instance – and Agent Bricks translates this into technical adjustments like chunk filtering or prompt tuning.What is a Knowledge Assistant AgentAgent Bricks Knowledge Assistant allows you to create a chatbot that answers questions using a retrieval‑augmented generation (RAG) approach and includes precise citations to source documents.Ideal for interacting with internal knowledge — such as manuals, policies or support documentation — it taps into data stored in Unity Catalog volumes or vector indexes, handling retrieval, reasoning, and response generation. Once deployed, the Assistant can be tested directly in AI Playground, where it surfaces thoughtful responses with clear links to the documents it consulted. You can continuously improve its accuracy through natural‑language feedback sessions, making it smarter over time.A Knowledge Assistant into AI PlaygroundCreate a Knowledge Assistant AgentFollowing some steps you’ll be able to create and evaluate a Knowledge Assistant Agent into Databricks. For this lab will create AI assistant that will answer questions about AI, LLM, RAG and Agents.Step 0: Setup EnvironmentThe first thing to do is create a catalog, a schema and a volume. The volume will contain all the pdf about AI that will be used as Knowledge for our agent. To create these resource you can run the queries below into Databricks SQL or a Notebook.-- CREATE A CATALOG: you can also utilize the main catalog without creating a new oneCREATE CATALOG IF NOT EXISTS agent_bricks_lab COMMENT 'This catalog contains all the agent experiments files';-- CREATE A SCHEMACREATE SCHEMA IF NOT EXISTS agent_bricks_lab.ka_ai COMMENT 'This schema contains table and files for the Ai Knowledge Assistant';--CREATE A VOLUMECREATE VOLUME agent_bricks_lab.ka_ai.files;The last thing to do is to upload the files into the agent_bricks_lab.ka_ai.files volume. Go to catalog in the left navigation pane of your workspace and clink on agent_bricks_lab.ka_ai.files. On the top left click on Upload to this volume and select pdf files.Upload PDF files into CatalogIf everything looks like the image below, you can start to create the Agent.Step 1:Create and Configure the AgentGo to Agents in the left navigation pane of your workspace and click Knowledge Assistant.Note: As you can see in the image below, the Agent Bricks is in Beta and some features or functionalities will change in the future.Agent Bricks menuAfter clicking on Knowledge Assistant, you can start to configure the Agent. To create the agent you need to fill:Name: agent name (e.g. ka_ai_agent)Description: describe what your agent can do (e.g. Answer user questions about Generative AI, LLM, RAG and Agents).Knowledge source: specify the data source to use. You can select an UC folder or a Vector Index.Instruction: Provide some guidelines for how the agent should respond.After you have filled all the necessary information, click on Create Agent.Setup a Knowledge Assistant AgentThe process will take a couple time to sync docs and sources. After you will able to see your agent.Step 2: Test Your AgentAfter your agent has finished building, you can test it by trying it. You have 2 option to test the agent. You can use the chat into you agent or you can use it into AI Playground.Knowledge Assistant agentAfter the deployment, the agent page looks like the image above. On the left you can change the configuration of your agent. You can modify or add sources, change description or clicking on Optional you can change the Instructions. On the right you have the possibility to interact with your agent asking something. In the video below you can see how to chat with the Agent.https://medium.com/media/5b95900af9020f72c7bf96b5cfb7363d/hrefThe answer from the Agent will be followed by a Footnotes. The footnotes contains references to files into UC and if you click them you’ll see what files the agent is citing. This download the file on you pc.Note: I tried to exclude the Footnotes using the system prompt but this is not possible. The idea of knowledge assistant is to give the references regarding the questions. This make sense but maybe it’s also turn off this feature.Based on the documentation, if you use the AI Playground, you should be able to activate AI Judge and see Suggested questions but for now this is not available.If you’re satisfied with your agent’s performance, continue using the agent as-is or you can can change some feature like instructions.Step 3: Evaluate & Improve Your AgentNow it’s time to evaluate your agent and improve the quality.Agent improves quality using Human Feedback — by Alessandro using GeminiKnowledge Assistant can adjust the agent’s behavior based on natural language feedbacks. Gather human feedbacks through a labeling session to improve your agent’s quality. Collecting labeled data for your agent can improve its quality. Agent Bricks will retrain and optimize the agent from the new data.To improve the performance you can use the features available in the MLflow experiment. You can find the experiment near the the agent name in the agent page. Click on it and start your journey.MLflow experiment for your agentIn the MLflow experiment you can find some new features available with MLflow 3.0. These features are: Traces, Evaluations, Labeling, Versions, Prompts and Monitoring. Let’s see in the details what are these features.TracesMLflow Tracing enhances LLM observability in your applications by capturing the inputs, outputs, and metadata associated with each intermediate step of a request, enabling you to easily pinpoint the source of bugs and unexpected behaviors.With Traces in Agent Bricks, you can track user queries and store the corresponding responses in a Delta table, syncing everything to Unity Catalog. Every time your agent is queried, MLflow automatically logs the questions and responses in the Traces. This information can then be used to generate an evaluation dataset for iterative improvement, or to create labeling sessions that refine your agent’s performance over time.https://medium.com/media/f86ac5d0784f1584a11be953fdfb6119/hrefEvaluationsEvaluations allow you to create an evaluation dataset in order to systematically test and improve your GenAI application’s quality.Evaluation datasets help you:Fix known issues: Add problematic examples from production to repeatedly test fixesPrevent regressions: Create a “golden set” of examples that must always work correctlyCompare versions: Test different prompts, models, or app logic against the same dataTarget specific features: Build specialized datasets for safety, domain knowledge, or edge casesIn the video below you can see how to create an evaluation dataset using traces. To run the evaluation you need to execute the python code that you find when you click on Run Evaluation.https://medium.com/media/5fdc3fccf38242a80d3a9d3c9e2d5f8e/hrefLabellingOne of the most effective ways to improve your GenAI application is to have domain experts review and label existing traces. MLflow’s Review App provides a structured process for collecting this expert feedback on real interactions with your application.To create the Labelling session with your expert, you need to:Define Labelling Schema: define the questions and input types that domain experts will use to provide feedback on your traces.Create a Labelling Session: s a special type of MLflow Run organizes a set of traces for review by specific experts using selected labeling schemas. It acts as a queue for the review process.Generate traces and add to the Labeling Session: Traces are copied into the labeling session, so any labels or modifications made during the review process do not affect your original logged traces.Share the Review App with Experts: the domain experts can use the URL to access the Review App, view the traces assigned to them (or pick from unassigned ones), and provide feedback using the labeling schemas you configured.View and Use Collected Labels: the collected feedback is attached to the traces within the labeling session. You can retrieve these labels programmatically to analyze them or use them to create evaluation datasets.At the end of a feedback session, your agent should show improved performance. Thanks to Agent Learning from Human Feedback (ALHF), Agent Bricks can intelligently translate natural language guidance into technical optimizations — refining retrieval algorithms, improving prompts, filtering the vector database, or even adjusting the agentic workflow.In the video below, you can see how to create a labeling session and how to improve your agent’s performance over time.As of today, Agent Bricks is still in preview, and the labeling session in MLflow is not fully functional. However, to achieve the same outcome, I’ll show you how to use the “Improve Quality” option directly within the agent chat interface.https://medium.com/media/3ec82d942343998e0ec22e64e4bfd0b8/hrefFinal ThoughtsWhile still in Beta, the Knowledge Assistant built with Agent Bricks already demonstrates strong potential — both technologically and from a business perspective.On the technical side, the ability to create a fully functional assistant in just a few steps — using PDF documents stored in Unity Catalog volumes — streamlines integration into existing data architectures. There’s no need to move data out of the Lakehouse or rely on external orchestration layers. This tight integration with the Databricks ecosystem ensures governance, scalability, and security by design, making it suitable for enterprise-grade deployments from day one.From a business perspective, this translates to reduced development time, faster proof-of-value cycles, and ultimately, quicker adoption of AI capabilities across departments. Teams no longer need to build complex pipelines or train models from scratch — instead, they can focus on refining outcomes and aligning responses with internal knowledge and policies.What truly sets the Knowledge Assistant apart is its feedback-driven improvement loop. Traditionally, quality and relevance in chatbots are difficult to scale — especially when the answers depend on proprietary or evolving knowledge. Thanks to Agent Learning from Human Feedback (ALHF), domain experts can guide the assistant’s behavior using simple natural language corrections, leading to significantly improved accuracy and trustworthiness over time, without touching the model itself.In short, Agent Bricks enables organizations to move from static documentation to intelligent, interactive knowledge systems — with minimal friction and maximum control. It’s a glimpse of what enterprise AI should look like: modular, explainable, and continuously improving.ReferencesVaswani, A., et al. (2017). Attention is All You NeedSingh, A., et al. (2025). Agentic RAG: A Survey on Agentic Retrieval-Augmented GenerationUse Agent Bricks: Knowledge Assistant to create a high-quality chatbot over your documents | Databricks on AWSDatabricks. Agent Learning from Human Feedback (ALHF): Knowledge Assistant Case StudyDatabricks Blog. Introducing Agent BricksMLflow Tracing for LLM Observability | MLflowEvaluating LLMs/Agents with MLflow | MLflowBuilding MLflow Evaluation Datasets — Azure Databricks | Microsoft LearnEvaluate and improve your application — Azure Databricks | Microsoft LearnCollect domain expert feedback — Azure Databricks | Microsoft LearnBuilding a Knowledge Assistant with Agent Bricks on Databricks was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.