Documentation
¶
Index ¶
- Constants
- func ValidateEmbeddingProviderCompliance(providerName string, consent bool, config map[string]string) error
- type DeterministicEmbedding
- type EmbeddingAdapter
- type EmbeddingComplianceProfile
- type EmbeddingModel
- type EmbeddingProvider
- type EmbeddingProviderRegistry
- type HTTPEmbedding
- type HybridIndex
- type HybridTuningCandidate
- type HybridTuningEvaluation
- type HybridTuningFile
- type HybridTuningQuery
- type NoopEmbeddingAdapter
- type NoopVectorAdapter
- type OpenSearchBulkFailure
- type OpenSearchBulkReport
- type OpenSearchIndex
- type OpenSearchOptions
- type PassageResult
- type QdrantIndex
- func (q *QdrantIndex) Close() error
- func (q *QdrantIndex) Rebuild(docs []parsing.ParsedDocument) error
- func (q *QdrantIndex) RebuildWithReport(docs []parsing.ParsedDocument) (QdrantRebuildReport, error)
- func (q *QdrantIndex) Retrieve(query string) ([]PassageResult, error)
- func (q *QdrantIndex) VectorBackendName() string
- type QdrantOptions
- type QdrantRebuildReport
- type RetrievalBackendBenchmark
- type RetrievalBenchmarkFixture
- type RetrievalBenchmarkQueryResult
- type RetrievalBenchmarkReport
- type SQLiteIndex
- type SearchAdapter
- type VectorAdapter
Constants ¶
const ( PayloadPrivacyFull = "full-text" PayloadPrivacyRedacted = "redacted-checksum" )
const OpenSearchMappingVersion = "opensearch-passages-v1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeterministicEmbedding ¶
type DeterministicEmbedding struct{ Dimensions int }
DeterministicEmbedding is a local, dependency-free embedding scaffold for tests and offline workflows.
func (DeterministicEmbedding) Embed ¶
func (d DeterministicEmbedding) Embed(text string) ([]float64, error)
func (DeterministicEmbedding) EmbeddingBackendName ¶
func (d DeterministicEmbedding) EmbeddingBackendName() string
type EmbeddingAdapter ¶
type EmbeddingAdapter interface{ EmbeddingBackendName() string }
EmbeddingAdapter is the optional embedding-provider seam.
type EmbeddingComplianceProfile ¶
type EmbeddingComplianceProfile struct {
TextEgress string `json:"textEgress"`
RequiresConsent bool `json:"requiresConsent"`
RequiredConfig string `json:"requiredConfig"`
ModelVersionLock string `json:"modelVersionLock"`
Dimensionality string `json:"dimensionality"`
RetentionPolicy string `json:"retentionPolicy"`
Redaction string `json:"redaction"`
}
type EmbeddingModel ¶
EmbeddingModel embeds passage/query text for vector retrieval.
type EmbeddingProvider ¶
type EmbeddingProvider struct {
Name string `json:"name"`
ModelID string `json:"modelId"`
ProviderKind string `json:"providerKind"`
Dimensions int `json:"dimensions"`
LicenseNotes string `json:"licenseNotes"`
VectorIndexInvalidation string `json:"vectorIndexInvalidation"`
RetrievalBenchmarkCompatible bool `json:"retrievalBenchmarkCompatible"`
Compliance EmbeddingComplianceProfile `json:"compliance"`
}
type EmbeddingProviderRegistry ¶
type EmbeddingProviderRegistry struct {
SchemaVersion string `json:"schemaVersion"`
Providers []EmbeddingProvider `json:"providers"`
}
func DefaultEmbeddingProviderRegistry ¶
func DefaultEmbeddingProviderRegistry() EmbeddingProviderRegistry
func (EmbeddingProviderRegistry) Provider ¶
func (r EmbeddingProviderRegistry) Provider(name string) (EmbeddingProvider, bool)
type HTTPEmbedding ¶
HTTPEmbedding calls an opt-in local embedding service for passage/query vectors.
func (HTTPEmbedding) EmbeddingBackendName ¶
func (h HTTPEmbedding) EmbeddingBackendName() string
type HybridIndex ¶
type HybridIndex struct {
Lexical SearchAdapter
Vector SearchAdapter
RRFK float64
}
HybridIndex combines lexical and vector retrieval results with deterministic de-duplication.
func (HybridIndex) Rebuild ¶
func (h HybridIndex) Rebuild(docs []parsing.ParsedDocument) error
Rebuild updates both backing indexes.
func (HybridIndex) Retrieve ¶
func (h HybridIndex) Retrieve(query string) ([]PassageResult, error)
Retrieve returns reciprocal-rank-fused lexical/vector hits with deterministic de-duplication.
type HybridTuningCandidate ¶
type HybridTuningCandidate struct {
Name string `json:"name"`
LexicalWeight float64 `json:"lexicalWeight"`
VectorWeight float64 `json:"vectorWeight"`
BackendWeights map[string]float64 `json:"backendWeights"`
RRFK float64 `json:"rrfK"`
}
func DefaultHybridTuningCandidates ¶
func DefaultHybridTuningCandidates() []HybridTuningCandidate
type HybridTuningEvaluation ¶
type HybridTuningEvaluation struct {
CandidateName string `json:"candidateName"`
LexicalWeight float64 `json:"lexicalWeight"`
VectorWeight float64 `json:"vectorWeight"`
BackendWeights map[string]float64 `json:"backendWeights"`
RecallAtK float64 `json:"recallAtK"`
MRR float64 `json:"mrr"`
Score float64 `json:"score"`
}
type HybridTuningFile ¶
type HybridTuningFile struct {
SchemaVersion string `json:"schemaVersion"`
CalibrationMethod string `json:"calibrationMethod"`
QuerySetChecksum string `json:"querySetChecksum"`
QueryCount int `json:"queryCount"`
K int `json:"k"`
Candidates []HybridTuningCandidate `json:"candidates"`
Evaluations []HybridTuningEvaluation `json:"evaluations"`
SelectedConfiguration HybridTuningCandidate `json:"selectedConfiguration"`
ReproducibilityNotes []string `json:"reproducibilityNotes"`
}
func CalibrateHybridRetrieval ¶
func CalibrateHybridRetrieval(queries []HybridTuningQuery, lexical, vector map[string][]PassageResult, candidates []HybridTuningCandidate, k int) (HybridTuningFile, error)
type HybridTuningQuery ¶
type NoopEmbeddingAdapter ¶
type NoopEmbeddingAdapter struct{}
NoopEmbeddingAdapter reserves the optional embeddings seam without requiring a provider.
func (NoopEmbeddingAdapter) EmbeddingBackendName ¶
func (NoopEmbeddingAdapter) EmbeddingBackendName() string
type NoopVectorAdapter ¶
type NoopVectorAdapter struct{}
NoopVectorAdapter reserves the optional Qdrant seam without requiring the service.
func (NoopVectorAdapter) VectorBackendName ¶
func (NoopVectorAdapter) VectorBackendName() string
type OpenSearchBulkFailure ¶
type OpenSearchBulkReport ¶
type OpenSearchBulkReport struct {
SchemaVersion string `json:"schemaVersion"`
Backend string `json:"backend"`
Index string `json:"index"`
MappingVersion string `json:"mappingVersion"`
Attempted int `json:"attempted"`
Indexed int `json:"indexed"`
Failed int `json:"failed"`
Failures []OpenSearchBulkFailure `json:"failures,omitempty"`
}
type OpenSearchIndex ¶
type OpenSearchIndex struct {
// contains filtered or unexported fields
}
OpenSearchIndex is an optional passage search adapter backed by OpenSearch.
func NewOpenSearchIndex ¶
func NewOpenSearchIndex(options OpenSearchOptions) (*OpenSearchIndex, error)
NewOpenSearchIndex creates an OpenSearch passage index adapter.
func (*OpenSearchIndex) Close ¶
func (o *OpenSearchIndex) Close() error
Close closes adapter resources. The HTTP client has no persistent resource to close.
func (*OpenSearchIndex) Rebuild ¶
func (o *OpenSearchIndex) Rebuild(docs []parsing.ParsedDocument) error
Rebuild bulk-indexes parsed passages into OpenSearch.
func (*OpenSearchIndex) RebuildWithReport ¶
func (o *OpenSearchIndex) RebuildWithReport(docs []parsing.ParsedDocument) (OpenSearchBulkReport, error)
RebuildWithReport bulk-indexes parsed passages and records partial-failure provenance.
func (*OpenSearchIndex) Retrieve ¶
func (o *OpenSearchIndex) Retrieve(query string) ([]PassageResult, error)
Retrieve searches OpenSearch for matching passages.
type OpenSearchOptions ¶
OpenSearchOptions configures the optional OpenSearch adapter.
type PassageResult ¶
type PassageResult struct {
PaperID string
SectionID string
PassageID string
Text string
Highlights []string `json:"Highlights,omitempty"`
}
PassageResult is one full-text retrieval hit.
type QdrantIndex ¶
type QdrantIndex struct {
// contains filtered or unexported fields
}
QdrantIndex is an optional passage vector retrieval adapter backed by Qdrant.
func NewQdrantIndex ¶
func NewQdrantIndex(options QdrantOptions) (*QdrantIndex, error)
func (*QdrantIndex) Close ¶
func (q *QdrantIndex) Close() error
func (*QdrantIndex) Rebuild ¶
func (q *QdrantIndex) Rebuild(docs []parsing.ParsedDocument) error
Rebuild upserts parsed passages into Qdrant with deterministic point IDs.
func (*QdrantIndex) RebuildWithReport ¶
func (q *QdrantIndex) RebuildWithReport(docs []parsing.ParsedDocument) (QdrantRebuildReport, error)
func (*QdrantIndex) Retrieve ¶
func (q *QdrantIndex) Retrieve(query string) ([]PassageResult, error)
Retrieve searches Qdrant by embedded query vector.
func (*QdrantIndex) VectorBackendName ¶
func (q *QdrantIndex) VectorBackendName() string
type QdrantOptions ¶
type QdrantOptions struct {
BaseURL string
Collection string
Timeout time.Duration
Embeddings EmbeddingModel
PayloadPrivacy string
InvalidateBeforeUpsert bool
}
QdrantOptions configures the optional Qdrant adapter.
type QdrantRebuildReport ¶
type QdrantRebuildReport struct {
SchemaVersion string `json:"schemaVersion"`
Backend string `json:"backend"`
Collection string `json:"collection"`
EmbeddingProvider string `json:"embeddingProvider"`
Dimension int `json:"dimension"`
PayloadPrivacy string `json:"payloadPrivacy"`
InvalidatedBeforeUpsert bool `json:"invalidatedBeforeUpsert"`
Attempted int `json:"attempted"`
Indexed int `json:"indexed"`
TextEgress string `json:"textEgress"`
}
type RetrievalBenchmarkFixture ¶
type RetrievalBenchmarkFixture struct {
SchemaVersion string `json:"schemaVersion"`
FixtureID string `json:"fixtureId,omitempty"`
Queries []HybridTuningQuery `json:"queries"`
BackendResults map[string]map[string][]PassageResult `json:"backendResults"`
}
func DefaultRetrievalBenchmarkFixture ¶
func DefaultRetrievalBenchmarkFixture() RetrievalBenchmarkFixture
type RetrievalBenchmarkQueryResult ¶
type RetrievalBenchmarkQueryResult struct {
QueryID string `json:"queryId"`
Backend string `json:"backend"`
TopK []string `json:"topK"`
Metrics RetrievalBackendBenchmark `json:"metrics"`
}
type RetrievalBenchmarkReport ¶
type RetrievalBenchmarkReport struct {
SchemaVersion string `json:"schemaVersion"`
FixtureID string `json:"fixtureId"`
QuerySetChecksum string `json:"querySetChecksum"`
QueryCount int `json:"queryCount"`
K int `json:"k"`
Backends []RetrievalBackendBenchmark `json:"backends"`
SelectedBackend string `json:"selectedBackend"`
QueryResults []RetrievalBenchmarkQueryResult `json:"queryResults"`
ReproducibilityNotes []string `json:"reproducibilityNotes"`
PrivacyNotes []string `json:"privacyNotes"`
}
func RunRetrievalBenchmark ¶
func RunRetrievalBenchmark(fixture RetrievalBenchmarkFixture, k int) (RetrievalBenchmarkReport, error)
type SQLiteIndex ¶
type SQLiteIndex struct {
// contains filtered or unexported fields
}
SQLiteIndex stores parsed passages in a local SQLite FTS index.
func OpenSQLiteIndex ¶
func OpenSQLiteIndex(path string) (*SQLiteIndex, error)
OpenSQLiteIndex opens a local SQLite FTS passage index.
func (*SQLiteIndex) Rebuild ¶
func (i *SQLiteIndex) Rebuild(docs []parsing.ParsedDocument) error
Rebuild replaces all indexed parsed passages.
func (*SQLiteIndex) Retrieve ¶
func (i *SQLiteIndex) Retrieve(query string) ([]PassageResult, error)
Retrieve returns passages matching a full-text query.
type SearchAdapter ¶
type SearchAdapter interface {
Rebuild([]parsing.ParsedDocument) error
Retrieve(string) ([]PassageResult, error)
Close() error
}
SearchAdapter is the passage retrieval seam for local and optional search backends.
type VectorAdapter ¶
type VectorAdapter interface{ VectorBackendName() string }
VectorAdapter is the optional vector-store seam for future Qdrant integration.