omgbase-search
The omgbase search layer — Rust implementation (the pure half).
Search is how an omgbase repository is found in: full-text search over
block text (SQLite FTS5, bm25), semantic search over block and document
embeddings (brute-force cosine), and their fusion with explainable boosts.
This crate holds the parts that are pure functions of their inputs plus the
provider protocol: the FTS5 query sanitizer, which blocks embed and the exact
strings a provider is asked for, the cache keys, the document input and its
whole-vs-pooled budget, block-vector pooling, cosine, RRF fusion and boosts,
the resolve shaping, the EmbeddingProvider seam with its stdio and
http(s) implementations (the latter behind the http feature), and the
deterministic fixture embedder the conformance fixtures use. Index
maintenance and the queries over the database live in
omgbase-store, which calls this
crate for its text_search, embedding drain, vector_search, hybrid_search
and resolve.
use ;
assert_eq!;
let q = FixtureEmbedder.embed_query.unwrap;
assert!;
assert_eq!;
The reference is the TypeScript engine
@omgbase/core
(search/{fts-query,embeddings,tasks,vector,rrf,resolve,external}.ts). Both
conform to the language-neutral specification at
spec/search:
README.md is the contract, cases/*.json the executable fixtures. The
conformance runner (tests/spec.rs) drives omgbase-store through the
observation scripts, drains with the fixture embedder and checks every
projection; tests/spec-passing.txt, when present, names the cases that must
pass while the port runs behind the fixtures (SEARCH_SPEC_UPDATE=1 rewrites
it).
Features
http— the http(s) provider (GETmetadata,POST {texts, model}), viaureq. Off by default; the stdio provider needs nothing extra.
License
MIT.