YouTube2Text

Why Agentic Systems Need Ontologies — Frank Coyle, UC Berkeley — Transcript

by AI Engineer · 3,099 words · 520 segments · language en · Watch on YouTube

Full transcript

  1. 0:01[music]
  2. 0:12>> Um, okay, we're going to launch here.
  3. 0:15So, my name is Frank Coyle.
  4. 0:17Um, I'm I'm an educator and teaching at
  5. 0:20Berkeley now. I've been doing this
  6. 0:22computer science stuff for
  7. 0:24oh, 30, 35 years.
  8. 0:26And um
  9. 0:28>> [snorts]
  10. 0:28>> I'm intro and right now it's kind of a
  11. 0:30critical time for uh
  12. 0:32poor computer science students. Used to
  13. 0:34be the used to be the only game in town.
  14. 0:36Degree was a guaranteed job, and now
  15. 0:39thanks to AI, it's not. But then again,
  16. 0:415,000 people are here. So, AI and and
  17. 0:45agents are um seem to be the way to go.
  18. 0:48So, the question is how do we leverage
  19. 0:50this new universe that we are moving
  20. 0:53quickly into. And so, I want to talk
  21. 0:55about how agents and ontologies will big
  22. 0:58word fit together. But before you do
  23. 1:01before I do that, I wanted to um
  24. 1:05wanted to give you my uh my educational
  25. 1:07philosophy.
  26. 1:09And this comes [clears throat] from uh
  27. 1:10someone called Sister Corita Kent.
  28. 1:13And it was made popular by John Cage,
  29. 1:16who is a uh an avant-garde musician.
  30. 1:19And
  31. 1:21you got to think about this little bit.
  32. 1:23Nothing is a mistake.
  33. 1:25There is no win.
  34. 1:26There's no fail. There's only make.
  35. 1:30And more and more today, that's what's
  36. 1:32important. Get down and make stuff, and
  37. 1:35that's how you're going to learn, not by
  38. 1:36necessarily reading.
  39. 1:38I'm also a big fan of writing.
  40. 1:41My early career was in neuroscience. I'm
  41. 1:43kind of coming back into it now that
  42. 1:45Agent AI is bringing uh
  43. 1:48kind of cognitive science back. But
  44. 1:51engage your senses. Get a notebook. Get
  45. 1:54a
  46. 1:55pen, a pencil. Draw pictures, write
  47. 1:58stuff down.
  48. 2:00Just don't type because when you type
  49. 2:02you when you're typing your brain is
  50. 2:04thinking about the letters on the
  51. 2:05keyboard. When you're writing in a book,
  52. 2:08your whole brain, your your whole all
  53. 2:10your all your sensory systems are
  54. 2:12engaged and you're going to learn
  55. 2:14faster that way.
  56. 2:16Okay.
  57. 2:18On to our talk.
  58. 2:21Agents and ontology. So, there are two
  59. 2:23lineages here and I want to talk about
  60. 2:25both, give you a little philosophical
  61. 2:26background. Um
  62. 2:29agents, when did we start talking about
  63. 2:31agents? Well, goes goes back to the
  64. 2:33early initial days of AI. People like
  65. 2:36John McCarthy,
  66. 2:38uh
  67. 2:39uh uh
  68. 2:40uh uh Selfridge, Marvin Minsky, Society
  69. 2:43of Mind. People started thinking about
  70. 2:45the fact that this new computing
  71. 2:47technology was going to lead us into
  72. 2:50some kind of artificial intelligence,
  73. 2:52which is a term that came
  74. 2:54in 1956 when all these characters got
  75. 2:56together and tried to figure out where
  76. 2:59the future was going. Okay? And the
  77. 3:01concept of an agent finally evolved,
  78. 3:04things that
  79. 3:05perceive and decide and then act and
  80. 3:07that's what we're seeing now.
  81. 3:09Now, what about ontologies? Well, it
  82. 3:10turns out ontologies are not that new.
  83. 3:13Okay? It was actually Aristotle who
  84. 3:16first came up with the concept of we
  85. 3:18need a philosophy of of being. Like,
  86. 3:22whoa, kind of heavy. Um but came up with
  87. 3:25categories of being and this kind of
  88. 3:27relates to what people are doing now
  89. 3:29with graph databases and knowledge
  90. 3:32representation. And there are a couple
  91. 3:34of other people who kind of formalized
  92. 3:35it.
  93. 3:36Uh
  94. 3:37Von Quine was a philosopher and then
  95. 3:39this guy Gruber, 1993. And I think this
  96. 3:42captures what
  97. 3:45knowledge and uh
  98. 3:48graph technology really represents. It
  99. 3:51is a a formal specification
  100. 3:54of a shared conceptualization. And
  101. 3:57that's what we want to give to our
  102. 3:58agents. We want to give them our concept
  103. 4:01our conceptualization of the universe,
  104. 4:04our universe, our domains. Okay? And
  105. 4:06now, what's happening
  106. 4:08is you're getting the convergence of
  107. 4:11something that is probabilistic,
  108. 4:14the agents, the LLMs, with the
  109. 4:18the more formal representations that you
  110. 4:20have with ontologies. And so, this term
  111. 4:24is now being used you
  112. 4:26hearing this a lot, neuro-symbolic
  113. 4:28AI. Sounds pretty fancy, but it's really
  114. 4:31neural networks tied into
  115. 4:35symbolic AI, which rule-based systems
  116. 4:39come under that category,
  117. 4:41um as do the knowledge graphs that we're
  118. 4:44that we're
  119. 4:45assembling. And so,
  120. 4:48what I'd like to argue is that
  121. 4:49neuro-symbolic AI
  122. 4:52sort of represents a way to keep the LLM
  123. 4:56on its guardrails, because LLMs are by
  124. 5:00nature probabilistic.
  125. 5:02People worry about hallucinations, but
  126. 5:05that's the feature. That's actually a
  127. 5:07feature of large language models. It's
  128. 5:09who we are. We hallucinate in a way. We
  129. 5:13imagine things that may not exist, and
  130. 5:15then we turn them into reality.
  131. 5:17And that's what large language models do
  132. 5:19in
  133. 5:19in a way.
  134. 5:20Okay? So,
  135. 5:23let's just quickly overview what
  136. 5:26ontologies are. It's not They're not
  137. 5:28complicated. They're basically a
  138. 5:29representation of entities and their
  139. 5:33relationships to other entities. And
  140. 5:35these entities have properties. And this
  141. 5:38whole concept of graph databases
  142. 5:42arose when
  143. 5:45people began to realize that relational
  144. 5:48databases
  145. 5:49sticking data into tables was too
  146. 5:52restrictive. You wanted to add something
  147. 5:55new to
  148. 5:56a relational database, so you have to
  149. 5:58add a new column. Man, I had then then
  150. 6:00you have to redo the whole structure.
  151. 6:02With a with a graph database, you can
  152. 6:04just attach another item. You can just
  153. 6:06attach a property. You can attach a
  154. 6:07relationship. Okay? So, the question
  155. 6:10often arises, okay, I I get it. I need
  156. 6:13to have an ontology
  157. 6:15to represent in a formal way what my
  158. 6:18organization is doing. How do I do it?
  159. 6:21Okay? There are a couple of ways you can
  160. 6:22approach it. You can have a top-down
  161. 6:24approach or a bottom-up approach.
  162. 6:26Top-down approach is
  163. 6:29you get the experts together and they
  164. 6:31sit down and analyze the domain, come up
  165. 6:34with the entities. What do we have? We
  166. 6:35have purchase orders, we have customers,
  167. 6:38we have customer representatives, and
  168. 6:41we're going to structure them. They have
  169. 6:42properties. These are the relationships.
  170. 6:44Okay, that's one way. And this models
  171. 6:47what we were doing back in the '80s when
  172. 6:49I was involved in expert systems.
  173. 6:51Everybody thought expert systems was the
  174. 6:53way to do AI. Symbolic AI was the way to
  175. 6:56go. Companies rose, millions of dollars
  176. 7:00were spent.
  177. 7:01Uh the
  178. 7:02the Japanese created this uh
  179. 7:06future world project in the late '80s.
  180. 7:09People in America were my my son was
  181. 7:12taking Japanese in school because of
  182. 7:14these expert systems. And
  183. 7:17but they couldn't scale. They couldn't
  184. 7:19scale, and then we went into a kind of
  185. 7:21AI winter.
  186. 7:23Where did neural networks came come
  187. 7:25from? Neural networks were put out there
  188. 7:27in the '60s, but they couldn't scale
  189. 7:30because we didn't happen to have Nvidia
  190. 7:34who was off making GPUs to make make
  191. 7:38reality of the of the video games
  192. 7:40fantastic, and then someone said, let's
  193. 7:43turn these things over to the neural
  194. 7:44networks, and of course, that's kind of
  195. 7:46why we're here now. So,
  196. 7:49the other way you can that that people
  197. 7:52are
  198. 7:53adding to or creating ontologies is is
  199. 7:55from the bottom up. For example,
  200. 7:58customer
  201. 7:59reactions.
  202. 8:01What are the things the customers are
  203. 8:02involved in? Wait.
  204. 8:04Do you these entities, these
  205. 8:05relationships, let's add this to our
  206. 8:07ontology. Let's Let's add this
  207. 8:09information to the graph. Now, as as a
  208. 8:12help,
  209. 8:14it's helpful to be aware that there are
  210. 8:16existing
  211. 8:18taxonomies that people have been working
  212. 8:20on for the last 15 to 20 years. Things
  213. 8:23like schema.org, which has a whole set
  214. 8:25of terms and relationships, so you don't
  215. 8:27have to reinvent the wheel. In fact, you
  216. 8:30it's to your advantage to use some of
  217. 8:33these ontologies. FOAF, Friend of a
  218. 8:36Friend, for modeling social networks.
  219. 8:40The Dublin Core, which was
  220. 8:42an early an early attempt to come up
  221. 8:45with terms for describing
  222. 8:47uh research papers and books and so
  223. 8:49forth. So, there's a whole series of
  224. 8:52things. In fact, Wikipedia is based on
  225. 8:54an ontology called DBpedia. So, when you
  226. 8:57do a search on Wikipedia, it's looking
  227. 8:59things up in its giant graph database.
  228. 9:02So, this stuff has been out there
  229. 9:04underlying a lot of what we already do.
  230. 9:07So, take advantage of these things that
  231. 9:09already exist.
  232. 9:12Okay. Now, what do you do when you build
  233. 9:15your ontology? Okay, so what? I know
  234. 9:17what these entities are, I know what
  235. 9:19their relationships are, they have
  236. 9:21properties. How can I do anything with
  237. 9:24them? Well, there are other augmenting
  238. 9:26technologies, auxiliary technologies.
  239. 9:29Things that we call the things like
  240. 9:31RDFS, which is a technology, and OWL,
  241. 9:33which I'll talk more about. So, these
  242. 9:35have
  243. 9:36these kind of sit over to the side of
  244. 9:39your graph. So, I'm not going to talk
  245. 9:41about on I mean ontology is a big word
  246. 9:44and it's often confusing and used in
  247. 9:45many ways, but think of it as a graph
  248. 9:47data structure. Okay?
  249. 9:50And you have the entities and
  250. 9:51relationships, but you want to apply
  251. 9:53some control over them. Or you want to
  252. 9:56be able to make inference over them. So,
  253. 9:59for example, there is uh
  254. 10:02some terms in this technology called
  255. 10:04RDFS.
  256. 10:05Domain and range. So, if I say
  257. 10:09teaches
  258. 10:11has a domain of teacher. That means if I
  259. 10:14say Bob teaches Scooter in my text, I
  260. 10:17can infer that Bob is a teacher.
  261. 10:21And if I say all teachers are persons,
  262. 10:23then this statement lets me know if I
  263. 10:26say Bob teaches Scooter, now I know Bob
  264. 10:28is a person, Bob is a teacher. What
  265. 10:29about Scooter? If I say teaches has a
  266. 10:32range of student, that means the the
  267. 10:35right side of the verb, then Scooter is
  268. 10:37a student. And now I have this extra
  269. 10:39information into my system.
  270. 10:43OWL also has a series of
  271. 10:47of of properties that allow you to make
  272. 10:50some inferences. So, a transitive
  273. 10:52property transitive property says, if
  274. 10:55Sue is an ancestor like ancestor is a
  275. 10:58transitive property. If Sue is an
  276. 11:00ancestor of Mary and Mary is an ancestor
  277. 11:02of Ann, then Sue is an ancestor of Ann.
  278. 11:07Okay? This was not initially into my
  279. 11:10graph system, but with applying these
  280. 11:13functional properties, I can then
  281. 11:16add and augment the system with this
  282. 11:18extra data. So, that's very useful.
  283. 11:21Then there's some
  284. 11:23properties called functional properties,
  285. 11:26which means only one.
  286. 11:28So, has father
  287. 11:31is a functional property. You can only
  288. 11:33have one father. You can only have one
  289. 11:35mother. That is a functional property.
  290. 11:38Okay? So, that's that can serve as a
  291. 11:41constraint. So, when
  292. 11:44if you say Bob is my Bob is Jim's
  293. 11:48father, BB is Jim's father,
  294. 11:51well,
  295. 11:53the inference here is that Bob and BB
  296. 11:55are two ways of representing the same
  297. 11:57individual because
  298. 11:59that is a functional property. Can only
  299. 12:01have one. So, these derivations and
  300. 12:04constraints that don't sit in the graph,
  301. 12:06they sit sort of on the side
  302. 12:09and they can help
  303. 12:11as we're going to see, I'm going to
  304. 12:12propose,
  305. 12:14when we deal with agents, how they can
  306. 12:16they can help us out. So,
  307. 12:18what about agents?
  308. 12:21Everybody's talking about agents now and
  309. 12:23everybody's talking about loops. Loops,
  310. 12:26loops, loops everywhere.
  311. 12:28Loops have been around for a long time.
  312. 12:31Back in the '60s, people were debating
  313. 12:34who has the best programming language?
  314. 12:35Fortran or COBOL? No, mine is better.
  315. 12:37No, mine is better. Oh, you don't know
  316. 12:39anything. You don't know what you're
  317. 12:40talking about.
  318. 12:42Bohm and Jacopini in 1966 came out and
  319. 12:45said, "Okay, there is no real difference
  320. 12:47in programming languages if they have
  321. 12:49three aspects.
  322. 12:51Sequence. I can put statement A,
  323. 12:53statement B, statement C. Fine. I have
  324. 12:56conditionals. I can have if then.
  325. 12:58And the last piece, I have a loop.
  326. 13:01If I have a loop, if I have iteration,
  327. 13:03if I take these three things,
  328. 13:05the the language is what's called Turing
  329. 13:08complete. Can do any can compute
  330. 13:10anything that a
  331. 13:13can be computed by computational devices
  332. 13:17from the work of Alan Turing.
  333. 13:19Okay?
  334. 13:20And now we're seeing this in agentic AI.
  335. 13:24Agents are now have loops. Loops give us
  336. 13:26the last piece in the equation of giving
  337. 13:29us
  338. 13:31a technology that is capable of
  339. 13:35doing anything that computational
  340. 13:37devices can do.
  341. 13:40The danger though of loops is that they
  342. 13:43can break.
  343. 13:45If you're If you're a programmer, you
  344. 13:46know, you've all go into infinite loop.
  345. 13:49Not good.
  346. 13:51Loops can drift as agents start talking
  347. 13:55to each other, things get all go off off
  348. 13:58the rails. And
  349. 14:00loops can cost you money.
  350. 14:02Token counts crank up as the loops
  351. 14:05continue. So, you don't you need to be
  352. 14:08careful, okay? But in a way we are
  353. 14:11revisiting some of the early stuff with
  354. 14:13symbolic AI. I would argue we're going
  355. 14:16back to the world of expert systems.
  356. 14:20Which is the symbolic part of the whole
  357. 14:21thing. So, I want to show you a little
  358. 14:23example using Claude
  359. 14:26agent. So, little code here. Don't get
  360. 14:29scared, but
  361. 14:31I know nobody does Python anymore, but
  362. 14:33you got to look at what the agent's
  363. 14:35giving you and you got to you got to
  364. 14:37move in and and manipulate it. So,
  365. 14:39here's a here's a loop while true,
  366. 14:41classic Python loop. Okay? And so, we
  367. 14:44have a client. So, we're actually So,
  368. 14:46the first little chunk here that you
  369. 14:48see, r e s p, the response, this is just
  370. 14:51some code where we have a model and we
  371. 14:55have uh
  372. 14:57we have a prompt, that's part of part of
  373. 14:59the messages,
  374. 15:00and we have a tool,
  375. 15:03and we're we're asking the LLM to
  376. 15:08solve this problem using a tool. Now,
  377. 15:11here's the here's the catch.
  378. 15:14LLMs can't do anything. All they can do
  379. 15:17is give us the next word with a high
  380. 15:19probability. Amazingly, we can now have
  381. 15:22these conversations it, but they can't
  382. 15:23do anything. But, we can give it a tool,
  383. 15:27and we can give it
  384. 15:29what we want, and say,
  385. 15:32"How do you think this tool can help us
  386. 15:34get what we want?" And then the LLM will
  387. 15:37set up the parameters,
  388. 15:41and come back to us, and say, "Okay,
  389. 15:44here's my response.
  390. 15:46I can't execute this tool, but I know
  391. 15:48what the input parameters are. I know
  392. 15:50what your context is. I know what your
  393. 15:53prompt is. So, here is the call that you
  394. 15:56need to make
  395. 15:58of the tool, because I can't do it. I'm
  396. 16:00the LLM. I'm just locked in this box.
  397. 16:03Okay? So, the second box the second
  398. 16:05chunk is
  399. 16:08stop reason. So, stop reason means
  400. 16:12the LLM has stopped for some reason.
  401. 16:15The The reason here is that it can't do
  402. 16:17anything, and if the reason is tool use,
  403. 16:20ah, now it's time. Let's go execute that
  404. 16:22tool. So, that second line, get tool. It
  405. 16:25takes the response, which is
  406. 16:28formulating the the parameters, and
  407. 16:30triggering the action.
  408. 16:32Okay. Now, I have this stuff in red
  409. 16:34here. This is where I think
  410. 16:36the LLMs and other uh
  411. 16:40I'm sorry, not LLMs.
  412. 16:41The ontologies and stuff can come in.
  413. 16:43So,
  414. 16:45if you look down there,
  415. 16:48after the the tool is called, it said
  416. 16:50tool runs. This is where
  417. 16:54ontologies could come in.
  418. 16:56The tool's going to give us information.
  419. 16:59We put the information in a form
  420. 17:02that our
  421. 17:04our our our validator can use, and think
  422. 17:07about the validator as operating with
  423. 17:10this these ontologies about our domain,
  424. 17:13then we can
  425. 17:16make some sense
  426. 17:17of whether the response of the LLM is
  427. 17:22reasonable. So, this is the loop. Call a
  428. 17:25tool, check the stop reason.
  429. 17:28If it's a reasonable result, then let's
  430. 17:31go with it. If it's not reasonable, go
  431. 17:33back to the LLM. Say, "Oh, this is this
  432. 17:35is not working." Or get a human in the
  433. 17:38loop. But the idea is
  434. 17:42to surround the input with checks. Now,
  435. 17:44I've got this
  436. 17:45something that you that you should be at
  437. 17:48least taking a look at if you're doing
  438. 17:49some of this coding is something called
  439. 17:51Pydantic. Pydantic is a way to specify
  440. 17:56the types of what you want the types of
  441. 17:58the parameters to be. Those of you who
  442. 18:01who do know Python, know Python is a
  443. 18:04unstructured type language. So, you can
  444. 18:06have a variable x = 20, x = hello, no
  445. 18:10problem. There's no typing.
  446. 18:12Pydantic adds typing to that. So, you
  447. 18:14want to
  448. 18:15check your types with Pydantic and then
  449. 18:18check your results with the ontology.
  450. 18:23So, Pydantic at the door, ontology at
  451. 18:25the ledger, and pure agents and by the
  452. 18:28way, your agents should try to have no
  453. 18:30side effects.
  454. 18:32That helps the whole logic. Meaning,
  455. 18:34they're not running off doing something
  456. 18:36that they're they're changing they're
  457. 18:38changing things in the database not yet.
  458. 18:40You want to run them through the
  459. 18:41ontology first and make sure that works.
  460. 18:44Okay.
  461. 18:45I only got an I've got I've got another
  462. 18:46I've just a short time. I'm going to try
  463. 18:48to show you some of the things that um
  464. 18:51that you can
  465. 18:53some logical constructs from from
  466. 18:55something called OWL, the uh
  467. 18:58the web object language for for objects.
  468. 19:01So, you have these functional
  469. 19:03properties, disjoint properties. I'll
  470. 19:05just put these you can look at the
  471. 19:06slides, but essentially the errors it
  472. 19:09can catch. Look over in the the
  473. 19:11right-hand column. A second refund on
  474. 19:14the same order
  475. 19:15is a is
  476. 19:17is a problem. But ontologies could catch
  477. 19:19it, whereas it's it's very tricky to do
  478. 19:21that in in English. A payout sent to the
  479. 19:24support desk instead of the buyer. Okay?
  480. 19:27You can catch that with an owl disjoint
  481. 19:29property where customer and support rep
  482. 19:31are two separate entities. Okay?
  483. 19:34Uh one of may a made-up value like
  484. 19:38probably shipped. You can specify
  485. 19:42you must have certain kinds of value.
  486. 19:44So, uh the status
  487. 19:47paid, shipped, or refunded, nothing
  488. 19:49else. And when you're in the pure text
  489. 19:51world, this can get this can get funky
  490. 19:54because the the LLMs are again
  491. 19:57probabilistic and
  492. 19:58um
  493. 20:00return some crazy stuff. Okay. Uh so,
  494. 20:03really what the point I want to make
  495. 20:05here is use these re- you can have a
  496. 20:08reasoner built on ontology to check keep
  497. 20:11the LLM on track, have guardrails to
  498. 20:16keep it honest. Okay?
  499. 20:18And for the guardrails, I'm referring to
  500. 20:21these concepts re- these support
  501. 20:24technologies with RDFS and owl.
  502. 20:28And
  503. 20:30my my bottom line is and nothing is a
  504. 20:32mistake, there's no win, no fail, only a
  505. 20:35make.
  506. 20:37Okay. Feel free to reach out to me
  507. 20:39coil@burkly.
  508. 20:40I've got a I've got a
  509. 20:41I've got a little website
  510. 20:42codesupreme.ai. I'm a big fan of if
  511. 20:45you're John Coltrane has a has a some
  512. 20:48jazz called uh
  513. 20:49called Love Supreme. So, I've named my
  514. 20:52site
  515. 20:53Code Supreme. And if you go there, I've
  516. 20:54got some music and it's all good. Okay.
  517. 20:57Thanks very much. 20 minutes.
  518. 20:59>> [applause]
  519. 21:15[music]
  520. 21:17>> Woo!

About this transcript

This page contains the full transcript of Why Agentic Systems Need Ontologies — Frank Coyle, UC Berkeley by AI Engineer, generated from the public captions YouTube serves with the video. The transcript has 3,099 words across 520 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.