Skip to main content

omop-emb

Vector embedding layer for OMOP CDM concepts.

omop-emb generates, stores, and retrieves embeddings for OMOP concepts. It works out of the box with sqlite-vec (no external database required), scales to PostgreSQL/pgvector for larger deployments, and supports DuckDB/VSS as a single-file alternative with HNSW indexing. The database is the source of truth; FAISS is an optional read-acceleration sidecar, not a primary store.

Installation

pip install omop-emb                         # sqlite-vec backend (default, no extras needed)
pip install "omop-emb[pgvector]"             # adds PostgreSQL/pgvector support
pip install "omop-emb[duckdbvss]"            # adds DuckDB/VSS support
pip install "omop-emb[faiss-cpu]"            # adds FAISS sidecar support
pip install "omop-emb[pgvector,faiss-cpu]"   # everything

DuckDB/VSS's first connection runs INSTALL vss, which needs network access once; it's cached locally for every connection after that.

Configuration

omop-emb is configured entirely through oa-configurator (~/.config/omop/config.toml); there are no OMOP_EMB_* environment variables. Set up a CDM database, an embedding model, and a vector store once:

omop-config init
omop-config connections add cdm --dialect postgresql+psycopg --host localhost --database-name omop_cdm
omop-config databases add cdm_db --kind cdm --connection cdm

omop-config providers add local-ollama --provider ollama --base-url http://localhost:11434
omop-config models add embedding-model --provider local-ollama --model nomic-embed-text:v1.5

omop-config databases add emb_db --kind generic --connection cdm
omop-config vector-stores add vector_store --backend-type pgvector --database emb_db

omop-config configure omop_emb   # points OmopEmbConfig at the entries above, prompts for anything unset

omop-config configure omop_emb writes [tools.omop_emb] with cdm_db, embedding_model_name, and vector_store_name (each defaulting to the entry names above, if you use the same names).

Quick start

omop-emb embeddings add-embeddings --model-name embedding-model
omop-emb embeddings search --model-name embedding-model \
    --query "hypertension" --query "type 2 diabetes" \
    --standard-only --domain Condition --k 5

--model-name defaults to the configured embedding_model_name, so it can be omitted once configured. See the CLI reference for the full command list.

pgvector with HNSW index:

omop-emb embeddings add-embeddings
omop-emb maintenance rebuild-index --model-name embedding-model --index-type hnsw --metric-type cosine

Documentation

Full documentation: https://AustralianCancerDataNetwork.github.io/omop-emb

Roadmap

  • sqlite-vec backend (default, zero-config)
  • pgvector backend (PostgreSQL)
  • DuckDB/VSS backend
  • HNSW index support for pgvector and DuckDB/VSS
  • FAISS sidecar (approximate nearest-neighbour read acceleration)
  • Embedding bundle export / import CLI (maintenance export, maintenance import, maintenance build-faiss-cache)
  • In-DB concept filtering (domain, vocabulary, standard status, active status)
  • Transparent FAISS fast path in EmbeddingReaderInterface
  • Extensive backend and registry testing
  • FAISS GPU support
  • pgvectorscale support
  • Vector quantisation for more efficient storage

Metadata

Release files for omop-emb 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omop-emb 3.2.0
File Size Uploaded Provenance Actions
omop_emb-3.2.0.tar.gz 340.3 kB With provenance Details for omop_emb-3.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for omop-emb 3.2.0
File Interpreter ABI Platform Actions
omop_emb-3.2.0-py3-none-any.whl Python 3 none any Details for omop_emb-3.2.0-py3-none-any.whl

Total release size: 465.8 kB

Release files / omop_emb-3.2.0.tar.gz

Download URL omop_emb-3.2.0.tar.gz
Size 340.3 kB
Tags Source
SHA-256 checksum
How to use checksums
54dbbeb96c2b4333038f4a08f0970108de80f7785033d020c75644aeed49720e
BLAKE2b-256 checksum
How to use checksums
4da80bf6f21ea6526f1f6e7f6b6a3a5fa3654ada0401d115f23f44b9f4e0e151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / omop_emb-3.2.0-py3-none-any.whl

Download URL omop_emb-3.2.0-py3-none-any.whl
Size 125.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18e176ac43c0b2fd6daa831fc6a3c819ad4318877aa7acc3b0d4bf3205ea3b1f
BLAKE2b-256 checksum
How to use checksums
fb6b5d00d7793806b51bab1a5a8a8ece78299079e2ba4320a144abbb5f20ab89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for omop-emb 3.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for omop_emb-3.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page