API Reference
Search

Search

POST

/v1/search

Perform semantic search across your memories. Returns the most relevant content based on meaning, not just keyword matching.

Request Body

ParameterTypeRequiredDescription
querystringYesSearch query (semantic understanding)
limitnumberNoMax results to return (default: 10, max: 100)
offsetnumberNoPagination offset (default: 0)
thresholdnumberNoMinimum relevance score (0-1, default: 0.5)
spaceIdstringNoLimit search to specific space
tagsstring[]NoFilter by tags
afterstringNoFilter by date (ISO 8601)
beforestringNoFilter by date (ISO 8601)
hybridbooleanNoUse hybrid search (semantic + keyword)

Examples

Basic Search

curl -X POST https://api.hypersave.io/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "machine learning best practices",
    "limit": 5
  }'

Search with Filters

curl -X POST https://api.hypersave.io/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "product launch",
    "tags": ["marketing", "product"],
    "after": "2024-01-01",
    "limit": 10
  }'

Hybrid Search

Combine semantic understanding with keyword matching for best results:

curl -X POST https://api.hypersave.io/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "TypeScript React hooks tutorial",
    "hybrid": true,
    "limit": 10
  }'

Hybrid search works best when you need both conceptual relevance and specific keyword matches.

High Precision Search

Use a higher threshold to get only highly relevant results:

curl -X POST https://api.hypersave.io/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "quarterly revenue report",
    "threshold": 0.8,
    "limit": 5
  }'

Response

{
  "success": true,
  "results": [
    {
      "id": "doc_abc123",
      "content": "Best practices for machine learning model training include...",
      "title": "ML Training Guide",
      "score": 0.94,
      "tags": ["machine-learning", "tutorial"],
      "createdAt": "2024-01-10T14:30:00Z",
      "metadata": {
        "author": "data-team"
      }
    },
    {
      "id": "doc_xyz789",
      "content": "When deploying machine learning models to production...",
      "title": "ML Deployment Checklist",
      "score": 0.87,
      "tags": ["machine-learning", "devops"],
      "createdAt": "2024-01-08T09:15:00Z"
    }
  ],
  "pagination": {
    "limit": 5,
    "offset": 0,
    "total": 42,
    "hasMore": true
  }
}

Response Fields

FieldTypeDescription
resultsarrayArray of matching memories
results[].idstringMemory document ID
results[].contentstringMemory content
results[].titlestringMemory title
results[].scorenumberRelevance score (0-1)
results[].tagsstring[]Associated tags
results[].createdAtstringCreation timestamp
results[].metadataobjectCustom metadata
paginationobjectPagination info

Semantic vs Keyword Search

AspectSemantic SearchKeyword SearchHybrid
"car maintenance" finds "vehicle repair"
Exact phrase matching
Conceptual understanding
Best forExploratory queriesSpecific lookupsMost queries

Pagination

For large result sets, use pagination:

# Get first page
curl -X POST https://api.hypersave.io/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "meetings", "limit": 20, "offset": 0}'
 
# Get second page
curl -X POST https://api.hypersave.io/v1/search \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "meetings", "limit": 20, "offset": 20}'

Error Responses

Empty Query

{
  "success": false,
  "error": "VALIDATION_ERROR",
  "message": "Query is required"
}

Invalid Threshold

{
  "success": false,
  "error": "VALIDATION_ERROR",
  "message": "Threshold must be between 0 and 1"
}