Skip to main content

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)
Example:
Benefit: Search feels like asking a colleague who knows the whole story, not just keywords.

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)
Duration: Waypoints created within 5-10 seconds after storing memory (async)

Search Expansion

How search uses waypoints:
Problem: Incomplete context

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 ✓
All genuinely relatedResult: Relevant context

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)
Why: Direct matches most relevant, distant connections provide context but rank lower
Result: Best matches float to top, related context follows

Real-World Example

Scenario: Searching for auth implementation details
You searched for auth implementation. You got:
  • Exact auth docs ✓
  • Related OAuth details ✓
  • Session management ✓
  • Security best practices ✓
  • Even HTTPS config ✓
Complete context automatically assembled.

Control Waypoint Expansion

API parameter: expand_waypoints (default: true)
Returns: Direct matches + 3 hops of connected memoriesUse when: You want comprehensive context (most searches)

Best Practices

Use Expansion for Research

Scenario: Understanding a topic comprehensively
Result: Complete picture of auth in your codebase

Disable for Exact Lookups

Scenario: Finding specific file or command
Result: 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
Just store memories, waypoints handle the rest

Why Waypoints Beat Manual Tags


Technical Details

Typesense (default):
  • 384-dim vectors
  • Fast, efficient
  • Good for most use cases
OpenAI (optional):
  • 1536-dim (text-embedding-3-small)
  • 3072-dim (text-embedding-3-large)
  • More nuanced semantic understanding
  • Higher cost
Both use cosine similarity for comparison
0.75 threshold = strong semantic relationship
Database schema:
Bidirectional: If A→B exists, B→A also exists
Breadth-first search (not depth-first)Why BFS:
  • Explores many related topics (breadth)
  • Before diving deep into subtopics (depth)
  • Ensures diverse context
Algorithm:
  1. Start with direct matches (queue)
  2. For each memory, get waypoint connections
  3. Add to queue if not visited and within max_hops
  4. Apply salience decay
  5. 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.