1.0.8 • Published 6 months ago
adis-cli v1.0.8
Adis CLI
Adis CLI provides an intuitive way to interact with Qdrant and Milvus databases.
It also exposes the functions, validation schemas and types used behind the CLI commands, so you can use it as an npm package in your projects directly.
Installation
npm i -g adis-cli # npm
pnpm add -g adis-cli # pnpm
yarn global add adis-cli # yarn
Usage
To view all top-level Adis CLI commands, enter adis
without arguments.
adis
To view subcommands available under a specific top-level command, use the command without arguments.
adis COMMAND
- COMMAND =
<health|seed|query>
.
For example, to view all subcommands available under the seed
command:
adis seed
To access detailed help for a specific command or subcommand, use the --help
flag:
adis COMMAND [SUBCOMMAND ...] --help
- SUBCOMMAND =
<qdrant|milvus>
.
For example, to view help for the query command for Qdrant:
adis query qdrant --help
Qdrant
- Does not natively support databases. All collections exist within the same Qdrant instance.
- To mimic database behavior, you can use the
--db-name
flag to simulate multiple databases.
Seed Example Usage
adis seed qdrant \
--db-url http://127.0.0.1:6333 \
--db-name my_database \
--collection-name my_collection \
--num-vectors 100 \
--vector-dim 128 \
--metric-type Cosine \
--vector-config '{"size":128,"distance":"Cosine"}' \
--payload-template '{"type":"user", "age":30}'
Simple Query Example Usage
adis query qdrant -dn my_database -cl my_collection -vec vec.json
Milvus:
- Supports the concept of databases. Each database can contain multiple collections.
- You can specify a database name using the
--db-name
flag.
Seed Example Usage
adis seed milvus \
--db-url http://localhost:19530 \
--db-name my_database \
--collection-name my_collection \
--num-vectors 100 \
--vector-dim 128 \
--index-type IVF_FLAT \
--metric-type COSINE \
--custom-fields '[{"name":"age","data_type":"Int64"}]' \
--payload-template '{"type":"user", "age":30}' \
--schema-description "Schema for my collection"
Simple Query Example Usage
adis query milvus -dn my_database -cl my_collection -vec vec.json --metric-type COSINE
Milvus vs. Qdrant CLI Comparison
Aspect | Milvus | Qdrant |
---|---|---|
Database Type Argument (dbType ) | Required as an argument for CLI commands (milvus or qdrant ) | Required as an argument for CLI commands (milvus or qdrant ) |
Database Name (dbName ) | Required, allows using multiple databases. Passed explicitly during seeding and queries. | Optional. Simulated by concatenating it with the collection name (e.g., db_collection ). |
Database URL (dbUrl ) | Required. Defaults to http://localhost:19530 but can be overridden in CLI commands. | Required. Defaults to http://127.0.0.1:6333 but can be overridden in CLI commands. |
Collection Name (collectionName ) | Required. Used directly without concatenation. | Required. Combined with dbName to simulate multi-database behavior. |
Metric Type (metricType ) | Optional for queries. Can be specified ad hoc (L2 , COSINE , etc.) in search operations. | Required during collection creation. Fixed for all queries against the collection. |
Vector Dimension (vectorDim ) | Required during seeding. Specifies the dimensionality of the vector field. | Required during seeding. Specifies the dimensionality of the vector field. |
Number of Vectors (numVectors ) | Required during seeding. Specifies how many vectors are seeded. | Required during seeding. Specifies how many vectors are seeded. |
Custom Fields (customFields ) | Optional during seeding. JSON defining additional fields for the collection schema. | Not applicable. Payload fields are added directly in the payloadTemplate . |
Payload Template (payloadTemplate ) | Optional during seeding. Defines default values for payload fields. | Optional during seeding. Defines default values for payload fields. |
Index Type (indexType ) | Required during seeding. Defaults to HNSW . Determines the indexing strategy. | Not applicable. Indexing is handled implicitly based on the metric type. |
Query Vector (vector ) | Required during queries. JSON array of numbers to perform similarity search. | Required during queries. JSON array of numbers to perform similarity search. |
Query Limit (limit ) | Optional during queries. Defaults to 5 . Specifies the number of search results. | Optional during queries. Defaults to 5 . Specifies the number of search results. |
Collection Creation Behavior | Dynamically checks and recreates collections if needed. | Dynamically checks and recreates collections if needed. |
Seeding Behavior | Requires collection schema, including vector field and additional fields (customFields ). | Requires collection schema, including vector configuration and payload template. |
Query Flexibility | Metric type can be specified per query. | Metric type is fixed per collection, based on seeding configuration. |
Default Metric Type | Defaults to COSINE but can be overridden for each query. | Defaults to Cosine during seeding and cannot be changed for queries. |
Indexing | Explicitly specified during seeding (IVF_FLAT , HNSW , etc.). | Implicitly determined based on the metric type specified during seeding. |
Collection Loading | Explicitly loaded into memory before queries. | No explicit loading required; queries are performed directly on existing collections. |
Seeding Multi-Databases | Supports true multi-database behavior (dbName directly passed to Milvus). | Simulated by concatenating dbName and collectionName . |
Query Multi-Databases | Supports true multi-database behavior with explicit dbName argument. | Simulated by concatenating dbName and collectionName . |
CLI Subcommand | adis seed milvus and adis query milvus | adis seed qdrant and adis query qdrant |
Performance Focus | Flexibility: Query metric type and indexing strategy can be changed. | Consistency: Metric type and indexing strategy fixed for each collection. |