Preparation¶
Let's start with the preparation for the hands-on.
First, please check how to open the terminal/command prompt.
How to Open Terminal/Command Prompt
In the following steps, use either IBM Bob's built-in terminal or your system terminal/command prompt.
Open Terminal/Command Prompt in IBM Bob:
You can open it using one of the following methods:
- From the menu bar: Terminal → New Terminal
- Ctrl + ` (backtick)
- Click the icon in the upper right (toggle panel)
A black screen (terminal/command prompt) will appear at the bottom of the screen.
Open System Terminal/Command Prompt:
- Open Spotlight with Cmd + Space
- Type "Terminal"
- Press Enter
Or:
- Applications → Utilities → Terminal
- Press Win + R
- Type "cmd"
- Press Enter
Or:
- Start menu → Search for "Command Prompt"
Requirements¶
1. Vector Search Builder Mode¶
Vector Search Builder is a custom mode for IBM Bob that was provided as part of Building Blocks, making it easy to build vector search functionality.
About the distribution of this mode
Building Blocks last distributed this mode on 30 April 2026 (ibm-self-serve-assets/building-blocks, b64ca4c). This hands-on ships that version, updated for the MilvusClient API and the hands-on workspace, and maintains it here.
Vector Search Builder Overview¶
Provider: IBM Build Engineering Team
Included features:
- Milvus database setup and management
- Local embedding model integration with Hugging Face Transformers
- Data ingestion pipeline construction
- Vector search optimization
- Sample product data ingestion workflow
Integration with IBM Bob:
- AI assistant specialized for Vector Search
- Code generation with understanding of Building Blocks features
- Implementation support based on best practices
Benefits of Building Blocks
Instead of reading the Milvus documentation, learning the SDK, and writing code from scratch (days), you install Vector Search Builder and instruct IBM Bob in natural language (minutes).
Step 1: Install Vector Search Builder¶
-
Copy the distributed
vector-search-builder-en.zipto your desktop -
Extract the zip file
GUI: Double-click
Terminal/Command Prompt:
-
Confirm that a
vector-search-builder-enfolder is created with a.bobfolder inside
Important
The .bob folder must be placed directly under the project folder (in this hands-on, vector-search-builder-en).
Contents of vector-search-builder-en.zip
.bob/: Vector Search Builder mode definition (Building Blocks)setup/participant/: Participant scripts, the FastAPI demo app with its search screen, and English sample product data (PARTICIPANT_LANGUAGE=en)setup/participant/.env.example: Connection information configuration template
Building Blocks Installation Methods
Normally, Building Blocks are installed using the following methods:
- Global installation:
~/.config/IBM Bob/User/globalStorage/ibm.bob-code/ - Project local:
.bob/(this hands-on's method)
In this hands-on, installing locally to the project keeps the environment clean and allows easy cleanup.
Step 2: Open the vector-search-builder-en Folder in IBM Bob¶
IBM Bob Version Used
This hands-on was verified with IBM Bob 2.2.1 (October 2026). Other versions may show different modes, approval prompts, or proposals.
-
Launch IBM Bob
-
Open the
vector-search-builder-enfolderGUI: File → Open... and select the
vector-search-builder-enfolder, or press ⌘ + O to open the folder selection dialog.GUI: File → Open... and select the
vector-search-builder-enfolder, or press Ctrl + O to open the folder selection dialog. -
In the IBM Bob panel, open the mode selector below the chat input and select Vector Search Builder
Vector Search Builder Mode
Selecting Vector Search Builder mode activates the Building Blocks custom mode, so IBM Bob follows its rules for Milvus operations, vector search best practices, and embedding model integration.
2. Connection Information¶
Milvus (Vector Database)¶
Configure the IP address distributed by the instructor.
Practice: Configure connection information
Create the configuration file for connecting to Milvus, then enter the IP address distributed by the instructor.
-
Open the
setup/participantfolder -
Copy
.env.exampleand rename the copied file to.env -
Open the
.envfile and enter the connection information distributed by the instructor# Milvus connection information MILVUS_HOST=192.168.1.100 # ← Change to IP address distributed by instructor MILVUS_PASSWORD=AbCd123XyZ # ← Change to password distributed by instructor # Collection name (Milvus is shared by all participants) COLLECTION_NAME=products_taro # ← Change to a name unique to you # No changes needed below MILVUS_PORT=19530 MILVUS_USER=root EMBEDDING_MODEL=paraphrase-multilingual-MiniLM-L12-v2 PARTICIPANT_LANGUAGE=en# Milvus connection information MILVUS_HOST=0.tcp.jp.ngrok.io # ← Change to hostname distributed by instructor MILVUS_PORT=24051 # ← Change to port number distributed by instructor MILVUS_PASSWORD=AbCd123XyZ # ← Change to password distributed by instructor # Collection name (Milvus is shared by all participants) COLLECTION_NAME=products_taro # ← Change to a name unique to you # No changes needed below MILVUS_USER=root EMBEDDING_MODEL=paraphrase-multilingual-MiniLM-L12-v2 PARTICIPANT_LANGUAGE=enSet a unique collection name
All participants connect to the same Milvus server managed by the instructor. Set
COLLECTION_NAMEto a name that is unique to you (e.g.products_taro, using letters, numbers, and underscores). If two participants use the same name, inserting sample data will overwrite each other's collection.ngrok Connection Note
When using ngrok, a corporate VPN or DNS security product such as Cisco Umbrella may block access to the ngrok TCP tunnel or prevent the hostname from resolving correctly. Even after disconnecting the VPN, the connection may still fail if Cisco Umbrella or a similar security product remains active. If you cannot connect, follow your organization's rules and use an alternative method provided by the instructor, such as connecting from the same network.
-
Save the file
Cmd + S
Ctrl + S
Embedding Model (AI that Converts Text to Numbers)¶
Uses Hugging Face Transformers (no API key required, free).
What is an embedding model: An AI model that converts the "meaning" of text into numbers (vectors).
- Model:
paraphrase-multilingual-MiniLM-L12-v2 - Dimensions: 384 (represents meaning with 384 numbers)
- Features: Multilingual support
3. Python Environment Setup¶
Step 1: Verify Python Installation¶
First, verify that Python is installed.
Expected output:
If Python 3.10 or higher is not installed, install it before continuing.
Download and install the installer from the official site.
Official site: https://www.python.org/downloads/
If you use Homebrew, you can also install with:
Download and run the installer from the official site.
Official site: https://www.python.org/downloads/
Installation Note
On the first installer screen, check Add python.exe to PATH before clicking Install Now. Without this option, python and pip may not run from Command Prompt.
Step 2: Create Virtual Environment (Important)¶
To Avoid Breaking the Global Environment
Always use a virtual environment. Installing directly in the global environment may affect other projects.
Create a virtual environment and install packages within it.
About Prompt Display
When the virtual environment is activated, (venv) may appear at the beginning of the prompt depending on your environment. It may not appear depending on your terminal or shell settings.
Benefits of Virtual Environment
The packages stay in this project's venv folder, so other projects are not affected and deleting the folder removes them.
Step 3: Install Required Packages¶
Directly specify the Python executable inside venv to install Python packages.
-
Verify that the
venvfolder has been created -
Run the following in the terminal:
-
Wait for installation to complete (may take several minutes)
Linux users: install the CPU-only torch first
On Linux, the default torch wheel bundles CUDA libraries (several GB). Run the following before pip install -r requirements.txt for a much smaller, faster install. It installs the CPU-only build of the torch version pinned in requirements.txt:
Why directly specify Python inside venv
Even if you activated the virtual environment in your terminal, another terminal or AI tool may not inherit that state. Specifying venv/bin/python or venv\Scripts\python directly ensures the packages are installed into venv.
Packages to be Installed
The main packages are pymilvus (Milvus client), sentence-transformers and torch (embeddings), fastapi and uvicorn (web app), and python-dotenv (.env loading). Dependencies such as transformers, huggingface-hub, pydantic, and scikit-learn are installed automatically.
Deactivating Virtual Environment
When you finish, run the following. To work again later, activate it in setup/participant with source venv/bin/activate (Mac) or venv\Scripts\activate (Windows).
Preparation Completion Checklist¶
- IBM Bob is installed and available
- Python 3.10 or higher is installed
- Extracted
vector-search-builder-en.zip -
.bobfolder exists - Opened
vector-search-builder-enfolder in IBM Bob - "Vector Search Builder" mode is displayed
- Entered connection information in
setup/participant/.envfile - Created and activated virtual environment (the
venvfolder is created) - Installed Python packages in virtual environment
FAQ¶
Vector Search Builder mode is not displayed
- Verify
.bobfolder exists - Reload IBM Bob ( ⌘ + Shift + P / Ctrl + Shift + P → "Reload Window")
- Reopen the project folder
Don't know where to enter connection information
- Open the
setup/participantfolder in the project folder - Look for the
.envfile (if not found, copy.env.example)