Every span TruLayer ingests is embedded server-side and indexed in pgvector. TheDocumentation Index
Fetch the complete documentation index at: https://docs.trulayer.ai/llms.txt
Use this file to discover all available pages before exploring further.
/v1/search/spans endpoint lets you find spans by semantic similarity instead of substring match — useful for root-causing a regression (“find every span that looks like this failing one”), mining eval datasets (“grab 50 traces that resemble this user complaint”), or driving MCP agents that need to reason over trace history.
Semantic search requires a Pro plan or above (Pro, Team, Business, Enterprise). Calling either search endpoint on a Starter plan returns HTTP 402 with
code: "plan_upgrade_required".Two request shapes
| Endpoint | When to use |
|---|---|
GET /v1/search/spans?q=<text>&project_id=<uuid> | You have free-form text and want TruLayer to embed it for you (uses the tenant’s configured BYOK embedding key — OpenAI preferred, Anthropic fallback). |
POST /v1/search/spans | You already have a 1536-dim query vector and want to skip the embedding hop. |
from/to time bounds and an opaque cursor for pagination.
Example — free-text search
Example — precomputed vector
Embedding provider
TheGET form embeds the query using the tenant’s BYOK key. Configure one in Dashboard → Settings → Evaluators; without a BYOK key, the GET form returns 502 (upstream embedding provider failed). The POST form works regardless of BYOK config.