This topic describes how to build a cultural tourism assistant using OceanBase multi-model integration.
Concept
Multi-model integration: Multi-model integration is an important aspect of OceanBase's unified product vision. In this topic, multi-model integration mainly refers to hybrid retrieval technology for multiple data types. OceanBase supports integrated queries across vector data, spatial data, document data, and scalar data. With support for various indexes—including vector, spatial, and full-text indexes—it delivers high-performance hybrid search capabilities.
Large language model (LLM): A large language model is a deep learning model trained on vast amounts of text data. It can generate natural language text or understand the meaning of language. Large language models are capable of handling a variety of natural language tasks, such as text classification, question answering, and conversation, making them an important pathway toward artificial intelligence.
Prerequisites
You have deployed OceanBase V4.3.3 or later and created a MySQL-compatible tenant. For more information about deploying OceanBase clusters, see Deployment overview.
The MySQL-compatible tenant has the privileges to insert and query data. For more information about setting privileges, see Directly grant privileges.
You have created a database. For more information about creating a database, see Create a database.
Vector search is enabled. For more information about vector search, see Perform vector search by using SQL statements.
obclient> ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30;(Recommended, not required) Install Python 3.10 and later and the corresponding pip. If your machine has a low Python version, you can use Miniconda to create a new Python 3.10 or later environment. For more information, see Miniconda installation guide.
conda create -n obmms python=3.10 && conda activate obmmsInstall Poetry. You can refer to the following command:
python3 -m ensurepip python3 -m pip install poetry
Step 1: Obtain the LLM API key
- Register for an account with Alibaba Cloud Model Studio, activate the model service, and obtain an API key.



Step 2: Obtain a geographic service API key
Register on the Amap (Gaode) Open Platform and obtain an API key for the Basic LBS service.
Step 3: Download the public dataset
Download the China City Attraction Details dataset from Kaggle.
Step 4: Build your cultural tourism assistant
Clone the project repository
Clone the latest project repository.
git clone https://github.com/oceanbase-devhub/ob-multi-model-search-demo.git cd ob-multi-model-search-demoMove the downloaded
archivedataset ZIP package to theob-multi-model-search-demoproject folder, rename it tocitydata, and decompress it.# Please modify the path to the actual location of archive.zip. mv ./archive.zip ./citydata.zip unzip ./citydata.zip
Install dependencies
Run the following command in the project root directory to install dependencies.
poetry install
Set environment variables
Set the environment variables in the .env file:
vim .env
You need to update the OB_-prefixed variables with your database connection information, and manually add the following variables: update DASHSCOPE_API_KEY with the API key obtained from the Alibaba Cloud Tongyi Lab console, and update AMAP_API_KEY with the API key obtained from the Alibaba Cloud AMap API service. Then, save the file.
# Host address in the database connection string
OB_URL="******"
OB_USER="******"
OB_DB_NAME="******"
# Password in the database connection string
OB_PWD="******"
# Optional SSL CA file path in the database connection string. If you do not need SSL encryption, remove this parameter.
OB_DB_SSL_CA_PATH="******"
# Manually add LLM API key
DASHSCOPE_API_KEY="******"
# Manually add AMap API key
AMAP_API_KEY="******"
Import data
In this step, we will import the data from the downloaded dataset into OceanBase.
Notice
For the first build, we recommend that you select only a portion of the data (such as attractions starting with the letter A) for import. Importing all data will take a long time.
python ./obmms/data/attraction_data_preprocessor.py
If the following progress is displayed, the data is being successfully imported.
...
./citydata/Changde.csv:
100%|███████████████████████████████████████████████████████████████████████████| 100/100 [00:04<00:00, 20.77it/s]
./citydata/Weinan.csv:
100%|█████████████████████████████████████████████████████████████████████████████| 90/90 [00:13<00:00, 6.54it/s]
...
Start the UI chat interface
Run the following command to start the chat interface:
poetry run streamlit run ./ui.py
If no web page is directly displayed, you can visit the URL shown in the terminal to open the tourism assistant application.
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://172.xxx.xxx.xxx:8501