rag

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArtifactKey added in v1.1.0

func ArtifactKey(corpusID, fileID string) string

ArtifactKey builds the deterministic artifact key for a file within a corpus (format: "rag/{corpusID}/{fileID}"), matching what Ingest uses internally when IngestRequest.FileID is set. Useful for a caller building their own delete-by-file tooling on top of Service.DeleteFileChunks.

Types

type Chunk

type Chunk = internalrag.Chunk

type Chunker

type Chunker = internalrag.Chunker

func DefaultChunker added in v1.1.0

func DefaultChunker() Chunker

DefaultChunker returns a ParagraphChunker with sensible defaults - what NewService uses internally when chunker is nil.

type Embedder

type Embedder = internalrag.Embedder

type IngestRequest

type IngestRequest = internalrag.IngestRequest

type IngestResult

type IngestResult = internalrag.IngestResult

type ParagraphChunker added in v1.1.0

type ParagraphChunker = internalrag.ParagraphChunker

ParagraphChunker splits on blank lines with a hard character cap per chunk. The default Chunker (see DefaultChunker) when none is given.

type Reranker

type Reranker = internalrag.Reranker

type SearchRequest

type SearchRequest = internalrag.SearchRequest

type SearchResponse

type SearchResponse = internalrag.SearchResponse

type SearchResult

type SearchResult = internalrag.SearchResult

type SemanticChunker added in v1.1.0

type SemanticChunker = internalrag.SemanticChunker

SemanticChunker groups sentences into chunks by embedding-similarity instead of blind paragraph splitting - meaningfully better retrieval quality, at the cost of one extra embedding call per sentence during ingest. Falls back to ParagraphChunker behavior if the embedder errors.

func NewSemanticChunker added in v1.1.0

func NewSemanticChunker(embedder Embedder, threshold float32) *SemanticChunker

NewSemanticChunker creates a SemanticChunker. threshold <= 0 uses the default (0.3) - see SemanticChunker's doc for the tradeoff it makes.

type Service

type Service = internalrag.Service

func NewService

func NewService(artifacts publicstorage.ArtifactStore, vectors publicvector.Store, embedder Embedder, chunker Chunker) *Service

type VectorStore

type VectorStore = publicvector.Store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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