Skip to content

Commit c8ef922

Browse files
roadgoat19crazywoolaejscribnerbowenliang123
authored
feat: couchbase integration (langgenius#6165)
Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: Elliot Scribner <elliot.scribner@couchbase.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: Bowen Liang <bowenliang@apache.org>
1 parent fc37e65 commit c8ef922

File tree

21 files changed

+639
-7
lines changed

21 files changed

+639
-7
lines changed

.github/workflows/api-tests.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@ jobs:
7878
- name: Run Workflow
7979
run: poetry run -C api bash dev/pytest/pytest_workflow.sh
8080

81-
- name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch)
81+
- name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch, Couchbase)
8282
uses: hoverkraft-tech/compose-action@v2.0.0
8383
with:
8484
compose-file: |
8585
docker/docker-compose.yaml
8686
services: |
8787
weaviate
8888
qdrant
89+
couchbase-server
8990
etcd
9091
minio
9192
milvus-standalone

.github/workflows/expose_service_ports.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ yq eval '.services["milvus-standalone"].ports += ["19530:19530"]' -i docker/dock
77
yq eval '.services.pgvector.ports += ["5433:5432"]' -i docker/docker-compose.yaml
88
yq eval '.services["pgvecto-rs"].ports += ["5431:5432"]' -i docker/docker-compose.yaml
99
yq eval '.services["elasticsearch"].ports += ["9200:9200"]' -i docker/docker-compose.yaml
10+
yq eval '.services.couchbase-server.ports += ["8091-8096:8091-8096"]' -i docker/docker-compose.yaml
11+
yq eval '.services.couchbase-server.ports += ["11210:11210"]' -i docker/docker-compose.yaml
1012

11-
echo "Ports exposed for sandbox, weaviate, qdrant, chroma, milvus, pgvector, pgvecto-rs, elasticsearch"
13+
echo "Ports exposed for sandbox, weaviate, qdrant, chroma, milvus, pgvector, pgvecto-rs, elasticsearch, couchbase"

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ docker/volumes/myscale/log/*
173173
docker/volumes/unstructured/*
174174
docker/volumes/pgvector/data/*
175175
docker/volumes/pgvecto_rs/data/*
176+
docker/volumes/couchbase/*
176177

177178
docker/nginx/conf.d/default.conf
178179
docker/nginx/ssl/*
@@ -189,4 +190,4 @@ pyrightconfig.json
189190
api/.vscode
190191

191192
.idea/
192-
.vscode
193+
.vscode

api/.env.example

+8-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ SUPABASE_URL=your-server-url
120120
WEB_API_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,*
121121
CONSOLE_CORS_ALLOW_ORIGINS=http://127.0.0.1:3000,*
122122

123-
# Vector database configuration, support: weaviate, qdrant, milvus, myscale, relyt, pgvecto_rs, pgvector, pgvector, chroma, opensearch, tidb_vector, vikingdb, upstash
123+
# Vector database configuration, support: weaviate, qdrant, milvus, myscale, relyt, pgvecto_rs, pgvector, pgvector, chroma, opensearch, tidb_vector, couchbase, vikingdb, upstash
124124
VECTOR_STORE=weaviate
125125

126126
# Weaviate configuration
@@ -136,6 +136,13 @@ QDRANT_CLIENT_TIMEOUT=20
136136
QDRANT_GRPC_ENABLED=false
137137
QDRANT_GRPC_PORT=6334
138138

139+
#Couchbase configuration
140+
COUCHBASE_CONNECTION_STRING=127.0.0.1
141+
COUCHBASE_USER=Administrator
142+
COUCHBASE_PASSWORD=password
143+
COUCHBASE_BUCKET_NAME=Embeddings
144+
COUCHBASE_SCOPE_NAME=_default
145+
139146
# Milvus configuration
140147
MILVUS_URI=http://127.0.0.1:19530
141148
MILVUS_TOKEN=

api/commands.py

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def migrate_knowledge_vector_database():
278278
VectorType.BAIDU,
279279
VectorType.VIKINGDB,
280280
VectorType.UPSTASH,
281+
VectorType.COUCHBASE,
281282
}
282283
page = 1
283284
while True:

api/configs/middleware/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from configs.middleware.storage.volcengine_tos_storage_config import VolcengineTOSStorageConfig
1818
from configs.middleware.vdb.analyticdb_config import AnalyticdbConfig
1919
from configs.middleware.vdb.chroma_config import ChromaConfig
20+
from configs.middleware.vdb.couchbase_config import CouchbaseConfig
2021
from configs.middleware.vdb.elasticsearch_config import ElasticsearchConfig
2122
from configs.middleware.vdb.milvus_config import MilvusConfig
2223
from configs.middleware.vdb.myscale_config import MyScaleConfig
@@ -251,6 +252,7 @@ class MiddlewareConfig(
251252
TiDBVectorConfig,
252253
WeaviateConfig,
253254
ElasticsearchConfig,
255+
CouchbaseConfig,
254256
InternalTestConfig,
255257
VikingDBConfig,
256258
UpstashConfig,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
from typing import Optional
2+
3+
from pydantic import BaseModel, Field
4+
5+
6+
class CouchbaseConfig(BaseModel):
7+
"""
8+
Couchbase configs
9+
"""
10+
11+
COUCHBASE_CONNECTION_STRING: Optional[str] = Field(
12+
description="COUCHBASE connection string",
13+
default=None,
14+
)
15+
16+
COUCHBASE_USER: Optional[str] = Field(
17+
description="COUCHBASE user",
18+
default=None,
19+
)
20+
21+
COUCHBASE_PASSWORD: Optional[str] = Field(
22+
description="COUCHBASE password",
23+
default=None,
24+
)
25+
26+
COUCHBASE_BUCKET_NAME: Optional[str] = Field(
27+
description="COUCHBASE bucket name",
28+
default=None,
29+
)
30+
31+
COUCHBASE_SCOPE_NAME: Optional[str] = Field(
32+
description="COUCHBASE scope name",
33+
default=None,
34+
)

api/controllers/console/datasets/datasets.py

+2
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ def get(self):
640640
| VectorType.ELASTICSEARCH
641641
| VectorType.PGVECTOR
642642
| VectorType.TIDB_ON_QDRANT
643+
| VectorType.COUCHBASE
643644
):
644645
return {
645646
"retrieval_method": [
@@ -678,6 +679,7 @@ def get(self, vector_type):
678679
| VectorType.MYSCALE
679680
| VectorType.ORACLE
680681
| VectorType.ELASTICSEARCH
682+
| VectorType.COUCHBASE
681683
| VectorType.PGVECTOR
682684
):
683685
return {

api/core/rag/datasource/vdb/couchbase/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)