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) and scales to PostgreSQL/pgvector for larger deployments. 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[faiss-cpu]" # adds FAISS sidecar support
pip install "omop-emb[pgvector,faiss-cpu]" # everything
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
- Installation & backend setup
- Configuration reference
- Backend selection & index types
- CLI reference
- Interface guide
Roadmap
- sqlite-vec backend (default, zero-config)
- pgvector backend (PostgreSQL)
- HNSW index support for pgvector
- 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
-
pgvectorscalesupport - Vector quantisation for more efficient storage
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omop_emb-2.0.0.tar.gz.
File metadata
- Download URL: omop_emb-2.0.0.tar.gz
- Upload date:
- Size: 228.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d37902279de396ac53fc177756dd271e06b5c4e5c0a9016678eb53e64703372
|
|
| MD5 |
bca18c2fd7784b87377fd78bcaa12c53
|
|
| BLAKE2b-256 |
5b4dea6d56dc541327c0d722d9a07f5d50a31f6ce05916eb0e969145bde428b1
|
Provenance
The following attestation bundles were made for omop_emb-2.0.0.tar.gz:
Publisher:
publish.yml on AustralianCancerDataNetwork/omop-emb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omop_emb-2.0.0.tar.gz -
Subject digest:
0d37902279de396ac53fc177756dd271e06b5c4e5c0a9016678eb53e64703372 - Sigstore transparency entry: 2436822699
- Sigstore integration time:
-
Permalink:
AustralianCancerDataNetwork/omop-emb@b0c6ebc4660e23e21640c36a9841f03af0393c16 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/AustralianCancerDataNetwork
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b0c6ebc4660e23e21640c36a9841f03af0393c16 -
Trigger Event:
push
-
Statement type:
File details
Details for the file omop_emb-2.0.0-py3-none-any.whl.
File metadata
- Download URL: omop_emb-2.0.0-py3-none-any.whl
- Upload date:
- Size: 89.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4302ab0c6e69d388c43dcf8e714359ca3e0a1fc3f86c01aef9e77a778f1ba2c6
|
|
| MD5 |
d1cb4d87adc1a8d15f8faaa7ad55d03b
|
|
| BLAKE2b-256 |
cc7aff447676f39352295672b269dfc0ce24d94cf0aaec0cd8efcbe801bb30fe
|
Provenance
The following attestation bundles were made for omop_emb-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on AustralianCancerDataNetwork/omop-emb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omop_emb-2.0.0-py3-none-any.whl -
Subject digest:
4302ab0c6e69d388c43dcf8e714359ca3e0a1fc3f86c01aef9e77a778f1ba2c6 - Sigstore transparency entry: 2436822972
- Sigstore integration time:
-
Permalink:
AustralianCancerDataNetwork/omop-emb@b0c6ebc4660e23e21640c36a9841f03af0393c16 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/AustralianCancerDataNetwork
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b0c6ebc4660e23e21640c36a9841f03af0393c16 -
Trigger Event:
push
-
Statement type: