Docs · Browse sections

Search

Search by meaning, not just keywords.

ContextStream understands what you're looking for and returns relevant results even when the exact words don't match.

Six search modes

Pick the right tool for the job.

Semantic

Understands meaning and context. "database choices" finds results about "PostgreSQL decisions".

Keyword

Traditional text matching. Fast and precise when you know the exact terms.

Hybrid

Combines semantic and keyword search for best results. Recommended for most use cases.

Pattern

Regex and pattern matching for code search. Find specific syntax patterns.

Exhaustive

Every single match, like grep. Returns all occurrences with total match counts.

Refactor

All references with word-boundary precision. Safe renames with no false positives.

Token-efficient search

Start compact, expand when needed.

For API calls, set limit explicitly (the MCP tool already defaults to compact results).

terminal · search · compact
{
  "query": "auth token refresh flow",
  "search_type": "hybrid",
  "limit": 3,
  "offset": 0,
  "content_max_chars": 280
}

If has_more is true, re-run the request with offset set to next_offset.

Basic search

Semantic search across your workspace.

terminal · search · semantic
search(mode="semantic",
  query="how do we handle user authentication?",
  workspace_id="<workspace-id>",
  limit=3)

Hybrid search

Semantic understanding + keyword precision.

terminal · search · hybrid
search(mode="hybrid",
  query="JWT token refresh logic",
  workspace_id="<workspace-id>",
  limit=10)

Filtering results

Narrow down with filters.

terminal · search · filters
{
  "query": "database migrations",
  "search_type": "semantic",
  "filters": {
    "tags": ["database", "backend"],
    "file_types": [".sql", ".rs"],
    "languages": ["sql", "rust"],
    "modified_after": "2024-01-01T00:00:00Z",
    "min_score": 0.7
  }
}
tags

Filter by memory event tags.

file_types

Filter by file extension.

languages

Filter by programming language.

modified_after

Only recent content.

min_score

Minimum relevance threshold.

Understanding results

Scores, highlights, and pagination.

Search results include relevance scores, optional truncation metadata, and pagination hints.

terminal · search · response
{
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "content": "We implemented JWT authentication with refresh tokens...",
      "score": 0.92,
      "highlights": [
        {
          "field": "content",
          "snippet": "...implemented <em>JWT authentication</em> with refresh..."
        }
      ],
      "metadata": {
        "event_type": "decision",
        "tags": ["authentication", "jwt"],
        "content_truncated": true,
        "content_max_chars": 280
      }
    }
  ],
  "total": 15,
  "has_more": true,
  "next_offset": 3,
  "query_time_ms": 45
}

Next steps

Where to go from here.