Use cases: search, analytics and AI retrieval in one SQL engine
SereneDB speaks SQL over the PostgreSQL wire protocol. One inverted index serves full-text, vector, hybrid and geospatial search, and the same query can aggregate what it finds, over tables, Parquet files and attached databases. Each page below walks one workload in SQL that ran on SereneDB 26.11.1.
Search
One inverted index serves full-text, vector, hybrid and geospatial search, and one SQL statement can match, rank and aggregate. These pages are the ways to query it.
BM25 keyword search in SQL
Stemmed, phrase, prefix and fuzzy matching with @@ on an inverted index, ranked by BM25() and highlighted with ts_highlight, over tables or Parquet files.
WHERE name @@ 'running shoes'match · rank by bm25Nearest-neighbor search over embeddings in SQL
Store embeddings as FLOAT[N] columns, index them with hnsw or ivf, and get the nearest rows, filtered or not, with ORDER BY emb <-> $1 LIMIT k.
ORDER BY emb <-> $1 LIMIT 10knn on hnsw or ivfBM25 and vectors in one query
Keyword and vector search over one inverted index, fused with Reciprocal Rank Fusion or used as a filter, in one SQL statement: WHERE body @@ … ORDER BY emb <-> ….
SUM(1.0 / (60 + f.rank))reciprocal rank fusion in sqlPostgres FTS syntax, ranked by BM25
psql, psycopg, node-postgres and Npgsql connect over the PostgreSQL wire protocol. @@ and websearch_to_tsquery run on an inverted index that analyzes the text column itself, and BM25() ranks the matches in place of ts_rank.
@@ websearch_to_tsquery($1)postgres syntax · bm25 rankAnalytics & data
The same engine aggregates with columnar scans, window functions and joins, over native tables, Parquet files, Iceberg tables and remote PostgreSQL or ClickHouse databases, and it can index files and remote tables where they are.
Columnar analytical SQL
Tables stored by column and skipped by zonemap, with GROUP BY ROLLUP, PIVOT and window functions over tables and Parquet.
GROUP BY ROLLUP (region, service)subtotals in one querySearch and GROUP BY fresh rows
A committed row is visible to the next query, and the inverted index publishes it at the next refresh (refresh_interval, 1000 ms by default). One SELECT then searches the fresh rows with @@ and aggregates them with GROUP BY.
refresh_interval = 1000default index refresh, in msSearch log lines, group them in SQL
OpenTelemetry log records land in the otel_logs search table. @@ matches a phrase, a pattern or a trace id in them, and GROUP BY counts the matches by service and minute in the same query.
body @@ ts_like('%timeout%')matches SocketTimeoutExceptionQuery remote databases where they live
CREATE SERVER names a remote PostgreSQL or ClickHouse you query as server.schema.table. Join them in one query, or put a BM25 index over a view while the rows stay at the source.
shop.public.productsserver.schema.tableSearch files in object storage
Index Parquet, CSV, JSON and Iceberg files on S3 or disk in place with CREATE INDEX … USING inverted on a view, and refresh with REINDEX.
REINDEX INDEX logs_idxre-reads only new or changed filesAI & agents
Retrieval for LLM answers and SQL access for agents, over the PostgreSQL wire protocol, on the same index that serves search.
Hybrid retrieval for LLM answers
Chunks, embeddings and metadata in one table, retrieved with BM25 and vector search and in-index filters in one query; langchain-serenedb plugs it into LangChain.
AND access IN ('all', 'staff')permission filter in both searchesScoped SQL and search for agents
Each agent connects over the PostgreSQL wire protocol as its own role; GRANT SELECT (id, body) decides what its BM25 and vector queries read, and DELETE fails unless granted.
GRANT SELECT (id, body) ON ticketsa role per agentSearch, Ask AI and MCP over docs
Serene Docs Search indexes a Git repo, folder, website or S3-compatible bucket into SereneDB. BM25 works with no model; hybrid search needs an embeddings provider, and cited answers and an MCP server are opt-ins.
"type": "hybrid"search.type · fulltext or hybridEvery walkthrough ran on SereneDB 26.11.1
Each page’s five steps are SQL that ran on SereneDB 26.11.1 from an empty database, and the notes under them are that run’s output. Interactive demos say when their data is synthetic. Claims about other systems link to those systems’ own documentation. Performance figures come from two public benchmarks whose queries, settings and scripts are published: SearchBench (commit c3e7fe9: 1 billion OpenTelemetry log rows, 92 queries, 11 engines in 17 configurations, SereneDB 26.09.1) and VectorBench (commit 65b6ac1: 50 million Cohere Wikipedia embeddings, SereneDB 26.10.2).