What Is a Digital Librarian AI Agent? Connecting SQL & Vector Database

IBM TechnologyPublished Aug 23, 202605:21Added Sep 7, 2026

Learn more about Types of AI agents here → https://ibm.biz/~CybnjCGya Your data may know what happened, but not always why. Shad Griffin explains how a Digital Librarian AI Agent combines SQL databases, vector databases, and semantic search to answer complex

Watch on YouTube →
Contributed by Heather

Transcript

Transcript format

00:00So who can relate to this? You've waited in line for 30 minutes and you're finally at the pharmacy counter. That's when the tech gives you the bad news. Your prescription isn't covered by insurance. You know that you switched plans last month, but you think to yourself that the prescription should be covered.

00:18When you ask why, the tech just shrugs and replies, the system doesn't say why, it just says no. You walk away frustrated, knowing you'll be stuck on the phone for an hour. Wondering whether you're paying $10 or $1,000. So why can't the pharmacy tech tell you why your prescription isn't covered?

00:36More than likely, because the answer is trapped between two different worlds. Your patient history, what you've taken and when, and the denial for the current prescription is locked in an SQL database. But the why, the rules, the fine print, and the generic alternatives is buried in a 50-page PDF policy manual inside of a vector database.

00:58The problem is that these two systems just don't talk to each other. This is the what versus the why. The what are the hard numbers in SQL tables, but the why, the context, the strategy, is unstructured sitting in documents, presentations, or webpages.

01:18In this case, the SQL database says denied, but the reason why is on page 14 of a PDF. The what versus why problem outlined here is a common one experienced in many different industries. And until the explosion of generative AI, our abilities to solve the problem were limited.

01:37But what if your AI could act as a digital librarian agent? One that knows exactly when to write an SQL query to get a precise number, and when to perform a semantic search to find a specific paragraph, and then stitches the two together into a single grounded insight.

01:55Before we can build a digital library - librarian agent, we need to map out what the agent needs to do. In this case, our digital librarian needs to engage in six distinct steps. Let's break it down. Step one. Read the question. So she needs to read and understand the question, step two.

02:19Find the what? Find the why. So based on the question she needs to go in and look and find out what part of the question needs to be answered in a vector database and what part the question needs to answer in a SQL database. Step 3. Build the queries.

02:40So once she understands the question and knows what part is the what and what part is the why, she needs to construct the actual queries that are going to bring back the information or the answers that she needs. Step four, would be execute the queries.

02:59So, once she knows what the query is, she needs to run it against the database in order to get the answers that she's looking for. Step five, would be to compile. So she's got information from a vector database. She's got the information from the SQL database.

03:16She needs to put those together and pass them off for step six where she will answer the original question. So what tools or techniques would she use as she's answering or going through all these three steps? I think these first three are definitely gonna be an LLM.

03:36These two right here, these are gonna be tools more than likely. Um, you know, the first one is just like running something against the database. This one's just kind of reformatting the information coming from the database, probably do that in some kind of Python code.

03:51And then this one down here is definitely going to be an LLM as well. So let's go back to our original question. Is this drug covered and why is it covered or not covered? So the what part of that question would be, is this drug covered? So our digital librarian would need to identify that as being the what.

04:09And formulate a SQL query to get that information. And that information is more than likely sitting in a specific row and a specific column in a specific database. The why part of the question would be, why is it covered or not covered? And that's more than going to be buried in a paragraph inside of a PDF document.

04:27So she would need to formulate the search in order to retrieve that information from the vector database. So what did we just do? We took a fragmented experience, a frustrated patient, in a confused pharmacy tech and we fixed it by connecting the what.

04:51In SQL tables to the Y, and your PDS. When you move from simple queries to agentic workflows, you aren't just retrieving data. You're delivering answers. You're turning siloed data repository into a reasoning engine that works at the speed of your business.

What Is a Digital Librarian AI Agent? Connecting SQL & Vector Database — Transcriptly