Overview
The Search API provides semantic search capabilities over tensor descriptions using RAG (Retrieval-Augmented Generation) and tensor composition methods for combining multiple tensors.Prerequisites
Semantic search requires RAG to be enabled in the API configuration:503 Service Unavailable.
Semantic Search
Search tensors using natural language queries. Results are filtered to tensors you have access to.POST /search
Request Body
Natural language search query (1-1000 characters)
Maximum number of results (1-100)
Minimum maturity threshold (0.0-1.0)
Filter by categories (e.g., [“profession/detective”])
Include full tensor values in response
Response
Array of search result items
Tensor identifier
Similarity score (0-1, higher is better)
Entity identifier
Tensor description
Category path
Maturity score
Tensor values (if include_values=true)
Original query
Number of results returned
Errors
503 Service Unavailable- RAG not configured401 Unauthorized- Missing or invalid API key
Find Similar Tensors
Find tensors similar to a given tensor based on its description.GET /search/similar/{tensor_id}
Query Parameters
Maximum number of results
Response
Returns search response with similar tensors (excludes the source tensor).Errors
404 Not Found- Tensor doesn’t exist403 Forbidden- No read access to source tensor503 Service Unavailable- RAG not configured
Compose Tensors
Combine multiple tensors into a new composed tensor using various methods.POST /search/compose
Request Body
Array of tensor IDs to compose (2-10 tensors)
Optional weights for weighted composition (must match tensor count)
Composition method:
weighted_blend: Weighted average of tensorsmax_pool: Maximum value across tensorshierarchical: Hierarchical composition
Response
Source tensor IDs used
Composition method used
Composition Methods
Weighted Blend
Computes weighted average of tensor values:Max Pool
Takes maximum value at each dimension:Hierarchical
Hierarchical composition with learned structure. Good for combining related concepts.Errors
400 Bad Request- Invalid tensor count or weights mismatch403 Forbidden- No read access to one or more tensors404 Not Found- One or more tensors not found503 Service Unavailable- RAG not configured
Permission Filtering
All search operations automatically filter results to tensors you have access to:- Private: Only owner can see
- Shared: Owner and explicitly shared users can see
- Public: Everyone can see
Search Performance
Indexing
Tensor descriptions are indexed using embeddings when RAG is enabled. The index is automatically updated when:- New tensors are created
- Tensor descriptions are modified
- Tensors are deleted
Query Performance
Search queries typically complete in:- Small datasets (< 1,000 tensors): < 100ms
- Medium datasets (1,000-10,000 tensors): 100-500ms
- Large datasets (> 10,000 tensors): 500-2000ms
Best Practices
- Use specific queries: “detective with analytical skills” is better than “detective”
- Set min_maturity: Filter out immature tensors (e.g.,
min_maturity: 0.8) - Limit results: Use
n_resultsto get only what you need - Category filtering: Use categories to narrow search space
- Cache results: Search results are deterministic for the same query and dataset

