← Courses
Memory Optimization
← Module 3
Module 4 of 8
Module 5 →
Intro
Scenario
Lesson
Context
Lab Build~25 min
Intro

Knowledge Doesn't Live in a List

2 min read

A flat list of facts is not a knowledge base. It's a pile. Facts in a pile have no relationship to each other. The AI knows that fact A exists and fact B exists, but it doesn't know that A depends on B, or that A contradicts C, or that B is the reason D was decided the way it was.

A knowledge graph adds the missing layer: edges. Edges are typed relationships between memory nodes. "Project architecture — depends on → database schema." "Caching decision — supersedes → earlier Redis proposal." "User preference — applies to → all new modules." When the AI can traverse edges, it doesn't just retrieve isolated facts — it retrieves connected context.

This module focuses on building the memory_edges schema: the data structure that captures these relationships when importing from a knowledge source like Obsidian. The schema you design here becomes the foundation for edge ranking and reinforcement in the next module.

Portfolio artifact
Build
A memory_edges schema — a typed graph import spec mapping knowledge source nodes to memory nodes and edges, with defined relationship types, directionality, and metadata fields.
  • Explain why edges improve retrieval quality over flat fact lists
  • Define node types and edge types appropriate for a described knowledge source
  • Specify the memory_edges schema: source node, target node, edge type, direction, weight, metadata
  • Map Obsidian's link structure to typed memory edges
  • Apply NIST MAP principles to knowledge relationship documentation
Scenario

The Vault That Doesn't Transfer

3 min read

A developer has spent two years building an Obsidian vault. Hundreds of notes: architectural decisions, project history, research summaries, team preferences, open questions, resolved debates. The vault is richly linked — notes reference each other constantly, forming a web of context that makes the vault navigable and coherent.

They want their AI to know what's in the vault. The first approach: export everything as plain text and inject it at session start. It fails immediately. At 200,000 words, the vault is far too large to inject. Chunking it into fragments and embedding them for RAG retrieval helps — now the AI can retrieve relevant passages. But the passages come back as isolated fragments. The relationships are gone.

The AI retrieves: "We decided not to use microservices because of operational overhead." But it doesn't retrieve the three notes that explain why: the post-mortem from the previous microservices failure, the team's capacity assessment from that period, and the alternative architecture note that was written the same week. Those are the why behind the decision. Without the edges that connect them, the AI knows the conclusion but not the reasoning.

The solution is to import not just the note content but the relationships — to build a graph of memory nodes connected by typed edges that mirror the vault's link structure. When the AI retrieves a decision node, it can traverse the edges to the context nodes that explain it.

That requires a schema. This module teaches you to build one.

Lesson

Nodes, Edges, and the Schema That Connects Them

3 min read

A memory_edges schema defines the structure of a typed knowledge graph: what kinds of nodes exist, what kinds of edges connect them, what direction those edges flow, and what metadata each edge carries. Building it is a three-step process.

Nodes represent units of knowledge. Different knowledge sources have different natural node types. For an Obsidian vault, the node types mirror note categories: decision (a resolved choice), context (background that explains a decision), preference (a stated style or rule), question (an open issue), reference (an external resource), project (a named initiative). Each node type has different retrieval characteristics — decision nodes should be surfaced proactively; question nodes only when relevant.

Edges capture the semantic relationship between nodes. Six edge types cover most knowledge graphs: depends_on (A can't be understood without B), supersedes (A replaces B), supports (A provides evidence for B), contradicts (A and B conflict), applies_to (A is relevant in the context of B), and derived_from (A was created because of B). Each type has a direction — supersedes flows from the newer node to the older one. Preserving direction is critical for traversal.

Each edge record needs: source_node_id, target_node_id, edge_type, direction (directed or bidirectional), weight (initial relevance, 0.0–1.0), created_at (timestamp), source_file (the Obsidian note that generated it), and metadata (a JSON field for edge-type-specific data). Weight is what makes the graph rankable — it's the starting value that edge reinforcement will update over time.

NIST MAP — Documenting Knowledge Relationships

NIST's MAP function requires documenting the context in which an AI system operates — including the data structures that shape its knowledge. A memory_edges schema is a MAP artifact: it explicitly documents what the AI knows, how that knowledge is connected, and where it came from. A well-defined schema makes the AI's knowledge base auditable. An undocumented graph is a black box.

NIST GOVERN — Source Traceability

Every edge should trace back to its source file. If the AI makes a claim based on traversing a set of edges, you should be able to reconstruct which Obsidian notes that path was derived from. The source_file field in the schema is a governance requirement, not optional metadata.

Context

Three Mapping Decisions

2 min read

Obsidian links are syntactically simple — [[Note Name]] — but semantically ambiguous. Before you can map them to typed edges, you need to make three decisions.

1. How do you infer edge type from an untyped link?

Obsidian links have no built-in type. A link from decision note A to context note B could be depends_on, derived_from, or supports — they're not the same. You have three options: (a) use note tags or folders to infer type from node category pairs, (b) use a naming convention where link context (the sentence surrounding the link) is parsed for type keywords, or (c) default all links to a generic "related" type and allow manual reclassification. Specify which approach you'll use and what its failure mode is.

2. How do you handle orphaned nodes?

Some Obsidian notes have no links — they're isolated. Orphaned nodes have no edges and won't benefit from graph traversal. You need a policy: import them as standalone nodes with no edges (they're still retrievable by embedding similarity), skip them during graph import, or flag them for manual review. Each choice has a cost.

3. What is the initial edge weight and what determines it?

Every edge needs a starting weight before reinforcement begins. A flat default (e.g., 0.5 for all edges) is safe but provides no initial ranking signal. A better approach: derive initial weight from the source note's importance score (from Module 2) — a high-importance source node gets its edges initialized with a higher starting weight. Specify your initial weighting strategy.

You'll apply all three decisions in the lab — designing a complete memory_edges schema for a described Obsidian vault structure.

🔨 Build Lab
memory_edges Schema Designer
~25 minutes · 4 exchanges
What you're building
A complete memory_edges schema for a described knowledge source — including node types, edge types, schema fields, Obsidian mapping strategy, and initial weight logic.
Roles
🗺
You — Schema ArchitectYou define the schema: node types, edge types, fields, mapping rules.
🔍
AI — Graph Engineer ReviewI'll test your schema against edge cases: orphaned nodes, ambiguous links, initial weight strategy.
Framework — apply to your schema
Node types: decision, context, preference, question, reference, project
Edge types: depends_on, supersedes, supports, contradicts, applies_to, derived_from
Schema fields: source_id, target_id, type, direction, weight, created_at, source_file, metadata
Obsidian link → typed edge: specify your inference strategy
NIST MAP: every edge traces to its source file
Deliverable
A schema spec: node type taxonomy, edge type definitions with directionality, field list with types, Obsidian mapping strategy, orphaned node policy, initial weight logic.
Shift + Enter for a new line
✓ Module Complete
You've completed Module 4 of 8. Your memory_edges schema is in your portfolio.
Next Module →