Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/en/guides/01-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Create `~/.openviking/ov.conf` in your project directory:
"agfs": {
"backend": "local",
"path": "./data"
},
"vectordb": {
"backend": "local",
"path": "./data"
}
}
}
Expand Down Expand Up @@ -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": {
Expand Down
3 changes: 1 addition & 2 deletions docs/zh/guides/01-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,7 @@ HTTP 客户端(`SyncHTTPClient` / `AsyncHTTPClient`)和 CLI 工具连接远
"vectordb": {
"backend": "local|remote",
"path": "string",
"url": "string",
"project": "string"
"url": "string"
}
},
"server": {
Expand Down
14 changes: 4 additions & 10 deletions examples/ov.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"name": "context",
"backend": "local",
"path": "./data",
"project": "default",
"volcengine": {
"region": "cn-beijing",
"ak": null,
Expand All @@ -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": {
Expand Down
6 changes: 2 additions & 4 deletions openviking/core/directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,10 @@ async def _ensure_directory(
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,
)
Expand Down
10 changes: 3 additions & 7 deletions openviking/storage/vectordb/collection/volcengine_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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__(
Expand Down Expand Up @@ -182,7 +176,9 @@ def create_index(self, index_name: str, meta_data: Dict[str, Any]):
):
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()
Expand Down
1 change: 0 additions & 1 deletion openviking/storage/vectordb/project/volcengine_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ def create_collection(self, collection_name: str, meta_data: Dict[str, Any]) ->
updated_meta = {
**meta_data,
"CollectionName": collection_name,
"ProjectName": self.project_name,
}

logger.info(f"Creating Volcengine collection: {collection_name}")
Expand Down
12 changes: 5 additions & 7 deletions openviking/storage/viking_vector_index_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -104,7 +104,7 @@ def __init__(
)

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']}"
Expand All @@ -124,7 +124,7 @@ def __init__(
)

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":
Expand All @@ -137,7 +137,7 @@ def __init__(
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":
Expand All @@ -147,9 +147,7 @@ def __init__(
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:
Expand Down
6 changes: 0 additions & 6 deletions openviking_cli/utils/config/vectordb_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from pydantic import BaseModel, Field, model_validator

from openviking.storage.vectordb.utils.constants import DEFAULT_PROJECT_NAME

COLLECTION_NAME = "context"


Expand Down Expand Up @@ -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')",
Expand Down
Loading