Memory links
Graph relationships between memories that support multi-hop retrieval and structural navigation. Link types include supports, contradicts, extends, and associates. Stored in the memory_links OpenSearch index.
Memory links transform the associative memory layer from a flat collection of independent documents into a structured knowledge graph. A single retrieval step using BM25 or k-NN finds memories that are directly relevant to the query. Multi-hop retrieval follows link edges: if memory A is retrieved and A supports memory B, the retrieval pipeline can follow that edge and surface B even if B would not score highly on its own against the original query. This is particularly valuable for contextual reasoning chains - understanding that outcome O was caused by event E1 which was itself preceded by condition C requires traversing at least two edges. The four link types have distinct semantic meanings: supports means the linked memory provides evidence for the same conclusion; contradicts flags inconsistency and surfaces the contradiction record for the critic agent; extends adds depth or elaboration to the source memory; associates indicates thematic or contextual relatedness without a causal claim. Graph pruning during the forgetting system's maintenance passes removes links whose source or target memories have been retired, preventing the graph from accumulating stale traversal paths.