Semantic Search

Find information by meaning, not just keywords. ContextForge uses AI-powered embeddings to understand the context of your queries.

How It Works

Traditional keyword search matches exact words. Semantic search understands the meaning of your query and finds relevant results even if they use different words.

Keyword Search

Query: "authentication error"

  • Only matches "authentication" AND "error"
  • Misses "login failed" or "auth issue"
  • No understanding of context

Semantic Search

Query: "authentication error"

  • Finds "login failed", "auth issue", "401 error"
  • Understands synonyms and related concepts
  • Ranks by relevance, not just matches

Using Semantic Search

In Claude, simply ask to search your memory. The MCP client will automatically use semantic search.

# Example queries in Claude

"Search my memory for how we handle user authentication"
"Find any documentation about the payment flow"
"What patterns did we use for error handling?"
"Look for anything related to database migrations"

MCP Tool Reference

memory_query

Search your knowledge base using semantic similarity.

Parameters

NameTypeRequiredDescription
querystringYesNatural language search query
space_idstringNoLimit search to a specific space
limitnumberNoMaximum results (default: 10)
min_scorenumberNoMinimum similarity score 0-1 (default: 0.3)
project_idstringNoSearch within a project (auto-set from linked project)
include_relationshipsbooleanNoShow connections for each result (default: false)
filtersobjectNoFilter by tags, source_types, or category

Example Response

{
  "results": [
    {
      "id": "abc123",
      "title": "Authentication Flow",
      "content": "We use JWT tokens for authentication...",
      "similarity": 0.89,
      "space": "backend-docs",
      "tags": ["auth", "jwt", "security"]
    }
  ],
  "total": 1
}

Relationship-Aware Search

When your knowledge items are connected via relationships (see Knowledge Graph), search automatically becomes smarter. It doesn't just find direct matches — it discovers related items through connections.

Direct Results

Items that semantically match your query. These are re-ranked considering their connections — items linked to other high-scoring results get boosted.

Expanded Results

Items discovered through relationships. They may not match your query directly, but they're connected to items that did. These appear as a separate "Related items" section in results.

# Example: search "onboarding" with connected knowledge

Direct results:
  1. Client Onboarding Process (89% match)
  2. Onboarding Checklist (76% match)

Related items (via relationships):
  1. Welcome Email Sequence (72% match)
     related_to → Client Onboarding Process
  2. CRM Setup Guide (65% match)
     derived_from → Onboarding Checklist

Relationship-aware search is enabled by default. The more connections you create between items, the smarter your search results become. Use include_relationships: true to also see what each result is connected to.

Tips for Better Results

  • 1

    Be descriptive, not terse

    Instead of "auth", try "how does user authentication work in our system"

  • 2

    Include context

    Mention the feature, module, or problem domain you're asking about

  • 3

    Use natural language

    Ask questions as you would to a colleague, not as keyword searches

  • 4

    Refine with spaces

    If results are too broad, search within a specific space

Under the Hood

ContextForge uses Voyage AI embeddings (voyage-3-lite) to convert text into 1024-dimensional vectors. These vectors capture semantic meaning, allowing us to find similar content using cosine similarity.

similarity = cosine(embedding(query), embedding(document))