Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

Revert "feat: support dynamic project_name config in VectorDB / volcengine (…" (#167)

MaojiaShengead98177913e
diff --git a/docs/en/guides/01-configuration.md b/docs/en/guides/01-configuration.md
index a390b4fd0..6442210e5 100644
--- a/docs/en/guides/01-configuration.md
+++ b/docs/en/guides/01-configuration.md
@@ -30,6 +30,10 @@ Create `~/.openviking/ov.conf` in your project directory:
"agfs": {
"backend": "local",
"path": "./data"
+ },
+ "vectordb": {
+ "backend": "local",
+ "path": "./data"
}
}
}
@@ -387,8 +391,7 @@ For startup and deployment details see [Deployment](./03-deployment.md), for aut
"vectordb": {
"backend": "local|remote",
"path": "string",
- "url": "string",
- "project": "string"
+ "url": "string"
}
},
"server": {
diff --git a/docs/zh/guides/01-configuration.md b/docs/zh/guides/01-configuration.md
index 8bc4bfba9..7ee667626 100644
--- a/docs/zh/guides/01-configuration.md
+++ b/docs/zh/guides/01-configuration.md
@@ -394,8 +394,7 @@ HTTP 客户端(`SyncHTTPClient` / `AsyncHTTPClient`)和 CLI 工具连接远
"vectordb": {
"backend": "local|remote",
"path": "string",
- "url": "string",
- "project": "string"
+ "url": "string"
}
},
"server": {
diff --git a/examples/ov.conf.example b/examples/ov.conf.example
index bf5b1a072..fc97ecc26 100644
--- a/examples/ov.conf.example
+++ b/examples/ov.conf.example
@@ -10,7 +10,6 @@
"name": "context",
"backend": "local",
"path": "./data",
- "project": "default",
"volcengine": {
"region": "cn-beijing",
"ak": null,
@@ -24,15 +23,10 @@
"backend": "local",
"timeout": 10,
"retry_times": 3,
- "s3": {
- "bucket": null,
- "region": null,
- "access_key": null,
- "secret_key": null,
- "endpoint": null,
- "prefix": "",
- "use_ssl": true
- }
+ "s3_bucket": null,
+ "s3_region": null,
+ "s3_access_key": null,
+ "s3_secret_key": null
}
},
"embedding": {
diff --git a/openviking/core/directories.py b/openviking/core/directories.py
index fa9f95cfb..866a944d4 100644
--- a/openviking/core/directories.py
+++ b/openviking/core/directories.py
@@ -220,12 +220,10 @@ class DirectoryInitializer:
logger.debug(f"[VikingFS] Directory {uri} already exists")
# 2. Ensure record exists in vector storage
- from openviking_cli.utils.config import get_openviking_config
-
- config = get_openviking_config()
+ from openviking_cli.utils.config.vectordb_config import COLLECTION_NAME
existing = await self.vikingdb.filter(
- collection=config.storage.vectordb.name,
+ collection=COLLECTION_NAME,
filter={"op": "must", "field": "uri", "conds": [uri]},
limit=1,
)
diff --git a/openviking/storage/vectordb/collection/volcengine_collection.py b/openviking/storage/vectordb/collection/volcengine_collection.py
index dbdd55dca..19a8c5f1f 100644
--- a/openviking/storage/vectordb/collection/volcengine_collection.py
+++ b/openviking/storage/vectordb/collection/volcengine_collection.py
@@ -27,9 +27,6 @@ def get_or_create_volcengine_collection(config: Dict[str, Any], meta_data: Dict[
Args:
config: Configuration dictionary containing AK, SK, Region.
meta_data: Collection metadata.
-
- Returns:
- VolcengineCollection instance
"""
# Extract configuration
ak = config.get("AK")
@@ -66,9 +63,6 @@ def get_or_create_volcengine_collection(config: Dict[str, Any], meta_data: Dict[
logger.info(f"Collection {collection_name} created successfully")
return VolcengineCollection(ak, sk, region, host, meta_data)
- # Return VolcengineCollection instance
- return VolcengineCollection(ak=ak, sk=sk, region=region, host=host, meta_data=meta_data)
-
class VolcengineCollection(ICollection):
def __init__(
@@ -182,7 +176,9 @@ class VolcengineCollection(ICollection):
):
pass
else:
- raise Exception(f"Failed to create index: {response.status_code} {response.text}")
+ raise Exception(
+ f"Failed to create collection: {response.status_code} {response.text}"
+ )
def has_index(self, index_name: str):
indexes = self.list_indexes()
diff --git a/openviking/storage/vectordb/project/volcengine_project.py b/openviking/storage/vectordb/project/volcengine_project.py
index 25ccf8b22..d30fac08f 100644
--- a/openviking/storage/vectordb/project/volcengine_project.py
+++ b/openviking/storage/vectordb/project/volcengine_project.py
@@ -148,7 +148,6 @@ class VolcengineProject:
updated_meta = {
**meta_data,
"CollectionName": collection_name,
- "ProjectName": self.project_name,
}
logger.info(f"Creating Volcengine collection: {collection_name}")
diff --git a/openviking/storage/viking_vector_index_backend.py b/openviking/storage/viking_vector_index_backend.py
index 906279d75..4f1b7efd4 100644
--- a/openviking/storage/viking_vector_index_backend.py
+++ b/openviking/storage/viking_vector_index_backend.py
@@ -35,8 +35,8 @@ class VikingVectorIndexBackend(VikingDBInterface):
"""
# Default project and index names
+ DEFAULT_PROJECT_NAME = "vectordb"
DEFAULT_INDEX_NAME = "default"
- DEFAULT_LOCAL_PROJECT_NAME = "vectordb"
def __init__(
self,
@@ -104,7 +104,7 @@ class VikingVectorIndexBackend(VikingDBInterface):
)
self.project = get_or_create_volcengine_project(
- project_name=config.project_name, config=volc_config
+ project_name=self.DEFAULT_PROJECT_NAME, config=volc_config
)
logger.info(
f"VectorDB backend initialized in Volcengine mode: region={volc_config['Region']}"
@@ -124,7 +124,7 @@ class VikingVectorIndexBackend(VikingDBInterface):
)
self.project = get_or_create_vikingdb_project(
- project_name=config.project_name, config=viking_config
+ project_name=self.DEFAULT_PROJECT_NAME, config=viking_config
)
logger.info(f"VikingDB backend initialized in private mode: {config.vikingdb.host}")
elif config.backend == "http":
@@ -137,7 +137,7 @@ class VikingVectorIndexBackend(VikingDBInterface):
from openviking.storage.vectordb.project.http_project import get_or_create_http_project
self.project = get_or_create_http_project(
- host=self.host, port=self.port, project_name=config.project_name
+ host=self.host, port=self.port, project_name=self.DEFAULT_PROJECT_NAME
)
logger.info(f"VikingDB backend initialized in remote mode: {config.url}")
elif config.backend == "local":
@@ -147,9 +147,7 @@ class VikingVectorIndexBackend(VikingDBInterface):
get_or_create_local_project,
)
- project_path = (
- Path(config.path) / self.DEFAULT_LOCAL_PROJECT_NAME if config.path else ""
- )
+ project_path = Path(config.path) / self.DEFAULT_PROJECT_NAME if config.path else ""
self.project = get_or_create_local_project(path=str(project_path))
logger.info(f"VikingDB backend initialized with local storage: {project_path}")
else:
diff --git a/openviking_cli/utils/config/vectordb_config.py b/openviking_cli/utils/config/vectordb_config.py
index b4f0c0242..50ee4ee3a 100644
--- a/openviking_cli/utils/config/vectordb_config.py
+++ b/openviking_cli/utils/config/vectordb_config.py
@@ -4,8 +4,6 @@ from typing import Dict, Optional
from pydantic import BaseModel, Field, model_validator
-from openviking.storage.vectordb.utils.constants import DEFAULT_PROJECT_NAME
-
COLLECTION_NAME = "context"
@@ -51,10 +49,6 @@ class VectorDBBackendConfig(BaseModel):
description="Remote service URL for 'http' type (e.g., 'http://localhost:5000')",
)
- project_name: Optional[str] = Field(
- default=DEFAULT_PROJECT_NAME, description="project name", alias="project"
- )
-
distance_metric: str = Field(
default="cosine",
description="Distance metric for vector similarity search (e.g., 'cosine', 'l2', 'ip')",