ESC
↑↓ 选择↵ 打开esc 关闭⌘K 唤起
← 返回速读报告 回声编辑部 · NO.98 · 全文

Why Agentic Systems Need Ontologies — Frank Coyle, UC Berkeley

频道: AI Engineer
视频: https://www.youtube.com/watch?v=Sir59K8ZDPU
原文语言: en
统计: 共 55 轮


[0:01]

[music]

[音乐]


[0:12]

Um, okay, we're going to launch here. So, my name is Frank Coyle. Um, I'm I'm an educator and teaching at Berkeley now. I've been doing this computer science stuff for oh, 30, 35 years. And um

嗯,好,我们这就开始。我叫 Frank Coyle。嗯,我是一名教育工作者,现在在 UC Berkeley 教书。计算机这一行我干了有,噢,三十、三十五年了。然后呢,嗯——


[0:28]

[snorts]

[吸鼻子]


[0:28]

I'm intro and right now it's kind of a critical time for uh poor computer science students. Used to be the used to be the only game in town. Degree was a guaranteed job, and now thanks to AI, it's not. But then again, 5,000 people are here. So, AI and and agents are um seem to be the way to go.

我先做个开场——眼下对可怜的计算机专业学生来说,是个挺关键的时刻。以前吧,以前这是唯一的出路,拿个学位就等于保证有工作,现在拜 AI 所赐,不灵了。不过话又说回来,今天在场的有 5,000 人。所以说,AI 和 agent 看来才是该走的路。


[0:48]

So, the question is how do we leverage this new universe that we are moving quickly into. And so, I want to talk about how agents and ontologies will big word fit together. But before you do before I do that, I wanted to um wanted to give you my uh my educational philosophy.

那么问题就是:我们正飞速进入这个新宇宙,该怎么用好它?所以我想聊聊 agent 和本体论(ontology)——好大一个词——是怎么结合到一起的。不过在你们……在我讲这个之前,我想先跟大家说说我的教育理念。


[1:09]

And this comes [clears throat] from uh someone called Sister Corita Kent. And it was made popular by John Cage, who is a uh an avant-garde musician. And you got to think about this little bit. Nothing is a mistake. There is no win. There's no fail. There's only make.

这个理念来自 [清嗓子] 一位叫 Sister Corita Kent 的人,后来被前卫音乐家 John Cage 发扬光大。这句话你得稍微琢磨琢磨:没有什么是错误。没有赢,也没有输,只有「做」。


[1:30]

And more and more today, that's what's important. Get down and make stuff, and that's how you're going to learn, not by necessarily reading. I'm also a big fan of writing. My early career was in neuroscience. I'm kind of coming back into it now that Agent AI is bringing uh kind of cognitive science back. But engage your senses. Get a notebook. Get a pen, a pencil. Draw pictures, write stuff down.

而在今天,这一点越来越重要。埋头去做东西,你是靠这个学会的,不一定是靠读。我也非常推崇「写」。我早期的职业生涯是在神经科学领域,现在 agent AI 把认知科学又带回来了,我算是又回到这个圈子了。总之,调动你的感官。找个本子,拿支笔、拿支铅笔,画图,把东西写下来。


[2:00]

Just don't type because when you type you when you're typing your brain is thinking about the letters on the keyboard. When you're writing in a book, your whole brain, your your whole all your all your sensory systems are engaged and you're going to learn faster that way.

别光打字,因为你打字的时候,你的大脑想的是键盘上那些字母。而当你在本子上写的时候,你整个大脑、你所有的感官系统都被调动起来了,那样你学得更快。


[2:16]

Okay. On to our talk. Agents and ontology. So, there are two lineages here and I want to talk about both, give you a little philosophical background. Um agents, when did we start talking about agents? Well, goes goes back to the early initial days of AI. People like John McCarthy,

好,进入正题。Agent 与本体(ontology)。这里有两条脉络,我两条都想讲讲,给大家一点哲学背景。嗯,agent——我们是什么时候开始谈 agent 的?其实可以追溯到 AI 最早的年代,像 John McCarthy 这些人,


[2:38]

uh uh uh uh uh Selfridge, Marvin Minsky, Society of Mind. People started thinking about the fact that this new computing technology was going to lead us into some kind of artificial intelligence, which is a term that came in 1956 when all these characters got together and tried to figure out where the future was going. Okay? And the concept of an agent finally evolved,

呃、呃、呃……Selfridge,还有 Marvin Minsky 和他的《心智社会》(Society of Mind)。人们开始意识到,这种新的计算技术将把我们引向某种「人工智能」——这个词诞生于 1956 年,当时这帮人聚到一起,试图搞清楚未来的方向在哪里。对吧?然后 agent 这个概念最终演化了出来,


[3:04]

things that perceive and decide and then act and that's what we're seeing now. Now, what about ontologies? Well, it turns out ontologies are not that new. Okay? It was actually Aristotle who first came up with the concept of we need a philosophy of of being. Like,

就是那种会感知、会决策、然后会行动的东西,这也正是我们今天看到的。那么本体(ontology)呢?其实本体一点都不新。对吧?最早提出「我们需要一门关于存在的哲学」的,其实是亚里士多德。就像,


[3:22]

whoa, kind of heavy. Um but came up with categories of being and this kind of relates to what people are doing now with graph databases and knowledge representation. And there are a couple of other people who kind of formalized it. Uh Von Quine was a philosopher and then this guy Gruber, 1993. And I think this captures what knowledge and uh graph technology really represents. It is a a formal specification of a shared conceptualization. And

哇,听着挺沉重的。嗯,但他提出了「存在的范畴」,这跟今天大家在做的图数据库(graph database)和知识表示其实是相通的。还有另外几个人把它形式化了。呃,Von Quine 是位哲学家,然后是 Gruber 这个人,1993 年。我觉得他这句话抓住了知识与图技术真正的本质:本体是「一种共享概念化的形式化规范」。而


[3:57]

that's what we want to give to our agents. We want to give them our concept our conceptualization of the universe, our universe, our domains. Okay? And now, what's happening is you're getting the convergence of something that is probabilistic,

这正是我们想交给 agent 的东西。我们想把我们对宇宙的概念化——我们的宇宙、我们的领域——交给它们。对吧?而现在正在发生的是:概率性的东西


[4:14]

the agents, the LLMs, with the the more formal representations that you have with ontologies. And so, this term is now being used you hearing this a lot, neuro-symbolic AI. Sounds pretty fancy, but it's really neural networks tied into symbolic AI, which rule-based systems come under that category,

——也就是 agent、LLM——和本体所提供的那种更形式化的表示,正在融合。所以现在有个词大家听得很多:神经符号 AI(neuro-symbolic AI)。听着挺高大上,其实就是神经网络接上符号 AI,基于规则的系统属于符号 AI 这一类,


[4:41]

um as do the knowledge graphs that we're that we're assembling. And so, what I'd like to argue is that neuro-symbolic AI sort of represents a way to keep the LLM on its guardrails, because LLMs are by nature probabilistic. People worry about hallucinations, but that's the feature. That's actually a feature of large language models. It's who we are. We hallucinate in a way. We imagine things that may not exist, and then we turn them into reality.

嗯,我们正在搭建的知识图谱(knowledge graph)也属于这一类。所以我想说的观点是:neuro-symbolic AI 相当于给 LLM 装上护栏的一种方式,因为 LLM 天生就是概率性的。大家都担心幻觉,可那恰恰是它的特性。那其实是大语言模型的一个 feature,也是我们人类的本性。我们某种意义上也会「幻觉」,我们想象出并不存在的东西,然后把它们变成现实。


[5:17]

And that's what large language models do in in a way. Okay? So, let's just quickly overview what ontologies are. It's not They're not complicated. They're basically a representation of entities and their relationships to other entities. And these entities have properties. And this whole concept of graph databases arose when people began to realize that relational databases sticking data into tables was too restrictive. You wanted to add something

大语言模型某种程度上做的也是这件事。好吧?那我们快速过一下本体到底是什么。它不复杂。本质上就是对实体(entity)以及实体之间关系(relation)的一种表示,而这些实体带有属性。图数据库这整个概念之所以出现,是因为人们开始意识到关系型数据库——把数据往表格里塞——限制太多了。你想加点新东西,


[5:55]

new to a relational database, so you have to add a new column. Man, I had then then you have to redo the whole structure. With a with a graph database, you can just attach another item. You can just attach a property. You can attach a relationship. Okay? So, the question often arises, okay, I I get it. I need to have an ontology to represent in a formal way what my organization is doing. How do I do it?

往关系型数据库里加,那就得加一个新列。天哪,然后你还得把整个结构重做一遍。而用图数据库,你直接挂一个新条目上去就行了。你可以直接挂一个属性,可以挂一条关系。对吧?所以经常有人问:好,我懂了,我需要一个本体来形式化地表示我们组织在做的事。那具体怎么做?


[6:21]

Okay? There are a couple of ways you can approach it. You can have a top-down approach or a bottom-up approach. Top-down approach is you get the experts together and they sit down and analyze the domain, come up with the entities. What do we have? We have purchase orders, we have customers,

对吧?有几种做法。你可以自上而下,也可以自下而上。自上而下就是把专家们凑到一起,坐下来分析这个领域,把实体梳理出来。我们有什么?我们有采购订单,我们有客户,


[6:38]

we have customer representatives, and we're going to structure them. They have properties. These are the relationships. Okay, that's one way. And this models what we were doing back in the '80s when I was involved in expert systems. Everybody thought expert systems was the way to do AI. Symbolic AI was the way to go. Companies rose, millions of dollars were spent.

我们有客户代表,然后我们要把它们结构化。它们有属性,这些是它们之间的关系。好,这是一种做法。这其实跟我们八十年代做专家系统时的路子一样。当时所有人都觉得专家系统就是搞 AI 的正道,符号 AI 才是方向。公司一家家冒出来,几百万美元砸进去。


[7:01]

Uh the the Japanese created this uh future world project in the late '80s. People in America were my my son was taking Japanese in school because of these expert systems. And but they couldn't scale. They couldn't scale, and then we went into a kind of AI winter.

呃,日本人在八十年代末搞了个「未来世界」项目。美国这边的人——我儿子当时都在学校学日语了,就因为这些专家系统。但它们扩展不了,规模上不去,然后我们就进入了所谓的 AI 寒冬。


[7:23]

Where did neural networks came come from? Neural networks were put out there in the '60s, but they couldn't scale because we didn't happen to have Nvidia who was off making GPUs to make make reality of the of the video games fantastic, and then someone said, let's turn these things over to the neural networks, and of course, that's kind of why we're here now. So,

神经网络又是从哪儿来的?神经网络六十年代就被提出来了,但也扩展不了,因为当时我们可没有 Nvidia 在那儿造 GPU,把电子游戏的画面做得美轮美奂;后来有人说,咱们把这些玩意儿交给神经网络用吧——当然,这大概也就是我们今天为什么会坐在这儿的原因。所以,


[7:49]

the other way you can that that people are adding to or creating ontologies is is from the bottom up. For example, customer reactions. What are the things the customers are involved in? Wait. Do you these entities, these relationships, let's add this to our ontology. Let's Let's add this information to the graph. Now, as as a help,

另一种做法,也就是人们扩充或构建本体的另一条路,是自下而上。比如说客户的反馈:客户会涉及哪些事情?等等——这些实体、这些关系,我们把它加进本体里。我们把这些信息加到图里。那么,作为辅助,


[8:14]

it's helpful to be aware that there are existing taxonomies that people have been working on for the last 15 to 20 years. Things like schema.org, which has a whole set of terms and relationships, so you don't have to reinvent the wheel. In fact, you it's to your advantage to use some of these ontologies. FOAF, Friend of a Friend, for modeling social networks.

有一点值得知道:过去十五到二十年里,人们已经做出了很多现成的分类法(taxonomy)。比如 schema.org,它有一整套术语和关系,所以你不用重新发明轮子。事实上,用上这些现成的本体对你更有利。还有 FOAF,Friend of a Friend,用来给社交网络建模。


[8:40]

The Dublin Core, which was an early an early attempt to come up with terms for describing uh research papers and books and so forth. So, there's a whole series of things. In fact, Wikipedia is based on an ontology called DBpedia. So, when you do a search on Wikipedia, it's looking things up in its giant graph database.

还有 Dublin Core,这是早期尝试给研究论文、书籍之类的东西定义描述术语的一套标准。总之有一大堆这类东西。事实上,Wikipedia 就建立在一个叫 DBpedia 的本体之上。所以你在 Wikipedia 上搜索的时候,它其实是在它那个巨大的图数据库里查东西。


[9:02]

So, this stuff has been out there underlying a lot of what we already do. So, take advantage of these things that already exist. Okay. Now, what do you do when you build your ontology? Okay, so what? I know what these entities are, I know what their relationships are, they have properties. How can I do anything with them? Well, there are other augmenting technologies, auxiliary technologies.

所以这些东西早就存在了,支撑着我们日常在做的很多事。那就好好利用这些已有的成果。好,那么当你建好了本体之后要做什么?好吧,那又怎样呢?我知道有哪些实体,知道它们之间的关系,知道它们有属性——我拿它们能干什么?其实还有一些增强性的技术、辅助性的技术。


[9:29]

Things that we call the things like RDFS, which is a technology, and OWL, which I'll talk more about. So, these have these kind of sit over to the side of your graph. So, I'm not going to talk about on I mean ontology is a big word and it's often confusing and used in many ways, but think of it as a graph data structure. Okay?

就是我们所说的那些东西,比如 RDFS,这是一种技术,还有 OWL,我待会儿会多讲一点。这些东西是搭在你的图旁边的。所以我不打算讲……我是说,ontology 是个大词,经常让人困惑,用法也五花八门,但你就把它想成一个图数据结构就行了。好吧?


[9:50]

And you have the entities and relationships, but you want to apply some control over them. Or you want to be able to make inference over them. So, for example, there is uh some terms in this technology called RDFS. Domain and range. So, if I say teaches has a domain of teacher. That means if I say Bob teaches Scooter in my text, I can infer that Bob is a teacher.

你有实体和关系,但你想对它们施加一些约束,或者你想在它们之上做推理。举个例子,RDFS 这个技术里有几个术语:domain(定义域)和 range(值域)。如果我说 teaches 的 domain 是 teacher,那意思就是,如果我在文本里说「Bob teaches Scooter」,我就能推断出 Bob 是一位 teacher。


[10:21]

And if I say all teachers are persons, then this statement lets me know if I say Bob teaches Scooter, now I know Bob is a person, Bob is a teacher. What about Scooter? If I say teaches has a range of student, that means the the right side of the verb, then Scooter is a student. And now I have this extra information into my system.

而如果我再说「所有 teacher 都是 person」,那么这条陈述就让我知道:当我说「Bob teaches Scooter」时,我现在知道 Bob 是个 person,Bob 是个 teacher。那 Scooter 呢?如果我说 teaches 的 range 是 student——range 指的是动词右边的那一侧——那么 Scooter 就是个 student。这样我的系统里就多出了这些额外的信息。


[10:43]

OWL also has a series of of of properties that allow you to make some inferences. So, a transitive property transitive property says, if Sue is an ancestor like ancestor is a transitive property. If Sue is an ancestor of Mary and Mary is an ancestor of Ann, then Sue is an ancestor of Ann.

OWL 也有一系列属性可以让你做推理。比如传递性属性(transitive property)——传递性属性是说,如果 Sue 是……就拿「祖先」来说吧,ancestor 是一个传递性属性。如果 Sue 是 Mary 的祖先,Mary 又是 Ann 的祖先,那么 Sue 就是 Ann 的祖先。


[11:07]

Okay? This was not initially into my graph system, but with applying these functional properties, I can then add and augment the system with this extra data. So, that's very useful. Then there's some properties called functional properties,

对吧?这条信息一开始并不在我的图系统里,但通过应用这些功能性属性,我就能给系统补充和扩充出这些额外的数据。所以这非常有用。然后还有一类叫函数性属性(functional property)的东西,


[11:26]

which means only one. So, has father is a functional property. You can only have one father. You can only have one mother. That is a functional property. Okay? So, that's that can serve as a constraint. So, when if you say Bob is my Bob is Jim's father, BB is Jim's father,

也就是“有且只有一个”。所以 has father(有父亲)是一个 functional property(函数性属性)。你只能有一个父亲,只能有一个母亲,这就是 functional property。对吧?所以它可以作为一个约束。那么,如果你说 Bob 是 Jim 的父亲,BB 也是 Jim 的父亲,


[11:51]

well, the inference here is that Bob and BB are two ways of representing the same individual because that is a functional property. Can only have one. So, these derivations and constraints that don't sit in the graph, they sit sort of on the side and they can help as we're going to see, I'm going to propose,

那么这里能推出:Bob 和 BB 其实是同一个个体的两种表示方式,因为这是一个 functional property,只能有一个。所以这些推导和约束并不在图里面,它们是放在旁边的,而且正如我们接下来会看到的——这是我要提出的观点——它们能帮上忙,


[12:14]

when we deal with agents, how they can they can help us out. So, what about agents? Everybody's talking about agents now and everybody's talking about loops. Loops, loops, loops everywhere. Loops have been around for a long time. Back in the '60s, people were debating who has the best programming language?

尤其是在我们处理 agent 的时候,它们能帮我们解决问题。那么 agent 怎么说?现在人人都在谈 agent,人人都在谈循环。循环、循环,到处都是循环。循环其实早就存在了。早在六十年代,大家还在争论谁的编程语言最好,


[12:35]

Fortran or COBOL? No, mine is better. No, mine is better. Oh, you don't know anything. You don't know what you're talking about. Bohm and Jacopini in 1966 came out and said, "Okay, there is no real difference in programming languages if they have three aspects.

是 Fortran 还是 COBOL?“不对,我的更好。”“不对,我的才好。”“哎,你什么都不懂,你根本不知道自己在说什么。”结果 Böhm 和 Jacopini 在 1966 年站出来说:“好了,只要一门编程语言具备三个要素,它们之间就没有本质区别。


[12:51]

Sequence. I can put statement A, statement B, statement C. Fine. I have conditionals. I can have if then. And the last piece, I have a loop. If I have a loop, if I have iteration, if I take these three things, the the language is what's called Turing complete. Can do any can compute anything that a can be computed by computational devices from the work of Alan Turing.

第一是顺序(sequence)。我可以写语句 A、语句 B、语句 C,没问题。第二是条件分支,我可以写 if-then。最后一块,我有循环。只要有循环、有迭代,把这三样凑齐,这门语言就是所谓的图灵完备(Turing complete)。它能计算任何可被计算设备计算的东西——这来自 Alan Turing 的工作。


[13:19]

Okay? And now we're seeing this in agentic AI. Agents are now have loops. Loops give us the last piece in the equation of giving us a technology that is capable of doing anything that computational devices can do. The danger though of loops is that they can break.

对吧?现在我们在 agentic AI 里又看到了这一点。agent 现在有了循环。循环给了我们这个等式中的最后一块拼图,让我们拥有了一种能做任何计算设备能做之事的技术。但循环的危险在于,它可能会出问题。


[13:45]

If you're If you're a programmer, you know, you've all go into infinite loop. Not good. Loops can drift as agents start talking to each other, things get all go off off the rails. And loops can cost you money. Token counts crank up as the loops continue. So, you don't you need to be careful, okay? But in a way we are revisiting some of the early stuff with symbolic AI. I would argue we're going back to the world of expert systems.

如果你是程序员,你懂的,大家都写过死循环。那可不妙。循环还会漂移(drift)——当 agent 之间开始互相对话,事情就整个跑偏了。而且循环还会烧钱:循环一直转下去,token 数就不断往上飙。所以你得小心,对吧?不过某种意义上,我们其实是在重访符号 AI(symbolic AI)的早期成果。我认为我们正在回到专家系统(expert systems)的世界。


[14:20]

Which is the symbolic part of the whole thing. So, I want to show you a little example using Claude agent. So, little code here. Don't get scared, but I know nobody does Python anymore, but you got to look at what the agent's giving you and you got to you got to move in and and manipulate it. So,

那正是这整件事里的符号主义部分。所以我想给大家演示一个用 Claude agent 做的小例子。这里有一小段代码,别被吓到——我知道现在没人自己写 Python 了,但你还是得看看 agent 给了你什么,你得深入进去、动手调整它。所以,


[14:39]

here's a here's a loop while true, classic Python loop. Okay? And so, we have a client. So, we're actually So, the first little chunk here that you see, r e s p, the response, this is just some code where we have a model and we have uh we have a prompt, that's part of part of the messages,

这里是一个 while True 循环,经典的 Python 写法。对吧?然后我们有一个 client。你看到的第一小块,resp,也就是 response,这只是一段代码:我们指定了一个模型,还有一个 prompt,那是 messages 的一部分,


[15:00]

and we have a tool, and we're we're asking the LLM to solve this problem using a tool. Now, here's the here's the catch. LLMs can't do anything. All they can do is give us the next word with a high probability. Amazingly, we can now have these conversations it, but they can't do anything. But, we can give it a tool,

还有一个 tool,我们请 LLM 用这个 tool 来解决问题。现在,关键点来了:LLM 什么也做不了。它唯一能做的就是以高概率给出下一个词。神奇的是我们现在居然能和它对话,但它做不了任何事。不过,我们可以给它一个 tool,


[15:27]

and we can give it what we want, and say, "How do you think this tool can help us get what we want?" And then the LLM will set up the parameters, and come back to us, and say, "Okay, here's my response. I can't execute this tool, but I know what the input parameters are. I know what your context is. I know what your prompt is. So, here is the call that you need to make of the tool, because I can't do it. I'm the LLM. I'm just locked in this box.

把我们想要的东西告诉它,然后问:“你觉得这个 tool 怎么能帮我们拿到想要的结果?”接着 LLM 会把参数配好,回过头来对我们说:“好,这是我的回复。我没法执行这个 tool,但我知道输入参数是什么,我知道你的上下文是什么,我知道你的 prompt 是什么。所以这就是你需要发起的那次 tool 调用,因为我做不到。我是 LLM,我被锁在这个盒子里。”


[16:03]

Okay? So, the second box the second chunk is stop reason. So, stop reason means the LLM has stopped for some reason. The The reason here is that it can't do anything, and if the reason is tool use, ah, now it's time. Let's go execute that tool. So, that second line, get tool. It takes the response, which is formulating the the parameters, and triggering the action.

对吧?那么第二个方框、第二块就是 stop reason(停止原因)。stop reason 意味着 LLM 因为某个原因停下来了。这里的原因就是它什么也做不了;而如果原因是 tool use,啊,那就到点了——我们去执行那个 tool 吧。所以第二行是 get tool,它接过那个 response——里面已经把参数组织好了——然后触发这个动作。


[16:32]

Okay. Now, I have this stuff in red here. This is where I think the LLMs and other uh I'm sorry, not LLMs. The ontologies and stuff can come in. So, if you look down there, after the the tool is called, it said tool runs. This is where ontologies could come in.

好。现在我这里标红的部分,就是我认为 LLM——不好意思,不是 LLM——是 ontology 之类的东西可以介入的地方。所以你往下看,在 tool 被调用之后,那里写着 tool runs(工具运行),这里就是 ontology 可以发挥作用的地方。


[16:56]

The tool's going to give us information. We put the information in a form that our our our our validator can use, and think about the validator as operating with this these ontologies about our domain, then we can make some sense of whether the response of the LLM is reasonable. So, this is the loop. Call a tool, check the stop reason.

tool 会给我们返回信息。我们把这些信息整理成 validator(校验器)能用的形式,你可以把这个 validator 想象成基于我们领域的这些 ontology 来运作的,这样我们就能判断 LLM 的回复是否合理。所以这就是那个循环:调用一个 tool,检查 stop reason。


[17:28]

If it's a reasonable result, then let's go with it. If it's not reasonable, go back to the LLM. Say, "Oh, this is this is not working." Or get a human in the loop. But the idea is to surround the input with checks. Now, I've got this something that you that you should be at least taking a look at if you're doing some of this coding is something called Pydantic. Pydantic is a way to specify the types of what you want the types of

如果结果合理,那我们就往下走。如果不合理,就回到 LLM,告诉它:“哎,这个不行。”或者引入一个人来把关(human in the loop)。总之核心思路是用各种检查把输入包裹起来。另外,如果你在写这类代码,有个东西你至少应该看一看,叫 Pydantic。Pydantic 是一种用来指定类型的方式——指定你想要的参数


[17:58]

the parameters to be. Those of you who who do know Python, know Python is a unstructured type language. So, you can have a variable x = 20, x = hello, no problem. There's no typing. Pydantic adds typing to that. So, you want to check your types with Pydantic and then check your results with the ontology.

是什么类型。懂 Python 的人都知道,Python 是一门无类型约束的语言。你可以写 x = 20,再写 x = hello,完全没问题,没有类型系统。Pydantic 给它加上了类型。所以你要用 Pydantic 检查类型,再用 ontology 检查结果。


[18:23]

So, Pydantic at the door, ontology at the ledger, and pure agents and by the way, your agents should try to have no side effects. That helps the whole logic. Meaning, they're not running off doing something that they're they're changing they're changing things in the database not yet.

所以,入口处用 Pydantic 把关,记账那一层用 ontology 把关,还要让 agent 保持纯粹——顺便说一句,你的 agent 应该尽量没有副作用(side effects),这对整体逻辑很有帮助。意思是,别让它们跑出去乱做事、去改数据库里的东西——先别改。


[18:40]

You want to run them through the ontology first and make sure that works. Okay. I only got an I've got I've got another I've just a short time. I'm going to try to show you some of the things that um that you can some logical constructs from from something called OWL, the uh the web object language for for objects.

你要先让它们过一遍 ontology,确认没问题。好。我时间不多了,只剩一小会儿。我想给大家看一些东西,一些来自 OWL 的逻辑构件——OWL 就是那个 Web Ontology Language,用来描述对象的。


[19:01]

So, you have these functional properties, disjoint properties. I'll just put these you can look at the slides, but essentially the errors it can catch. Look over in the the right-hand column. A second refund on the same order is a is is a problem. But ontologies could catch it, whereas it's it's very tricky to do that in in English. A payout sent to the support desk instead of the buyer. Okay?

所以你有 functional property(函数性属性)、disjoint property(不相交属性)。我就先放在这儿,大家可以看幻灯片,但重点是它能捕捉的那些错误。看右边那一列:对同一笔订单发起第二次退款,这就是个问题,而 ontology 能抓出来,用英文自然语言来做这件事就非常棘手。再比如打款被发给了客服而不是买家。对吧?


[19:27]

You can catch that with an owl disjoint property where customer and support rep are two separate entities. Okay? Uh one of may a made-up value like probably shipped. You can specify you must have certain kinds of value. So, uh the status paid, shipped, or refunded, nothing else. And when you're in the pure text world, this can get this can get funky because the the LLMs are again probabilistic and um return some crazy stuff. Okay. Uh so,

你可以用 OWL 的 disjoint property 抓到这个问题——把 customer 和 support rep 定义成两个互不相交的 entity。对吧?还有那种编造出来的取值,比如“probably shipped(大概发货了)”。你可以规定必须取某些特定的值,比如状态只能是 paid、shipped 或 refunded,别的都不行。而当你身处纯文本的世界里时,这事就会变得很离谱,因为 LLM 本质上是概率性的,会返回一些很奇怪的东西。好。那么,


[20:03]

really what the point I want to make here is use these re- you can have a reasoner built on ontology to check keep the LLM on track, have guardrails to keep it honest. Okay? And for the guardrails, I'm referring to these concepts re- these support technologies with RDFS and owl.

我真正想说的重点是:用这些——你可以基于 ontology 构建一个 reasoner(推理机),用它来做检查、让 LLM 不跑偏,用护栏(guardrails)让它老老实实。对吧?说到护栏,我指的就是这些概念、这些配套技术,也就是 RDFS 和 OWL。


[20:28]

And my my bottom line is and nothing is a mistake, there's no win, no fail, only a make. Okay. Feel free to reach out to me coil@burkly. I've got a I've got a I've got a little website codesupreme.ai. I'm a big fan of if you're John Coltrane has a has a some jazz called uh called Love Supreme. So, I've named my site Code Supreme. And if you go there, I've got some music and it's all good. Okay.

我最后的结论是:没有什么是错误,没有输赢,没有成败,只有去做。好。欢迎随时联系我,coyle@berkeley。我还有一个小网站 codesupreme.ai。我是个铁杆乐迷——John Coltrane 有一张爵士专辑叫 A Love Supreme,所以我把我的网站取名叫 Code Supreme。你去看看,上面有些音乐,都挺不错的。好。


[20:57]

Thanks very much. 20 minutes.

非常感谢。20 分钟。


[20:59]

[applause] [music]

[掌声] [音乐]


[21:17]

Woo!

哇哦!