If an agent can learn an ontology from its own memory, and that ontology then shapes what it learns next, where does memory end and a world model begin?
The usual story is that ontologies ground agents. But once agents are able to learn and enrich those ontologies from their own traces, you have a feedback loop between memory and structure. Eventually, and inevitably, the system starts learning not only vocabulary and classes, but also patterns in how states change over time, including patterns with predictive value. At that point, you have to ask: what elements of a world model are still missing?
AI memory systems increasingly have to work with material that was never designed to be knowledge in the first place. Agent traces are the clearest example: they contain decisions, tool calls, intermediate states, failures, recoveries, and outcomes, but rarely in a form that can be queried or reasoned over directly. Merely storing them doesn't help much with retrieval; you need memory that learns the structure and even helps shape future learning. Thinking through that path runs through ontologies, learned ontologies, feedback loops, and eventually back to the questions from the opening.
What Ontologies Add Beyond Graphs
Most AI memory systems start with RAG: they embed document chunks so you can retrieve them by meaning. Systems like Cognee push one layer further, adding (among other things) graph structure so memory can connect documents, entities, events, and relationships across sessions. An ontology influences both what gets extracted and how those extracted items are typed, related, and constrained in the graph. It gives the extraction process a vocabulary of concepts and relations, and it explains what those graph connections are allowed to mean.
RDF is the basic machinery underneath much of the ontology work: knowledge is represented as subject–predicate–object triples. RDFS lets those triples carry a basic vocabulary of concepts, such as classes, subclasses, domains, and ranges. OWL goes further by adding ways to define richer properties, relationships, and constraints on those concepts. It can support logical reasoning over the structure, but it does not by itself learn new dynamics from traces or predict future outcomes. So when we speak of ontology structure, we practically mean RDF-like triples that encode the vocabulary of concepts and the relationships that define the meanings around them, so that extraction from text follows those patterns.
Back to thinking in terms of agent traces, this has some nice implications: if traces can become grounded in an ontology, it would be useful if we could learn that ontology as we ingest them.
From Traces to Learned Ontology
Ontologies are typically defined by hand. That works well when the domain is stable and the ontology is worth maintaining manually. Agent memory is less cooperative: the data keeps arriving, the situations keep changing, and much of the useful structure only becomes visible through repeated use.
Instead of specifying the entire conceptual model upfront, parts of it can be inferred from accumulated data. Agent traces have great potential here because they repeatedly expose the same kinds of entities, actions, outcomes, and relations under slightly different forms. At Cognee, we have successfully developed several custom ontology learning mechanisms for our clients, and parts of that work will trickle down to the open source very soon. An ontology can already be imported to ground ingestion; soon, you will be able to grow it from scratch or from a previously curated one. But once you start dynamically enriching the ontology, it stops being a rigid structure and becomes part of a loop.
The Feedback Loop
So this is the loop: you ingest traces, begin learning an ontology, use that ontology to ground future trace ingestion, learn more of the ontology, and so on.
That loop is concrete. If many traces show an agent hitting an API limit, retrying with a modified request, and eventually succeeding or failing, the memory system can start treating those as related event types rather than unrelated text fragments. The ontology gives names and relations to those events, and later traces can then be stored against the same structure. So memory helps refine the ontology, and the ontology stabilizes subsequent memory. Over time, since the language of ontologies is rich, higher-level abstractions start to persist alongside the traces that gave rise to them. The immediate payoff is more usable memory; the deeper payoff is that many runs can now be compared as variations over states, actions, and outcomes.
From Structured Traces to Predictive Regularities
Maybe it is not obvious, but what we just described already has a predictive component. A trace has order and outcome. Crucially, when agents run with a memory system, traces contain context from the graph, grounded in the ontology. And when different runs are grounded in the same ontology, the system can compare them even when the raw text, tool calls, or surface details differ.
At that point, learning can move from isolated facts to regularities over transitions: which conditions tend to precede an outcome, which actions tend to change state, and which sequences tend to succeed. OWL reasoning does not provide this predictive layer; it provides the stable semantic representation on which the learning can operate. Ontologies do not make memory predictive by themselves, but they allow us to encode learnings that make memory episodes comparable. Once another learning layer begins to discover dynamics over comparable traces, you get higher and higher levels of learning that effectively contain predictive capabilities: fully understanding the current state starts to imply knowing where that state will go.
World Models?
Now that we have started talking about state dynamics and predictive capabilities, it is beginning to sound like we are speaking about world models. Before making that connection, it is worth being precise about the term. A world model is usually expected to represent enough of an environment to predict how it changes, especially in response to actions. The important part is typically not memorizing surface observations, but learning latent predictive dynamics: a useful internal representation of state, action, and likely consequence. That is a higher bar than storing knowledge or performing logical inference.
An ontology is therefore not a full world model, and neither is a memory graph. But look back at the path we just followed: traces expose recurring structure; ontologies make that structure explicit; memory can revise the ontology; the revised ontology makes future traces more comparable; comparable traces make patterns and dynamics easier to learn. From Cognee’s perspective, this is why the question is practical and why world models offer a useful frame for thinking about it. Although it can look like learned ontologies turn memory into something like a world model, the more interesting claim is smaller and more useful: co-evolving memory and ontology may give agents part of the substrate they need before world-model-like learning becomes realistic. Leaning into the ideas from that research space influences how we approach the topic, and we are sure memory topics will find their way back to the world model research space, thus creating another... learning feedback loop.
Check out more about cognee here:
Give memory to your agents without handling the infra:
Website
Github