simple

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipeline

type Pipeline struct {
	// contains filtered or unexported fields
}

Pipeline 提供最小可用的知识入库与检索流程。 目标:少依赖、易落地,便于示例/测试快速验证 RAG。

func DefaultInMemoryPipeline

func DefaultInMemoryPipeline() (*Pipeline, error)

DefaultInMemoryPipeline 返回基于内存向量库和 MockEmbedder 的默认管线(单例)。

func NewPipeline

func NewPipeline(cfg PipelineConfig) (*Pipeline, error)

NewPipeline 创建知识管线。

func (*Pipeline) Search

func (p *Pipeline) Search(ctx context.Context, query string, topK int, metadata map[string]any) ([]vector.Hit, error)

Search 根据查询语句执行向量检索。 返回向量命中列表;不在此处做 rerank/过滤,保持简洁。

func (*Pipeline) UpsertText

func (p *Pipeline) UpsertText(ctx context.Context, id, text string, metadata map[string]any) ([]string, error)

UpsertText 将纯文本写入向量库。 - 自动按段落切分;ID 会追加 chunk 索引(id#0, id#1...) - metadata 会透传到向量文档。

type PipelineConfig

type PipelineConfig struct {
	Store       vector.VectorStore
	Embedder    vector.Embedder
	Namespace   string
	DefaultTopK int
}

PipelineConfig 简化知识管线配置。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL