ShapedQL is a SQL-like domain-specific language (DSL) designed specifically for building recommendation and ranking queries. It provides a familiar SQL syntax while supporting advanced retrieval, filtering, scoring, and reordering operations that are essential for recommendation systems. The language transpiles SQL-like queries into query configuration objects that define complete query pipelines.
The query language supports multiple retriever functions including similarity() for vector similarity search using embeddings, text_search() for full-text search using lexical or vector search, column_order() for retrieving candidates ordered by column values, filter() for retrieving candidates matching filter expressions, ids() for retrieving specific entity IDs, and candidate_attributes() for retrieving candidates from attributes provided at query time. Each retriever supports parameters like entity_type, limit, where clauses, and optional step names for debugging.
The system supports query encoders that determine how query vectors are created for similarity search, including precomputed_user, precomputed_item, interaction_pooling, interaction_round_robin, user_attribute_pooling, and item_attribute_pooling. Filter functions like prebuilt() and truncate() can be applied in WHERE clauses, while reorder functions including diversity(), exploration(), and boosted() can be specified in REORDER BY clauses for post-retrieval processing.
ShapedQL maps queries to a multi-stage ranking pipeline that includes retrieval (selecting candidates), filtering (applying rules to exclude candidates), scoring (computing relevance scores), and reordering (post-processing ordering). The system supports parameters using $parameter_name syntax for runtime value substitution, supporting various data types including integers, floats, strings, booleans, and arrays.
The product is designed for developers building recommendation systems, search engines, and AI agents who need to create personalized feeds, search functionality, and RAG memory systems. It integrates with various embedding models and supports both SQL syntax for quick experimentation and YAML/JSON formats for fine-grained control over query components.
admin
ShapedQL is designed for developers and engineers building recommendation systems, search engines, and AI agents. It targets technical users familiar with SQL who need to create personalized feeds, search functionality, and RAG memory systems. The product serves teams working on e-commerce platforms, content recommendation engines, and AI applications that require sophisticated ranking and retrieval capabilities.