Search API

REST API

Query your knowledge base programmatically using the hybrid search engine. Free plan: 20 semantic searches/day (falls back to keyword-only after limit). Pro and Team: unlimited.

POST/api/search

Executes a cross-cutting search against the user's entire archive. Uses indexed PostgreSQL full-text search, exact partial matching, trigram typo-tolerant fuzzy matching, and semantic similarity for longer natural-language queries. Returns up to 10 of the most relevant results.

Parameters

NameTypeDescription
queryrequired
stringThe natural language query or keyword phrase to search for.

Request Example

Request
curl -X POST http://localhost:3000/api/search \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"query":"PostgreSQL vector indexing strategies"}'

Response Example

Response
{
  "results": [
    {
      "id": "uuid-123",
      "url": "https://pgvector.com",
      "title": "Scaling pgvector",
      "tldr": "How to optimize HNSW indexes...",
      "domain": "pgvector.com",
      "tags": ["Database", "Performance"],
      "keyInsights": ["Insight 1"],
      "contentType": "reference",
      "status": "ready",
      "collectionId": "collection-uuid",
      "searchReason": "Tagged with \"Database\"",
      "score": 2.45,
      "semantic_score": 0.82,
      "keyword_score": 0.81,
      "partial_score": 0.0,
      "fuzzy_score": 0.0
    }
  ],
  "semanticLimitReached": false
}