Antfly Query Operations API

Execute queries across tables using full-text search, vector similarity search, or hybrid approaches combining both with Reciprocal Rank Fusion (RRF). ## Query Types ### Full-Text Search Uses Antfly query syntax for powerful text searching: - Field-specific queries: `body:computer` - Boolean operators: `AND`, `OR`, `NOT` - Range queries: `year:>2020` - Phrase queries: `"exact phrase"` ### Semantic Search Natural language queries using vector similarity: - Searches across specified embedding indexes - Returns semantically similar documents - Supports multiple embedding models ### Hybrid Search (RRF) Combines full-text and semantic search using Reciprocal Rank Fusion: ```json { "full_text_search": {"query": "body:computer"}, "semantic_search": "artificial intelligence", "indexes": ["title_body_nomic"] } ``` ## Filtering and Exclusion Refine results with powerful filtering: ### Filter Prefix Only return documents whose keys start with a specific string: ```json {"filter_prefix": "user:"} ``` Returns only keys like "user:123", "user:456" ### Filter Query Apply an Antfly query as an AND condition: ```json {"filter_query": {"query": "+category:technology +year:>2020"}} ``` Documents must match both the main query and filter query. ### Exclusion Query Exclude documents matching an Antfly query (NOT condition): ```json {"exclusion_query": {"query": "category:deprecated OR status:archived"}} ``` **Performance Note**: All filters are applied before scoring and ranking, improving query performance. ## RAG (Retrieval-Augmented Generation) Execute queries and generate summaries using LLMs: - Supports multiple retrieval queries - Streams results as Server-Sent Events (SSE) - Returns markdown summaries with inline citations - Combines results from multiple tables ## Retrieval Agent Intelligent query routing with automatic query generation: - Classifies queries as "question" or "search" - Generates optimal search queries across tables - Returns generated responses (for questions) or document IDs (for searches) - Streams classification, keywords, queries, and results ## Improving Search Relevance Antfly provides several techniques to improve search result quality: ### 1. Hybrid Search (Combine Full-Text + Semantic) Use both `full_text_search` and `semantic_search` together. Results are merged using Reciprocal Rank Fusion (RRF) to balance keyword matching and semantic similarity. ### 2. Reranking Apply a cross-encoder model to re-score results based on query-document relevance. Rerankers are more accurate than embedding models but slower, so use them on already-filtered results (e.g., top 50-100). ```json { "semantic_search": "gaming laptops", "limit": 10, "reranker": { "provider": "antfly", "model": "mixedbread-ai/mxbai-rerank-base-v1", "field": "description", "candidate_count": 100 } } ``` ### 3. Result Pruning Filter out low-quality results by detecting score gaps or setting minimum thresholds: ```json { "semantic_search": "machine learning", "pruner": { "min_score_ratio": 0.5, "max_score_gap_percent": 30.0 } } ``` - `min_score_ratio`: Keep only results scoring at least X% of the top result - `max_score_gap_percent`: Stop when a consecutive score gap exceeds X% of the total score range ### 4. Merge Strategies Choose how full-text and semantic results are combined: - `rrf` (default): Reciprocal Rank Fusion - balanced, works well in most cases - `rsf`: Relative Score Fusion - normalizes and weights scores differently ### 5. Query Filtering Use `filter_query` and `filter_prefix` to pre-filter before scoring, improving both performance and relevance by removing irrelevant documents early. **Best Practice**: Combine techniques for optimal results: 1. Start with hybrid search (full-text + semantic) 2. Apply filters to narrow the domain 3. Use reranker on top results 4. Apply pruner to remove outliers

Operations 11

POST /db/v1/query Perform a global query #
POST /db/v1/eval Standalone evaluation endpoint #
POST /db/v1/agents/query-builder Build a search query from natural language #
POST /db/v1/agents/retrieval Retrieval Agent - Agentic document retrieval with tool calling #
POST /db/v1/agents/research Research Agent - Bounded multi-phase research with a cited report #
POST /db/v1/agents/research/jobs Start a durable research job #
GET /db/v1/agents/research/jobs/{jobId} Get a durable research job #
POST /db/v1/agents/research/jobs/{jobId}/advance Advance a durable research job #
POST /db/v1/agents/research/jobs/{jobId}/cancel Cancel a durable research job #
POST /db/v1/tables/{tableName}/query Query a specific table #
POST /db/v1/databases/{databaseName}/namespaces/{namespaceName}/tables/{tableName}/query Query an explicit namespace table #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/antfly:antfly-query-operations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

antfly-query-operations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Antfly Public Query Operations API
  version: v1alpha1
  description: Joined public contract for the Antfly server. Antfly APIs are served under `/db/v1`, auth APIs under `/auth/v1`, inference APIs under `/ai/v1`, ML prediction APIs under `/ml/v1`, and extension lifecycle APIs under `/extensions/v1`.
servers:
- url: /
security:
- BasicAuth: []
- ApiKeyAuth: []
- BearerAuth: []
tags:
- name: query_operations
  x-displayName: Query Operations
  x-docsaf-questions:
  - What's the difference between full-text and semantic search?
  - How does hybrid search with RRF work?
  - How do I improve search relevance?


# --- truncated at 32 KB (399 KB total) ---
# Full source: https://artifacts.apis.io/antfly/openapi/antfly-query-operations-api-openapi.yml