VectorDatabaseObject

VectorDatabaseObject[]

表示一个由 CreateVectorDatabase 创建的向量数据库.

VectorDatabaseObject["name"]

represents the database with the specified name in the VectorDatabaseObjects[] list.

VectorDatabaseObject[source]

attempts to recreate a VectorDatabaseObject from source.

更多信息和选项

  • VectorDatabaseObject 表示一个向量数据库实例,允许与存储的向量进行交互和管理.
  • 该符号对象由 CreateVectorDatabase 返回,可实现常见的数据库管理操作,例如添加数据、搜索、列出内容和属性.
  • source 的可能值包括:
  • "name"a named database from VectorDatabaseObjects[]
    File[]本地文件
    LocalObject[]本地对象
    CloudObject[]云对象
  • 可通过 VectorDatabaseObject[][prop] 获取数据库的属性.
  • 支持以下属性 prop
  • "Dimensions"存储的数组的数量和数组的大小
    "DistanceFunction"使用的距离函数
    "ID"数据库的 ID
    "Location"数据库被存储在何处
    "Metadata"与每个向量关联的元数据
    "Vectors"存储在数据库中的向量
    "WorkingPrecision"存储和计算的数值精度
    {prop1,}属性列表
  • When recreating a database, the following options can be specified:
  • GeneratedAssetLocation $GeneratedAssetLocationwhere to save the database
    OverwriteTarget Automaticwhether to overwrite an existing location

范例

打开所有单元关闭所有单元

基本范例  (2)

初始化一个新的向量数据库:

获取数据库的一些属性:

用向量列表初始化一个新的向量数据库:

执行搜索操作:

范围  (6)

Retrieval  (1)

在文件中存储向量数据库:

从文件中重新创建数据库对象:

Recreate the database object from the database name:

Properties  (2)

提取可用属性的列表:

提取存储的向量:

一次提取多个属性:

Metadata  (3)

Create a vector database where each vector is associated with metadata:

Extract vector database metadata:

Extract vector database metadata and other properties:

Create a vector database where each vector is associated with metadata associations:

Extract vector database object metadata:

Extract a specific metadata element:

Extract multiple metadata elements:

Extract metadata and other properties:

Use the object to perform a search operation:

选项  (2)

GeneratedAssetLocation  (1)

创建向量数据库:

将数据库复制到新位置:

删除原始数据库:

OverwriteTarget  (1)

Create a new vector database:

Create a file:

By default, copying the database to an existing file will fail:

Use OverwriteTarget -> True to override the existing file:

属性和关系  (4)

大多数情况下,只能通过名称来引用现有的向量数据库:

相当于:

Create a database with vectors and metadata:

Both vectors and metadata are stored positionally:

A SemanticSearchIndex is backed by a VectorDatabaseObject:

Retrieve the underlying database:

Detailed information on the database can be extracted using vector database properties:

Modifying or deleting the underlying database may cause issues with the index:

Create a file-backed vector database:

Database information is stored in the "WXF" format:

More files could be generated for efficiently storing the vector information:

可能存在的问题  (2)

在指定位置创建数据库:

裸字符串被解释为数据库名称:

使用 File 包装器指定源为文件路径:

Create a path:

Create a database in the specified location:

Move the underlying files:

The original database is no longer usable:

Use VectorDatabaseObject on the moved file with OverwriteTarget True to recreate the database and update the location data:

Wolfram Research (2024),VectorDatabaseObject,Wolfram 语言函数,https://reference.wolfram.com/language/ref/VectorDatabaseObject.html (更新于 2025 年).

文本

Wolfram Research (2024),VectorDatabaseObject,Wolfram 语言函数,https://reference.wolfram.com/language/ref/VectorDatabaseObject.html (更新于 2025 年).

CMS

Wolfram 语言. 2024. "VectorDatabaseObject." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2025. https://reference.wolfram.com/language/ref/VectorDatabaseObject.html.

APA

Wolfram 语言. (2024). VectorDatabaseObject. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/VectorDatabaseObject.html 年

BibTeX

@misc{reference.wolfram_2025_vectordatabaseobject, author="Wolfram Research", title="{VectorDatabaseObject}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/VectorDatabaseObject.html}", note=[Accessed: 29-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_vectordatabaseobject, organization={Wolfram Research}, title={VectorDatabaseObject}, year={2025}, url={https://reference.wolfram.com/language/ref/VectorDatabaseObject.html}, note=[Accessed: 29-May-2025 ]}