Note Linking
Links are what transform a collection of notes into a knowledge graph. In Cortex, links are created both automatically and manually.
Auto-Linking
When you create a note, Cortex automatically:
- Embeds the note using sentence-transformers
- Searches for similar notes in your graph (cosine similarity > 0.75)
- Creates
relates_tolinks for strong semantic matches - Emits a
note_linkedactivity event so you can review the connection
Auto-linking only creates relates_to connections. For more specific relationships like contradicts or extends, create links manually.
Relation Types
| Relation | Meaning | Example |
|---|---|---|
relates_to | General conceptual connection | âActive recallâ â âTesting effectâ |
extends | Builds upon or deepens another note | âOptimal spaced repetition scheduleâ â âEbbinghaus forgetting curveâ |
contradicts | Disagrees with or challenges | âMultitasking is efficientâ â âContext switching has a 23-minute recovery costâ |
depends_on | Requires understanding of prerequisite | âImplement caching layerâ â âUnderstand cache invalidation strategiesâ |
supersedes | Replaces an older note | âUse SQLite with Litestreamâ â âUse Postgres for persistenceâ |
derived_from | Synthesized from source material | âLearning synthesisâ â âActive recall noteâ + âSpaced repetition noteâ |
Creating Links via API
curl -X POST https://api.cortex-app.dev/api/workspace/links \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"source_id": "note_a1b2c3d4",
"target_id": "note_e5f6g7h8",
"relation": "extends"
}'Graph Traversal
When you query Cortex, it doesnât just search â it traverses. A recall query:
- Finds the top matching notes via semantic search
- Walks their links to find connected notes (1â2 hops)
- Ranks results by a combination of:
- Semantic similarity to the query
- Note importance
- Link distance (closer = higher weight)
- Recency
This means asking âWhat do I know about learning?â might surface not just notes tagged with âlearningâ, but also linked notes about âmemoryâ, âpracticeâ, and âcognitionâ that youâd never find with keyword search.
Viewing Your Graph
The Graph View page visualizes your knowledge graph as an interactive node-link diagram:
- Nodes = Notes (sized by importance)
- Edges = Links (colored by relation type)
- Clusters = Groups of densely connected notes
Click any node to see the noteâs content and its neighborhood.