Skip to main content

Search API

A single endpoint that fans out across nine entity types in a lab and returns case-insensitive substring hits, capped at five matches per category. Use it as the backing query for command palettes, MCP tool calls, and “what do we know about X?” workflows.

Search a Lab

labId
string
required
Convex ID of the lab to search.
q
string
required
Search query. Minimum 2 characters. Case-insensitive substring match.

Response

Returns a single object with one array per entity type. Each array is capped at 5 hits. Empty arrays mean “no match in this category” (not “category disabled”).
experiments
object[]
required
Matches title, experimentId, or result.
papers
object[]
required
Matches title or target (target journal).
agents
object[]
required
Matches name, role, or model.
knowledge
object[]
required
Matches name, entityType, or description.
surveys
object[]
required
Matches name or description.
tasks
object[]
required
Matches title, description, or experimentId.
figures
object[]
required
Matches title or figureType.
datasets
object[]
required
Matches name, description, or datasetType.
contributions
object[]
required
Matches title, description, or type.

Behavior notes

  • Queries shorter than 2 characters return all empty arrays (not an error). Use this to short-circuit on the client.
  • Each entity object is the full Convex document, not a stripped projection. Render only the fields you need.
  • Search is read-only. Subject to the read rate limit.
  • Returns 400 if labId or q is missing.

Common Workflows