Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

Add MOL data type design document - #30

Open
862103595 wants to merge 1 commit into
milvus-io:mainfrom
862103595:feat/mol-data-type-design
Open

Add MOL data type design document#30
862103595 wants to merge 1 commit into
milvus-io:mainfrom
862103595:feat/mol-data-type-design

Conversation

@862103595

Copy link
Copy Markdown

Summary

Design document for the new MOL (Molecule) data type in Milvus, enabling native cheminformatics support.

Key features covered:

  • MOL data type (DataType.Mol = 27): SMILES input / RDKit binary pickle storage (dual representation)
  • RDKit CGO integration: C-linkage bridge from Go → C → C++ RDKit library
  • MOL_CONTAINS expression: Substructure and superstructure query syntax
  • MOL_PATTERN index: Pattern fingerprint pre-filtering for accelerating substructure queries (lock-free growing segment support)
  • MolFingerprint function (FunctionType.MolFingerprint = 5): Auto-generate Morgan/MACCS/RDKit fingerprints as BinaryVector for similarity search
  • Bulk import: CSV/JSON/Parquet/NumPy support
  • Implementation plan: 6-PR dependency chain with detailed modification points

Related Work

This design has been implemented across the following PRs in milvus-io/milvus:

  • PR1: Go layer MOL basics (insert/query/test)
  • PR2: C++ layer MOL storage and query
  • PR3: RDKit Conan package + CGO bridge
  • PR4: Fingerprint functions + embedding pipeline
  • PR5: Bulk import support
  • PR6: MOL_CONTAINS expression + MOL_PATTERN index

Introduce design doc for the MOL (Molecule) data type in Milvus,
covering molecular storage (SMILES/pickle dual representation),
RDKit CGO integration, MOL_CONTAINS substructure/superstructure
expression, MOL_PATTERN index, MolFingerprint function, and bulk
import support.

Signed-off-by: xiejh <862103595@qq.com>
@sre-ci-robot
sre-ci-robot requested review from czs007 and xige-16 March 27, 2026 07:52
@sre-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 862103595
To complete the pull request process, please assign czs007 after the PR has been reviewed.
You can assign the PR to them by writing /assign @czs007 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @862103595! It looks like this is your first PR to milvus-io/milvus-design-docs 🎉

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a049ae7b72

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

**pymilvus usage:**

```python
from pymilvus import MilvusClient, DataType

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Import FunctionType in the runnable Python example

The example imports only MilvusClient and DataType, but later calls function_type=FunctionType.MolFingerprint; copy-pasting this snippet will raise NameError: name 'FunctionType' is not defined before collection creation. Adding FunctionType to the import is necessary for the documented setup flow to run as written.

Useful? React with 👍 / 👎.

Proxy: checkMOLFieldData()
- Validates each SMILES via ConvertSMILESToPickle()
- Replaces MolSmilesData with MolData (pickle bytes) in-place

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep insert-flow data source consistent for fingerprinting

The insert flow says checkMOLFieldData() replaces MolSmilesData with pickle MolData in place, but the later MolFingerprint section says insert fingerprint generation reads from MolSmilesData; these statements are mutually exclusive. If the flow is followed literally, ProcessInsert() loses its documented input when fingerprint functions are enabled, so the document should align on one source (or explicitly describe preservation/conversion steps).

Useful? React with 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants