Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// DSN PostgreSQL 连接串, 如:
// postgres://user:password@localhost:5432/dbname?sslmode=disable
DSN string
// Table 存储向量的表名, 默认 "agent_vectors"。
// 表结构示例:
// CREATE TABLE agent_vectors (
// id TEXT PRIMARY KEY,
// namespace TEXT,
// embedding VECTOR(1536),
// metadata JSONB
// );
Table string
// Dimension 向量维度, 需要与 embedding 模型一致。
Dimension int
// Metric 相似度度量, 当前支持 "cosine" (默认) 或 "l2"。
Metric string
}
Config 配置 PgVector 向量存储。 需要数据库已安装 pgvector 扩展:
CREATE EXTENSION IF NOT EXISTS vector;
Click to show internal directories.
Click to hide internal directories.