Documentation
¶
Overview ¶
Package chroma 提供 ChromaDB 向量数据库集成
ChromaDB 是一个开源的嵌入式向量数据库,专为 AI 应用设计。
特性:
- 轻量级,易于嵌入
- 支持本地和服务器模式
- Python 友好
- 简单的 API
使用示例:
store, err := chroma.NewStore(ctx,
chroma.WithHost("localhost"),
chroma.WithPort(8000),
chroma.WithCollection("documents"),
)
defer store.Close()
Index ¶
- type Option
- type Store
- func (s *Store) Add(ctx context.Context, docs []vector.Document) error
- func (s *Store) Clear(ctx context.Context) error
- func (s *Store) Close() error
- func (s *Store) Count(ctx context.Context) (int, error)
- func (s *Store) Delete(ctx context.Context, ids []string) error
- func (s *Store) Get(ctx context.Context, id string) (*vector.Document, error)
- func (s *Store) Search(ctx context.Context, embedding []float32, limit int, ...) ([]vector.Document, error)
- func (s *Store) Stats(ctx context.Context) (map[string]any, error)
- func (s *Store) Update(ctx context.Context, docs []vector.Document) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store ChromaDB 向量存储
通过 HTTP API 与 ChromaDB 服务器交互
func (*Store) Search ¶
func (s *Store) Search(ctx context.Context, embedding []float32, limit int, opts ...vector.SearchOption) ([]vector.Document, error)
Search 搜索相似文档
Click to show internal directories.
Click to hide internal directories.