Documentation
¶
Index ¶
- func DefaultVectorStore(dbPath string) (abstraction.VectorStore, error)
- func NewMemoryStore() abstraction.VectorStore
- func NewMilvusStore(addr string, username string, password string, collection string) (abstraction.VectorStore, error)
- func NewPineconeStore(apiKey string, environment string, indexName string) (abstraction.VectorStore, error)
- func NewQdrantStore(addr string, apiKey string, collection string) (abstraction.VectorStore, error)
- func NewStore(storeType StoreType, config map[string]interface{}) (abstraction.VectorStore, error)
- func NewWeaviateStore(addr string, scheme string, apiKey string, collection string) (abstraction.VectorStore, error)
- type StoreType
- type VectorStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultVectorStore ¶
func DefaultVectorStore(dbPath string) (abstraction.VectorStore, error)
DefaultVectorStore 创建默认的向量存储(使用 govector) dbPath: 数据库文件路径,默认为 "./data/vectorstore/govector"
func NewMemoryStore ¶
func NewMemoryStore() abstraction.VectorStore
NewMemoryStore 创建内存向量存储(用于测试和原型开发)
func NewMilvusStore ¶
func NewMilvusStore(addr string, username string, password string, collection string) (abstraction.VectorStore, error)
NewMilvusStore 创建 Milvus 向量存储 addr: Milvus 服务器地址,例如 "localhost:19530" username: 用户名(可选) password: 密码(可选) collection: 集合名称,默认为 "gorag"
func NewPineconeStore ¶
func NewPineconeStore(apiKey string, environment string, indexName string) (abstraction.VectorStore, error)
NewPineconeStore 创建 Pinecone 向量存储 apiKey: Pinecone API 密钥 environment: Pinecone 环境,例如 "gcp-starter" indexName: 索引名称,默认为 "gorag"
func NewQdrantStore ¶
func NewQdrantStore(addr string, apiKey string, collection string) (abstraction.VectorStore, error)
NewQdrantStore 创建 Qdrant 向量存储 addr: Qdrant 服务器地址,例如 "localhost:6334" apiKey: API 密钥(可选) collection: 集合名称,默认为 "gorag"
func NewStore ¶
func NewStore(storeType StoreType, config map[string]interface{}) (abstraction.VectorStore, error)
NewStore 根据类型创建向量存储(工厂方法) storeType: 存储类型 config: 配置参数
func NewWeaviateStore ¶
func NewWeaviateStore(addr string, scheme string, apiKey string, collection string) (abstraction.VectorStore, error)
NewWeaviateStore 创建 Weaviate 向量存储 addr: Weaviate 服务器地址,例如 "localhost:8080" scheme: 协议 (http/https),默认为 "http" apiKey: API 密钥(可选) collection: 集合名称,默认为 "GoRAG"
Types ¶
type StoreType ¶
type StoreType string
StoreType 向量存储类型
const ( // MemoryStore 内存存储(用于测试) MemoryStore StoreType = "memory" // GoVectorStore goRAG 内置的向量存储 GoVectorStore StoreType = "govector" // QdrantStore Qdrant 向量存储 QdrantStore StoreType = "qdrant" // MilvusStore Milvus 向量存储 MilvusStore StoreType = "milvus" // PineconeStore Pinecone 向量存储 PineconeStore StoreType = "pinecone" // WeaviateStore Weaviate 向量存储 WeaviateStore StoreType = "weaviate" )
type VectorStore ¶
type VectorStore interface {
abstraction.VectorStore
// Initialize 初始化存储
Initialize(options map[string]interface{}) error
}
VectorStore 向量存储实现接口