Search
The unified Search API queries across all content sources in a single request. Results are ranked by relevance using semantic embeddings via pgVector with automatic fallback to full-text search. Searches run in parallel across notes (Neo4j), channels (Supabase ilike), messages (Supabase full-text), and knowledge graph (Neo4j semantic).
/api/v2/search|Auth: JWT|Rate limit: 100 req/minUnified Search
/api/v2/searchAuthenticatedSearch across multiple content sources in parallel. Sources are searched concurrently and results are deduplicated, ranked by score, and returned as a unified list. Generates embeddings via pgVector for semantic search; falls back to full-text search if embedding generation fails.
Body Parameters
querystringrequiredThe search query string. Must be less than 500 characters.
sourcesstring[]["notes","channels","messages","knowledge"]Content sources to search. Valid values: notes, channels, messages, knowledge.
filtersobjectOptional filters to narrow results. Supports dateRange, workspace, tags, and channelIds.
filters.dateRangestringTime range filter. Presets: 1h, 24h, 7d, 30d. Also accepts ISO 8601 date strings.
filters.workspacestring (UUID)Filter results to a specific workspace.
filters.tagsstring[]Filter notes by tags.
filters.channelIdsstring[] (UUIDs)Filter messages to specific channels.
useSemanticSearchbooleantrueEnable semantic search via embeddings. Falls back to full-text if embedding generation fails.
limitnumber20Maximum total results to return across all sources.
Request
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/search \
-H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
-H 400">class="text-emerald-400">"Content-Type: application/json" \
-d '{
400">class="text-emerald-400">"query": 400">class="text-emerald-400">"meeting notes 400">from last week",
400">class="text-emerald-400">"sources": [400">class="text-emerald-400">"notes", 400">class="text-emerald-400">"channels", 400">class="text-emerald-400">"messages", 400">class="text-emerald-400">"knowledge"],
400">class="text-emerald-400">"filters": {
400">class="text-emerald-400">"dateRange": 400">class="text-emerald-400">"7d",
400">class="text-emerald-400">"workspace": 400">class="text-emerald-400">"d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90"
},
400">class="text-emerald-400">"useSemanticSearch": true,
400">class="text-emerald-400">"limit": 20
}'Response 200
{
400">class="text-emerald-400">"query": 400">class="text-emerald-400">"meeting notes 400">from last week",
400">class="text-emerald-400">"results": [
{
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e",
400">class="text-emerald-400">"source": 400">class="text-emerald-400">"notes",
400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"note",
400">class="text-emerald-400">"title": 400">class="text-emerald-400">"Weekly Team Meeting",
400">class="text-emerald-400">"content": 400">class="text-emerald-400">"Meeting content covering sprint progress, blockers, and action items for the engineering team...",
400">class="text-emerald-400">"url": 400">class="text-emerald-400">"/notes/7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e",
400">class="text-emerald-400">"score": 0.95,
400">class="text-emerald-400">"metadata": {
400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-03-14T10:00:00.000Z",
400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-14T10:45:00.000Z",
400">class="text-emerald-400">"tags": [400">class="text-emerald-400">"meeting", 400">class="text-emerald-400">"engineering"],
400">class="text-emerald-400">"workspace": 400">class="text-emerald-400">"d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90"
}
},
{
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"a2b3c4d5-e6f7-8901-abcd-ef2345678901",
400">class="text-emerald-400">"source": 400">class="text-emerald-400">"messages",
400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"message",
400">class="text-emerald-400">"title": 400">class="text-emerald-400">"Let's review the notes 400">from Monday's meeting...",
400">class="text-emerald-400">"content": 400">class="text-emerald-400">"Let's review the notes 400">from Monday's meeting before the standup. The main takeaway was shifting priority to the calendar integration...",
400">class="text-emerald-400">"url": 400">class="text-emerald-400">"/channels/c1d2e3f4-a5b6-7890-cdef-012345678901/messages/a2b3c4d5-e6f7-8901-abcd-ef2345678901",
400">class="text-emerald-400">"score": 0.82,
400">class="text-emerald-400">"metadata": {
400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-03-15T09:30:00.000Z",
400">class="text-emerald-400">"author": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
400">class="text-emerald-400">"channel_id": 400">class="text-emerald-400">"c1d2e3f4-a5b6-7890-cdef-012345678901"
}
},
{
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"b3c4d5e6-f7a8-9012-bcde-f34567890123",
400">class="text-emerald-400">"source": 400">class="text-emerald-400">"channels",
400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"channel",
400">class="text-emerald-400">"title": 400">class="text-emerald-400">"weekly-meetings",
400">class="text-emerald-400">"content": 400">class="text-emerald-400">"Channel for weekly team meeting notes and follow-ups",
400">class="text-emerald-400">"url": 400">class="text-emerald-400">"/channels/b3c4d5e6-f7a8-9012-bcde-f34567890123",
400">class="text-emerald-400">"score": 0.72,
400">class="text-emerald-400">"metadata": {
400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-01-10T08:00:00.000Z",
400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-18T14:00:00.000Z",
400">class="text-emerald-400">"workspace": 400">class="text-emerald-400">"d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
400">class="text-emerald-400">"is_private": false
}
},
{
400">class="text-emerald-400">"id": 400">class="text-emerald-400">"c4d5e6f7-a8b9-0123-cdef-456789012345",
400">class="text-emerald-400">"source": 400">class="text-emerald-400">"knowledge",
400">class="text-emerald-400">"400">type": 400">class="text-emerald-400">"concept",
400">class="text-emerald-400">"title": 400">class="text-emerald-400">"Meeting Best Practices",
400">class="text-emerald-400">"content": 400">class="text-emerald-400">"Guidelines for effective meetings including agenda preparation, note-taking standards, and action item tracking...",
400">class="text-emerald-400">"url": 400">class="text-emerald-400">"/knowledge/c4d5e6f7-a8b9-0123-cdef-456789012345",
400">class="text-emerald-400">"score": 0.65,
400">class="text-emerald-400">"metadata": {
400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-02-20T11:00:00.000Z",
400">class="text-emerald-400">"concepts": [400">class="text-emerald-400">"meetings", 400">class="text-emerald-400">"productivity"],
400">class="text-emerald-400">"document_type": 400">class="text-emerald-400">"guideline"
}
}
],
400">class="text-emerald-400">"total": 4,
400">class="text-emerald-400">"sources": {
400">class="text-emerald-400">"notes": 1,
400">class="text-emerald-400">"messages": 1,
400">class="text-emerald-400">"channels": 1,
400">class="text-emerald-400">"knowledge": 1
},
400">class="text-emerald-400">"searchMethod": 400">class="text-emerald-400">"semantic",
400">class="text-emerald-400">"responseTime": 187
}