The Working Memory Graph
The butcher-on-the-bus is a rhetorical device that sheds light on human memory processes. Imagine recognising someone on a bus but struggling to place their identity. Without a doubt, you know them, but it takes a moment of reflection before it hits you … a-ha! They're the local butcher!
This scenario illustrates how our memory seemingly comprises two types: one that is flexible, fuzzy, generalisable, and gradually learned, and another that is specific, precise, and acquired in a single shot.
Could this dualistic model enhance AI systems? Large Language Models (LLMs) learn statistical approximations from text corpora, granting them generalisation, flexibility, and creativity. However, they also suffer from hallucinations, unreliability, and staleness. On the other hand, databases offer accuracy, speed, and reliability but lack adaptability and intelligence.
Perhaps the key lies in bridging these two worlds, and that's where graphs come into play. By integrating LLMs with internal data through Knowledge Graphs, we can create a Working Memory Graph (WMG) that combines the strengths of both approaches in order to achieve a given task.
To build a WMG, the LLM processes a question and returns a graph of nodes using URLs as identifiers, these URLs link to ground truths stored in the organisation's Knowledge Graph. The WMG can also incorporate nodes representing conceptual understanding, establishing connections between the LLM's numerical vectors and the KG's ontological classes.
For example, imagine a restaurant processing an article about their supplier (the renowned Italian butcher Dario Cecchini) booking a ride on a bus. The LLM + KG can generate the following WMG:
{
"@context": {
"sh": "https://schema.org",
"your": "https://schema.your.org"
},
"@type": "sh:BusReservation"
"sh:underName":{
"@type": ["sh:Person", "your:Supplier"],
"@id": "https://www.wikidata.org/wiki/Q16186609” ,
"your:sameAs": "https://data.your.org/supplier/123"
}
}
This WMG combines internal and external data and concepts, serving as a context for the task at hand. It can now be used:
◽to construct further queries to the KG
◽as context injected into further prompts
◽to generate entirely new prompts
◽to assist in orchestration (and more)
In essence, the Working Memory Graph captures the best of both worlds as it results from a dual memory system.