Database use cases for search, analytics and AI agents
SereneDB is an open-source database for real-time search analytics. It combines search-engine capabilities, analytical query processing and a PostgreSQL-compatible SQL interface over the same tables.
Eleven workloads, in the same three groups as the site menu. Every one of them runs on the same engine.
-- one index: a text analyzer and an ivf column
CREATE INDEX movies_idx ON movies
USING inverted(id, title english, overview english,
embedding ivf (metric = 'cosine'));
-- search selects the rows, GROUP BY aggregates them
SELECT genre, COUNT(*) AS matches,
ROUND(AVG(vote_average), 2) AS avg_rating
FROM movies_idx
WHERE overview @@ 'space'
GROUP BY genre
ORDER BY matches DESC, genre;
Search
One inverted index serves full-text, vector and geospatial search; these pages are the ways to query it.
BM25 ranking over tables and files
Match with the @@ operator on an inverted index (phrases, proximity, prefix, fuzzy and regex terms) and rank with BM25, one of nine scorers.
ANN indexes beside relational data
An IVF index on a fixed-size FLOAT[N] column: L2, cosine, inner-product or L1 distance, kNN or radius queries, and quantization on L2 and inner-product indexes.
BM25 and vector scores in one query
A @@ filter in WHERE with vector distance in ORDER BY, or a BM25 branch and a vector branch fused with Reciprocal Rank Fusion in SQL.
Keep your drivers, rank with BM25
Wire protocol v3.0, so most Postgres clients and drivers connect without code changes. @@ and websearch_to_tsquery run on the inverted index; there is no tsvector type.
Analytics & data
Aggregations run on the same engine as search, over native tables, files in object storage and attached databases.
Aggregate fresh data, no nightly job
A search predicate and a GROUP BY in one statement. New rows become searchable at the next index refresh: every second by default, or on VACUUM (REFRESH_TABLE).
Vectorized scans over columnar data
GROUP BY, GROUPING SETS and window functions in plain SQL, with filters and projections pushed down into Parquet scans.
Index object storage in place
An inverted index over a view on Parquet, CSV, JSON, ORC or Iceberg, on disk or S3. The files stay the source of truth; REINDEX picks up changes.
Query remote sources where they live
CREATE SERVER names a remote PostgreSQL or ClickHouse you query as server.schema.table. Index a view over one of its tables and the rows stay in the remote engine.
AI & agents
Retrieval for models and agents, in SQL over the PostgreSQL wire protocol.
Agent-ready SQL, scoped with GRANT
An agent connects over the Postgres wire protocol on port 7890, as a role you GRANT exactly what it may read; ai_embed embeds its query text inside the statement.
Retrieval layer for grounded answers
Chunks, embeddings and metadata in one table and one index. langchain-serenedb implements LangChain's VectorStore, with BM25 as the lexical half of hybrid retrieval.
Search over docs and knowledge bases
Serene Docs Search indexes a Git repo, folder, website or S3 bucket into SereneDB. BM25 works with no model; hybrid search, cited answers and an MCP server are opt-ins.
SearchBench
Our open benchmark: 92 search, aggregation and join queries over log-shaped data, with every engine adapter published.
See the results →Get started
Quick start →Download SereneUI →One engine under all eleven
The eleven use cases above are three pieces used in different combinations: one SQL engine, one inverted index and the PostgreSQL wire protocol in front of both.
One SQL engine
Tables, joins, aggregates and window functions, in a dialect that closely follows PostgreSQL. The few exceptions are listed on the compatibility page.
One inverted index
Analyzed text, verbatim and range fields, IVF vectors and geo in one CREATE INDEX … USING inverted, and a query may constrain any subset of them. That is the index’s shape, not the breadth of its vector features: the one documented ANN index is IVF, and quantization applies to L2 and inner product only.
The Postgres wire protocol
Protocol v3.0 on port 7890: most PostgreSQL clients, drivers and tools connect without code changes. Compatibility stops at the protocol and the dialect: CREATE ROLE … REPLICATION is accepted and has no effect.
One engine is also one machine: no replication, no failover and no managed service.
Frequently Asked Questions
About the hub as a whole. Each use-case page answers its own questions.
Three groups: search (full-text, vector, hybrid and Postgres-compatible search), analytics over native tables, data lakes and attached databases, and retrieval for AI agents, RAG and documentation. SereneDB is a search-OLAP database, and the pages here stay with those workloads.
In SereneDB, yes: one inverted index carries a text analyzer over the text columns and an IVF index over the embedding, and a GROUP BY runs over the rows a search predicate selects, in one statement. The limits: the one documented ANN index is IVF, and the index is eventually consistent, refreshed every second by default.
Search and vector retrieval alone do not. In SereneDB both are indexes on ordinary SQL tables, so full-text, vector and filter conditions sit in the same statement as joins and aggregates, and JSON documents are indexed the same way as relational columns. This hub covers search, analytics and AI retrieval; key-value caching is outside it.
Get Started with SereneDB
A single binary, from the Docker image or the Linux install script. Connect with psql on port 7890, load a dataset, index it for full-text and vector search and query it; the quick start does it in one session.