Knowledge Graph Patterns
Engram’s knowledge graph connects memories with typed, directed edges. This guide covers patterns for building graphs that make recall more powerful.
Edge Types
Section titled “Edge Types”| Relation | Meaning | Example |
|---|---|---|
relates_to | General association | Auth middleware ↔ JWT library choice |
supersedes | Replaces outdated knowledge | New API design supersedes old one |
contradicts | Conflicts with | Two conflicting approaches found |
part_of | Component of a larger concept | Detail memory is part of hub memory |
derived_from | Conclusion drawn from source | Summary derived from debugging session |
summarized_by | Condensed version | Cluster of memories summarized by one |
Hub-and-Spoke Pattern
Section titled “Hub-and-Spoke Pattern”For complex topics, create a brief hub memory first, then store details as children:
{"tool": "remember", "content": "Auth system architecture overview: JWT + refresh tokens, httpOnly cookies, 15-min expiry"}Then add detail memories with parent_id to automatically create part_of edges:
{"tool": "remember", "content": "JWT signing uses RS256 with rotating keys stored in AWS KMS", "parent_id": 42}Supersession Chain
Section titled “Supersession Chain”When decisions evolve, create supersedes edges rather than deleting old memories:
{"tool": "connect", "from": 55, "to": 42, "relation": "supersedes"}This preserves history — you can trace why decisions changed.
Team Graph Patterns
Section titled “Team Graph Patterns”In team contexts, the hive mind consolidation process uses these patterns automatically:
- Deduplication: When two engineers remember the same thing, memories are merged
- Contradiction detection: Conflicting knowledge gets
contradictsedges, flagging it for resolution - Cross-team synthesis: Insights spanning domains are connected with
relates_toedges
Using Depth in Recall
Section titled “Using Depth in Recall”Set depth: 1 (up to 3) when recalling to follow edges and surface connected knowledge:
{"tool": "recall", "query": "authentication", "depth": 1}This returns not just matching memories, but their graph neighbors — surfacing related context that flat search would miss.