OceanBase
English日本語简体中文
ドキュメントホーム
製品
エコシステム
リリース

データベース

OceanBase CloudOceanBaseデータベース

データベース

OceanBase CloudOceanBaseデータベース
OceanBase CloudOceanBaseデータベース

OceanBaseデータベース

  • エコシステム統合の概要
  • ORMフレームワーク
    • Java
      • SpringBootサンプルプログラム
      • SpringBatchサンプルプログラム
      • Spring JDBCサンプルプログラム
      • SpringDataJPAサンプルプログラム
      • Hibernateサンプルプログラム
      • MyBatisサンプルプログラム
    • Python
      • SQLAlchemyによるOceanBaseデータベース接続サンプルプログラム
      • peeweeによるOceanBaseデータベース接続サンプルプログラム
      • Tortoise ORM による OceanBase データベース接続サンプルプログラム
    • Go
      • GORMサンプルプログラム
    • Rust
      • SeaORM による OceanBase データベース接続サンプルプログラム
    • Ruby
      • ActiveRecordによるOceanBaseデータベース接続サンプルプログラム
      • Sequel で OceanBase データベースに接続するサンプルプログラム
      • Ruby on RailsによるOceanBaseデータベース接続サンプルプログラム
    • Node.js
      • SequelizeでOceanBaseデータベースに接続する
      • TypeORMを使用してOceanBaseデータベースに接続する
      • Prismaを使用してOceanBaseデータベースに接続する
      • Drizzle ORMを使用してOceanBaseデータベースに接続する
    • C#
      • Dapperを使用してOceanBaseデータベースに接続する
      • SqlSugarを使用してOceanBaseデータベースに接続する
      • FreeSQLを使用してOceanBaseデータベースに接続する
    • PHP
      • Yii 2.0 ORMサンプルプログラム
      • Laravel Eloquent ORMサンプルプログラム
  • データベースのバージョン管理
    • Liquibaseを使用したOceanBaseデータベースのバージョンの管理
    • Flywayを使用してOceanBaseデータベースを統合し、バージョン管理を実現する
  • データ統合
    • dbtを使用したOceanBaseデータの分析
    • Flink DirectLoadを使用したOceanBaseのダイレクトインポート
    • SeaTunnelを使用したOceanBaseデータの読み取りと同期
    • Maxwellを使用したOceanBaseデータの読み取り
    • Debeziumを使用してOceanBaseに接続し、データを取得する
    • Spark Catalogを使用してOceanBaseデータベースに接続する
    • Apache NiFiを使用してOceanBaseデータベースと統合する
  • SQL開発
    • WebLogicを使用してOceanBaseデータベースに接続する
    • DBeaverを使用してOceanBaseデータベースに接続する
    • Navicatを使用してOceanBaseデータベースに接続する
    • DataGripでOceanBaseデータベースに接続する
    • TablePlusでOceanBaseデータベースに接続する
    • DMSを使用したOceanBaseデータベースの管理
  • 編成とスケジューリング
    • AirflowとOceanBaseデータベースの連携
    • PowerJobとOceanBaseデータベースの連携
    • DolphinSchedulerにOceanBaseデータソースを設定する
    • LinkisとOceanBaseデータベースの統合
  • 可視化ツール
    • SupersetとOceanBaseを使用したデータ分析
    • Power BIでOceanBaseに接続してデータを取得する
    • Quick BIでOceanBaseに接続してデータを取得する
    • Bytebaseを使用したOceanBaseインスタンスの管理
  • データベース管理
    • NineDataを使用したOceanBaseデータソースの管理
    • Bytebaseを使用したOceanBaseインスタンスの管理
  • AI
    • OpenAI
    • Qwen
    • OceanBaseデータベースとLangChainの統合
    • OceanBaseデータベースのベクトル検索機能とLlamaIndexの連携
    • OceanBaseデータベースのベクトル検索機能とDifyの連携
    • OceanBaseデータベースとn8nの連携
    • OceanBase MCP ServerとTraeの連携
    • OceanBaseデータベースとSpring AI Alibabaの連携
    • OceanBase MCP ServerとClineの連携
    • OceanBase MCP ServerとCursorの連携
    • OceanBase MCP ServerとContinueの連携
    • Google GenAI Toolboxを使用して独自のOceanBase MCP Serverを構築する
    • OceanBaseデータベースとCamelAIの連携
    • OceanBase VectorとFirecrawlの連携
    • OceanBase VectorとHugging Faceの連携
    • OceanBase VectorとOllamaの連携
    • OceanBaseデータベースとGoogle Geminiの連携
    • OceanBase VectorとCloudflare Workers AIの連携
    • OceanBase VectorとJina AIの連携
    • OceanBase MCP ServerとAugment Codeの連携
    • OceanBase MCP ServerとClaude Codeの連携
    • OceanBase MCP ServerとKiroの連携

PDF をダウンロード

このページには現在中国語/日本語版がなく、英語版を表示しています。
ドキュメントフィードバック
  1. ドキュメントセンター
  2. OceanBaseデータベース
  3. master

Use OceanBase Vector Database in DB-GPT for knowledge base Q&A

最終更新:2026-09-04 07:40:45

Overview
Version compatibility
Prerequisites
Step 1: Obtain the database connection string
Step 2: Install DB-GPT
Step 3: Configure DB-GPT to use OceanBase Database
Configure TOML file
Step 4: Start DB-GPT
Step 5: Use the knowledge base for Q&A
Related documents/next steps

Overview

DB-GPT is an open-source AI database assistant that supports using OceanBase as a vector database for knowledge base question-answering.

This topic describes how DB-GPT uses OceanBase vector search to store and retrieve document vectors, and integrates LLMs such as Qwen to deliver accurate question-answering services.

Version compatibility

  • OceanBase Database: ≥ V4.3.3
  • DB-GPT: v0.7.x and later

Prerequisites

Before integrating DB-GPT with OceanBase Database, ensure that:

  • You have deployed OceanBase Database and created a MySQL user tenant.
  • You have set the ob_vector_memory_limit_percentage parameter to enable vector search. We recommend setting this parameter to 30 in ODP versions earlier than V4.3.5 BP3, and keeping the default value of 0 in ODP V4.3.5 BP3 and later.
  • Docker is deployed and running, and the current user has permission to execute Docker commands (verify with docker info).
  • You have obtained an API key for Qwen. To obtain it, go to the Qwen API Key page.
  • You have installed Git for the operating system you're using.

Step 1: Obtain the database connection string

You can use the following command to quickly deploy an independent OceanBase Database for testing:

docker run --name=ob433 -e MODE=slim -p 2881:2881 -e OB_TENANT_PASSWORD=****** -d quay.io/oceanbase/oceanbase-ce:latest

Wait for the container initialization to complete (about 2-3 minutes). You can check the status by running the following command. If the output is boot success!, the startup is successful.

docker logs ob433 | tail -1

The database connection string is as follows:

mysql -h 127.0.0.1 -uroot@test -P2881 -p********* -Dtest

Step 2: Install DB-GPT

This example uses source code deployment. For more deployment methods, see DB-GPT official website.

  1. Download the source code
git clone https://github.com/eosphoros-ai/DB-GPT.git
cd DB-GPT
  1. Install the uv package manager
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
# Verify the installation by running the following command, which should output something like: uv 0.10.2
uv --version
  1. Install the basic dependencies

For example, for Qwen, perform the following steps:

uv sync --all-packages \
  --extra "base" \
  --extra "proxy_tongyi" \
  --extra "rag" \
  --extra "storage_chromadb" \
  --extra "dbgpts"
  1. Install the OceanBase partner package
uv pip install pyobvector
  1. Connect to OceanBase and set memory usage ratio for vector data (optional)
source .venv/bin/activate
python3
from pyobvector import ObVecClient

client = ObVecClient(uri="127.0.0.1:2881", user="root@test",password="",db_name="test")
client.perform_raw_text_sql(
    "ALTER SYSTEM ob_vector_memory_limit_percentage = 30"
)

Step 3: Configure DB-GPT to use OceanBase Database

After the basic dependencies are downloaded, modify the TOML configuration file to switch to OceanBase Database.

Configure TOML file

In DB-GPT v0.7.x and later, we recommend using the TOML configuration file. Edit configs/dbgpt-proxy-tongyi.toml as follows:

[system]
# Load language from environment variable (It is set by the hook)
language = "${env:DBGPT_LANG:-en}"
api_keys = []
encrypt_key = "your_secret_key"

# Server Configurations
[service.web]
host = "0.0.0.0"
port = 5670

[service.web.database]
type = "sqlite"
path = "pilot/meta_data/dbgpt.db"

# Vector Store Configuration - Use OceanBase
[rag.storage]
[rag.storage.vector]
type = "OceanBase"
ob_host = "127.0.0.1"
ob_port = 2881
ob_user = "root@test"
ob_database = "test"
ob_password = ""
# ob_enable_normalize_vector = true

# Model Configurations
[models]

# Qwen LLM model
[[models.llms]]
name = "qwen-plus"
provider = "${env:LLM_MODEL_PROVIDER:-proxy/tongyi}"
api_base = "https://dashscope.aliyuncs.com/compatible-mode/v1"
api_key = "${env:DASHSCOPE_API_KEY}"

# Qwen Embedding model
[[models.embeddings]]
name = "text-embedding-v3"
provider = "${env:EMBEDDING_MODEL_PROVIDER:-proxy/tongyi}"
api_url = "https://dashscope.aliyuncs.com/compatible-mode/v1/embeddings"
api_key = "${env:DASHSCOPE_API_KEY}"

Parameter description:

  • $ob_host: The IP address of the OceanBase Database.
  • $ob_port: The port of the OceanBase Database.
  • $ob_user: The username of the OceanBase Database.
  • $ob_password: The password of the OceanBase Database user.
  • $ob_database: The name of the OceanBase database.

Step 4: Start DB-GPT

First, set the DashScope API Key environment variable, then start DB-GPT:

# Set the Qwen API Key
export DASHSCOPE_API_KEY="your-dashscope-api-key"

# Start DB-GPT
uv run dbgpt start webserver --config configs/dbgpt-proxy-tongyi.toml

Once started successfully, visit http://localhost:5670 to access the DB-GPT web interface.

Step 5: Use the knowledge base for Q&A

  1. Open your browser and go to http://localhost:5670.
  2. Go to the Knowledge page and click Create Knowledge to create a knowledge base.
  3. Fill in the Space Config and click Next.
  4. Select the Datasource type and click Next.
  5. Go to the Upload page, upload the file, and click Next.
  6. Go to the Segmentation page and select the document slicing method.
  7. The documents are sliced and vectorized and stored in the OceanBase vector database.
  8. In the Explore section, select the knowledge space to perform Q&A.

Related documents/next steps

  • DB-GPT official documentation
  • DB-GPT KBQA FAQ

次のトピック

エコシステム統合の概要
次へ
このページの内容
Overview
Version compatibility
Prerequisites
Step 1: Obtain the database connection string
Step 2: Install DB-GPT
Step 3: Configure DB-GPT to use OceanBase Database
Configure TOML file
Step 4: Start DB-GPT
Step 5: Use the knowledge base for Q&A
Related documents/next steps