Semantic Waypoints
The magic behind comprehensive search results. Waypoints are automatic connections between related memories that give you complete context, not just exact matches.Search for one thing, get everything related automatically. No manual tagging required.
What Are Waypoints?
Waypoints = automatic connections between semantically similar memories Think of memories as cities, waypoints as roads:- Search finds the city you asked for (exact matches)
- Waypoints travel the roads to nearby cities (related context)
How Waypoints Work
1
Store Memory
You save: “JWT authentication implementation”System generates vector embedding (semantic meaning as numbers)
2
Find Similar Memories
Compares with existing memories using cosine similarity:
- 1.0 = Identical
- 0.75-0.99 = Highly similar
- 0.5-0.74 = Moderately similar
- Less than 0.5 = Weakly related
3
Create Connections
If similarity ≥ 0.75, creates bidirectional waypoint“JWT auth” ↔ “OAuth2 flow” (0.82)
“JWT auth” ↔ “Session management” (0.76)
“JWT auth” ↔ “Token refresh” (0.89)Waypoint stores similarity weight for ranking
4
Search Traverses
When you search, results include:
- Direct matches (hop 0)
- 1 connection away (hop 1, -20% salience)
- 2 connections away (hop 2, -40% salience)
- 3 connections away (hop 3, -60% salience)
Search Expansion
How search uses waypoints:- Without Waypoints
- With Waypoints
Similarity Threshold: 0.75
Why 0.75 is the sweet spot:Too Low (<0.75)
Problem: Noise“React hooks” connects to “Angular services”Both about state, but different frameworksResult: Polluted results
Just Right (0.75)
Perfect balance“React hooks” connects to:
- Context API ✓
- Redux ✓
- State lifting ✓
Too High (>0.85)
Problem: Too narrow**“React hooks” only connects to near-duplicatesMisses useful related conceptsResult: Incomplete context
Salience Decay
Distant connections rank lower than close ones: Formula:adjusted_salience = original_salience × (0.8 ^ hop_distance)
- Visual
- Example
Real-World Example
Scenario: Searching for auth implementation details- Exact auth docs ✓
- Related OAuth details ✓
- Session management ✓
- Security best practices ✓
- Even HTTPS config ✓
Control Waypoint Expansion
API parameter:expand_waypoints (default: true)
- Enabled (Default)
- Disabled
- Custom Hops
Best Practices
Use Expansion for Research
Scenario: Understanding a topic comprehensivelyResult: Complete picture of auth in your codebase
Disable for Exact Lookups
Scenario: Finding specific file or commandResult: Just the deploy command, no related deploy docs
Store Rich Context
Why: Better waypoints form automatically✅ Good:❌ Bad:Rich content = better semantic connections
Let It Auto-Connect
Don’t manually tag or linkSystem automatically finds:
- Related implementations
- Similar problems
- Connected decisions
Why Waypoints Beat Manual Tags
| Feature | Manual Tags | Waypoints |
|---|---|---|
| Setup | You tag everything | Automatic |
| Consistency | ”auth”, “authentication”, “login” → chaos | Semantic similarity handles variants |
| Maintenance | Update tags when content changes | Re-indexes automatically |
| Discovery | Only find what you tagged | Finds related content you didn’t predict |
| Effort | High (tag every memory) | Zero (happens automatically) |
| Accuracy | Depends on your tagging discipline | Mathematical similarity (objective) |
Technical Details
Vector Embeddings
Vector Embeddings
Typesense (default):
- 384-dim vectors
- Fast, efficient
- Good for most use cases
- 1536-dim (text-embedding-3-small)
- 3072-dim (text-embedding-3-large)
- More nuanced semantic understanding
- Higher cost
Cosine Similarity Formula
Cosine Similarity Formula
Waypoint Storage
Waypoint Storage
Database schema:Bidirectional: If A→B exists, B→A also exists
BFS Traversal
BFS Traversal
Breadth-first search (not depth-first)Why BFS:
- Explores many related topics (breadth)
- Before diving deep into subtopics (depth)
- Ensures diverse context
- Start with direct matches (queue)
- For each memory, get waypoint connections
- Add to queue if not visited and within max_hops
- Apply salience decay
- Continue until queue empty or max_hops reached
Next Steps
Search & Retrieval
Master search techniques
Best Practices
Optimize memory usage
Workflows
Put waypoints to work
Waypoints turn simple searches into comprehensive answers. Store memories, let the connections form automatically.