Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

feat: add seekdb which is lite version of oceanbase (#12692)

longbingljwc4a982e9fa00
diff --git a/.gitignore b/.gitignore
index 310629bfa7..bc2bb8abe3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,6 +56,9 @@ docker/data
docker/oceanbase/conf
docker/oceanbase/data
+# SeekDB data and conf
+docker/seekdb
+
#--------------------------------------------------#
# The following was generated with gitignore.nvim: #
diff --git a/common/settings.py b/common/settings.py
index 7b19357ad4..efdd1fe369 100644
--- a/common/settings.py
+++ b/common/settings.py
@@ -257,6 +257,9 @@ def init_settings():
elif lower_case_doc_engine == "oceanbase":
OB = get_base_config("oceanbase", {})
docStoreConn = rag.utils.ob_conn.OBConnection()
+ elif lower_case_doc_engine == "seekdb":
+ OB = get_base_config("seekdb", {})
+ docStoreConn = rag.utils.ob_conn.OBConnection()
else:
raise Exception(f"Not supported doc engine: {DOC_ENGINE}")
diff --git a/docker/.env b/docker/.env
index 2d31177d75..c939cc8d55 100644
--- a/docker/.env
+++ b/docker/.env
@@ -16,6 +16,7 @@
# - `infinity` (https://github.com/infiniflow/infinity)
# - `oceanbase` (https://github.com/oceanbase/oceanbase)
# - `opensearch` (https://github.com/opensearch-project/OpenSearch)
+# - `seekdb` (https://github.com/oceanbase/seekdb)
DOC_ENGINE=${DOC_ENGINE:-elasticsearch}
# Device on which deepdoc inference run.
@@ -92,6 +93,19 @@ OB_SYSTEM_MEMORY=${OB_SYSTEM_MEMORY:-2G}
OB_DATAFILE_SIZE=${OB_DATAFILE_SIZE:-20G}
OB_LOG_DISK_SIZE=${OB_LOG_DISK_SIZE:-20G}
+# The hostname where the SeekDB service is exposed
+SEEKDB_HOST=seekdb
+# The port used to expose the SeekDB service
+SEEKDB_PORT=2881
+# The username for SeekDB
+SEEKDB_USER=root
+# The password for SeekDB
+SEEKDB_PASSWORD=infini_rag_flow
+# The doc database of the SeekDB service to use
+SEEKDB_DOC_DBNAME=ragflow_doc
+# SeekDB memory limit
+SEEKDB_MEMORY_LIMIT=2G
+
# The password for MySQL.
# WARNING: Change this for production!
MYSQL_PASSWORD=infini_rag_flow
diff --git a/docker/docker-compose-base.yml b/docker/docker-compose-base.yml
index 11104aef53..0d265d8bf8 100644
--- a/docker/docker-compose-base.yml
+++ b/docker/docker-compose-base.yml
@@ -121,6 +121,30 @@ services:
- ragflow
restart: unless-stopped
+ seekdb:
+ profiles:
+ - seekdb
+ image: oceanbase/seekdb:latest
+ container_name: seekdb
+ volumes:
+ - ./seekdb:/var/lib/oceanbase
+ ports:
+ - ${SEEKDB_PORT:-2881}:2881
+ env_file: .env
+ environment:
+ - ROOT_PASSWORD=${SEEKDB_PASSWORD:-infini_rag_flow}
+ - MEMORY_LIMIT=${SEEKDB_MEMORY_LIMIT:-2G}
+ - REPORTER=ragflow-seekdb
+ mem_limit: ${MEM_LIMIT}
+ healthcheck:
+ test: ['CMD-SHELL', 'mysql -h127.0.0.1 -P2881 -uroot -p${SEEKDB_PASSWORD:-infini_rag_flow} -e "CREATE DATABASE IF NOT EXISTS ${SEEKDB_DOC_DBNAME:-ragflow_doc};"']
+ interval: 5s
+ retries: 60
+ timeout: 5s
+ networks:
+ - ragflow
+ restart: unless-stopped
+
sandbox-executor-manager:
profiles:
- sandbox
@@ -283,6 +307,8 @@ volumes:
driver: local
ob_data:
driver: local
+ seekdb_data:
+ driver: local
mysql_data:
driver: local
minio_data:
diff --git a/docker/service_conf.yaml.template b/docker/service_conf.yaml.template
index 1500c2eaf4..6e08e962ab 100644
--- a/docker/service_conf.yaml.template
+++ b/docker/service_conf.yaml.template
@@ -38,6 +38,14 @@ oceanbase:
password: '${OCEANBASE_PASSWORD:-infini_rag_flow}'
host: '${OCEANBASE_HOST:-oceanbase}'
port: ${OCEANBASE_PORT:-2881}
+seekdb:
+ scheme: 'oceanbase' # SeekDB is the lite version of OceanBase
+ config:
+ db_name: '${SEEKDB_DOC_DBNAME:-ragflow_doc}'
+ user: '${SEEKDB_USER:-root}'
+ password: '${SEEKDB_PASSWORD:-infini_rag_flow}'
+ host: '${SEEKDB_HOST:-seekdb}'
+ port: ${SEEKDB_PORT:-2881}
redis:
db: 1
username: '${REDIS_USERNAME:-}'