Week 4 · Lesson 2 of 10

Represent Memory with Relational, Vector, and Graph Layers

0% Complete

Overview

A practical memory layer can use three complementary storage systems, each responsible for a different part of the problem.

The relational store tracks the administrative structure of the data. It can record documents, chunks, source information, and provenance. This layer answers questions such as which file a fact came from, which chunk was processed, and what data item is associated with a stored representation. File-system metadata can also be preserved, including the file name, extension, MIME type, file size, and content hash.

The vector store holds embeddings used for semantic similarity. Its purpose is to find content that is close in meaning to the user request or agent query. Vector retrieval is valuable because it can quickly narrow a large body of information to a smaller set of likely candidates. It is especially effective when the needed answer is stated directly in a semantically related passage.

The graph store captures entities and the relationships among them. It can represent that one company uses a particular database, that a regulation applies to that database, that the regulation requires a specific audit trail, and that failure to implement the audit trail can affect a compliance certificate. These relationships allow the system to perform multi-step retrieval rather than relying only on similarity between isolated chunks.

The graph is built on top of the embeddings rather than replacing them. The vector layer helps locate relevant regions of memory. The graph layer then exposes the entities, concepts, types, and relationships that connect the retrieved information. This is the core of a graph-vector memory representation.

Ontologies give additional structure to the graph. An ontology defines the kinds of things that exist in a domain and how they should be interpreted. For example, an extracted item may be identified not only as an entity, but as a location, company, database, contract, invoice, payment, account status, or workspace entitlement. This matters because the same word can have different meanings in different domains. Even common business terms such as "year" and "revenue" may require domain-specific interpretation.

A simple example is a knowledge base about RAG. A document can be linked to extracted concepts such as embeddings, retrieval-augmented generation, prompt stuffing, large language models, and hallucination. When a user asks, "What is RAG?" the question can be connected to the RAG concept, and the graph can also surface nearby concepts that help explain it. The retrieved context is no longer just a set of similar passages. It is a structured neighborhood of related knowledge.

The important design principle is not a particular database product. It is the separation of responsibilities among provenance, semantic similarity, and relationships. The relational layer explains where information came from, the vector layer locates semantically relevant material, and the graph layer explains how the selected facts are connected.

Back to top