Relationship Types Guide¶
How to connect memories to build knowledge graphs.
Quick Reference¶
| Category | Types | Use For |
|---|---|---|
| Knowledge Evolution | supersedes, updates, evolution_of |
Tracking changes over time |
| Evidence & Support | supports, contradicts, disputes |
Arguments and evidence |
| Hierarchy | parent_of, child_of, sibling_of, composed_of, part_of |
Organization |
| Causation | causes, influenced_by, prerequisite_for |
Cause and effect |
| Implementation | implements, documents, example_of, tests |
Code and docs |
| Conversation | responds_to, references, inspired_by |
Attribution |
| Sequence | follows, precedes |
Temporal order |
| Dependencies | depends_on |
Requirements |
Overview¶
Penfield supports 24 relationship types organized into 7 categories. Relationships are directional: from_id → to_id.
Knowledge Evolution¶
Track how information changes over time.
supersedes¶
Completely replaces older information.
Example: "API uses OAuth 2.1" supersedes "API uses OAuth 2.0"
updates¶
Partially updates existing information.
{
"from_id": "update-memory-uuid",
"to_id": "original-memory-uuid",
"relationship_type": "updates"
}
Example: "Rate limit increased to 1000/min" updates "Rate limit is 500/min"
evolution_of¶
Natural development or evolution from earlier concept.
{
"from_id": "evolved-memory-uuid",
"to_id": "original-memory-uuid",
"relationship_type": "evolution_of"
}
Example: "Microservices architecture" evolution_of "Monolithic design"
Evidence & Support¶
Express agreement or disagreement between memories.
supports¶
Provides evidence or support for a claim.
Example: "Benchmark shows 50% speedup" supports "Caching improves performance"
contradicts¶
Conflicts with or contradicts existing information.
Example: "Tests show memory leak" contradicts "Memory management is stable"
disputes¶
Disagrees with or challenges (weaker than contradicts).
Example: "Some users report issues" disputes "Feature works perfectly"
Hierarchy & Structure¶
Organize memories into hierarchies.
parent_of¶
Contains or encompasses (broader concept).
Example: "Authentication system" parent_of "OAuth implementation"
child_of¶
Is subset or part of (narrower concept).
Example: "JWT validation" child_of "Authentication system"
sibling_of¶
At same level, parallel to (peer concepts).
Example: "REST API" sibling_of "GraphQL API"
composed_of¶
Contains or is made of (composition).
Example: "Search system" composed_of "BM25 module"
part_of¶
Belongs to larger structure.
Example: "Vector index" part_of "Search system"
Causation¶
Express cause and effect.
causes¶
Directly leads to or causes.
Example: "Missing index" causes "Slow query performance"
influenced_by¶
Was shaped or affected by.
Example: "API design" influenced_by "REST best practices"
prerequisite_for¶
Required before or necessary for.
{
"from_id": "prerequisite-uuid",
"to_id": "dependent-uuid",
"relationship_type": "prerequisite_for"
}
Example: "Database migration" prerequisite_for "New feature deployment"
Implementation & Testing¶
Connect concepts to their implementations.
implements¶
Applies or implements a concept.
Example: "PaymentService class" implements "Payment processing strategy"
documents¶
Describes or documents.
Example: "API reference" documents "REST endpoints"
example_of¶
Demonstrates or exemplifies.
Example: "User login flow" example_of "Authentication pattern"
tests¶
Verifies or validates.
Example: "Integration test suite" tests "API endpoints"
Conversation & Attribution¶
Track dialogue and sources.
responds_to¶
Response to previous statement.
Example: "Solution explanation" responds_to "User question about caching"
references¶
Refers to or cites.
Example: "Implementation note" references "Architecture decision record"
inspired_by¶
Inspired or motivated by.
Example: "New caching approach" inspired_by "Redis documentation"
Sequence & Flow¶
Express temporal ordering.
follows¶
Comes after in sequence.
Example: "Deploy to production" follows "Run integration tests"
precedes¶
Comes before in sequence.
Example: "Code review" precedes "Merge to main"
Dependencies¶
Express dependencies between concepts.
depends_on¶
Requires or depends upon.
Example: "Search feature" depends_on "Embedding service"
Best Practices¶
- Use specific types -
supportsis better than a generic link - Direction matters - Think about which memory is the subject
- Combine with strength - Use
strengthparameter (0-1) to indicate confidence - Build chains - A → B → C creates traversable paths
- Connect corrections - Always link
correctionmemories to originals