Documentation
¶
Overview ¶
Package reliquary is the high-level facade for the reliquary retrieval toolkit. It wires the chunking, embedding, and retrieval pipelines behind a small App value with sensible defaults, so a caller can ingest documents and run hybrid search without assembling each lower-level package by hand.
Construct an App with New (bring your own embedder) or with the zero-config Quickstart/InMemory conventions. The App owns no resources and starts nothing; every call takes an explicit context.
Package reliquary is the high-level facade for local retrieval pipelines.
It wires document chunking, caller-owned embedding, in-memory storage, hybrid reranking, and optional MMR diversification behind a small App. Provider SDKs, storage drivers, model runtimes, prompts, and product policy stay outside the root package.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNilApp = errors.New("reliquary: nil app")
ErrNilApp is returned when a method is called on a nil App.
var ErrNoEmbedder = errors.New("reliquary: an embedder is required (use WithEmbedder)")
ErrNoEmbedder is returned by New when no embedder is supplied. There is no sensible default embedding model, so the embedder is the one required dependency.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is a wired retrieval pipeline. Construct it with New, Quickstart, or InMemory.
func InMemory ¶
InMemory returns a ready-to-use RAG App backed entirely by in-process, dependency-free defaults: the deterministic hashing embedder at the given dimension plus New's defaults (in-memory store, smart-boundary chunking, and the default scoring weights). It is ideal for demos and tests; the hashing embedder is not production retrieval quality.
Every input is known-good, so InMemory does not return an error; the only way New can fail is a missing embedder, which InMemory always supplies.
func New ¶
New builds an App from the supplied options. An embedder is required; all other settings default: an in-memory store, smart-boundary chunking at 220 characters with no overlap, and the default hybrid-scoring weights.
func Quickstart ¶
func Quickstart() *App
Quickstart is InMemory(256) — the one-obvious-default entry point for trying reliquary with zero configuration.
Example ¶
package main
import (
"context"
"fmt"
"github.com/dotcommander/reliquary"
"github.com/dotcommander/reliquary/pipeline/document"
)
func main() {
app := reliquary.Quickstart()
ctx := context.Background()
_, _ = app.Ingest(ctx, document.Document{
ID: "doc-1",
Text: "Go uses a concurrent garbage collector.",
})
hits, _ := app.Search(ctx, "garbage collector", reliquary.TopK(1))
fmt.Println(len(hits), hits[0].ID != "")
}
Output: 1 true
type Option ¶
type Option func(*App)
Option configures an App. Every default is explicit and overridable.
func WithChunker ¶
WithChunker overrides the chunking strategy and chunk sizing.
func WithEmbedder ¶
func WithEmbedder(e embeddings.Embedder) Option
WithEmbedder sets the embedder used for ingestion and queries (required).
func WithWeights ¶
WithWeights overrides the default hybrid-scoring weights.
type SearchOption ¶
type SearchOption func(*searchConfig)
SearchOption tunes a single Search call. Options never mutate the App.
func TopK ¶
func TopK(k int) SearchOption
TopK limits Search to the k highest-ranked results. k <= 0 returns no results. Without it, Search returns all scored results.
func WithMMR ¶
func WithMMR(lambda float64) SearchOption
WithMMR enables maximal-marginal-relevance diversification with the given lambda (0 = maximize diversity, 1 = maximize relevance).
type Store ¶
type Store interface {
// Put appends embedded chunks to the store.
Put(ctx context.Context, items []*retrieval.Result) error
// All returns every stored chunk.
All(ctx context.Context) ([]*retrieval.Result, error)
}
Store holds embedded, scorable chunks between Ingest and Search. It is deliberately tiny: the facade needs somewhere to keep ingested chunks. Callers who already own a vector database implement this over their driver in their own module — the root reliquary package never imports storage drivers.
func NewMemoryStore ¶
func NewMemoryStore() Store
NewMemoryStore returns an in-process Store backed by a slice. It is the default store for New and Quickstart.
Directories
¶
| Path | Synopsis |
|---|---|
|
contracts
|
|
|
events
Package events defines neutral event envelopes plus dispatcher, listener, outbox, and append-only log interfaces.
|
Package events defines neutral event envelopes plus dispatcher, listener, outbox, and append-only log interfaces. |
|
llm
Package llm defines provider-neutral language-model messages, requests, responses, streaming events, tool calls, usage, and provider interfaces.
|
Package llm defines provider-neutral language-model messages, requests, responses, streaming events, tool calls, usage, and provider interfaces. |
|
media
Package media defines neutral audio, video, image, transcript, segment, timeline range, and derivative artifact metadata.
|
Package media defines neutral audio, video, image, transcript, segment, timeline range, and derivative artifact metadata. |
|
observability
Package observability defines small logging, metric, tracing, and clock interfaces for reliquary libraries.
|
Package observability defines small logging, metric, tracing, and clock interfaces for reliquary libraries. |
|
observability/logging
Package logging provides zero-dependency constructors for stdlib slog loggers.
|
Package logging provides zero-dependency constructors for stdlib slog loggers. |
|
provenance
Package provenance defines source, artifact, claim, evidence-link, and lineage primitives.
|
Package provenance defines source, artifact, claim, evidence-link, and lineage primitives. |
|
storage
Package storage defines driver-free storage identifiers, schema references, opaque records, cursors, and minimal store contracts.
|
Package storage defines driver-free storage identifiers, schema references, opaque records, cursors, and minimal store contracts. |
|
webfetch
Package webfetch defines neutral web fetch request, result, cache metadata, snapshot, rate-limit, robots, and URL-normalization contracts.
|
Package webfetch defines neutral web fetch request, result, cache metadata, snapshot, rate-limit, robots, and URL-normalization contracts. |
|
workflow
Package workflow defines durable run, stage, attempt, checkpoint, cursor, state, and idempotency primitives.
|
Package workflow defines durable run, stage, attempt, checkpoint, cursor, state, and idempotency primitives. |
|
Package embed provides deterministic, dependency-free embedding helpers for demos, tests, and reliquary.Quickstart.
|
Package embed provides deterministic, dependency-free embedding helpers for demos, tests, and reliquary.Quickstart. |
|
graph
|
|
|
community
Package community implements deterministic graph community detection (Louvain modularity optimization with seeded RNG) plus hub exclusion/reattach.
|
Package community implements deterministic graph community detection (Louvain modularity optimization with seeded RNG) plus hub exclusion/reattach. |
|
digraph
Package digraph provides small in-memory directed graph primitives for DotCommander graph workflows.
|
Package digraph provides small in-memory directed graph primitives for DotCommander graph workflows. |
|
extract
Package extract pulls structured entities, mentions, and typed relationships out of raw text chunks — wikilinks and code symbols — and returns them as a Result ready to feed into a [digraph.Graph].
|
Package extract pulls structured entities, mentions, and typed relationships out of raw text chunks — wikilinks and code symbols — and returns them as a Result ready to feed into a [digraph.Graph]. |
|
graphbuild
Package graphbuild wires extraction results into directed graphs.
|
Package graphbuild wires extraction results into directed graphs. |
|
schema
Package schema defines opt-in graph metadata contracts for provenance-aware consumers.
|
Package schema defines opt-in graph metadata contracts for provenance-aware consumers. |
|
temporal
Package temporal provides validity windows, supersession metadata, and deterministic temporal graph queries for caller-owned graph facts.
|
Package temporal provides validity windows, supersession metadata, and deterministic temporal graph queries for caller-owned graph facts. |
|
internal
|
|
|
sqltx
Package sqltx provides generic transaction lifecycle semantics shared by storage adapters.
|
Package sqltx provides generic transaction lifecycle semantics shared by storage adapters. |
|
pipeline
|
|
|
chunking
Package chunking splits text into reusable chunks for search, retrieval, summarization, and LLM context assembly.
|
Package chunking splits text into reusable chunks for search, retrieval, summarization, and LLM context assembly. |
|
clustering
Package clustering implements online spherical k-means classification for document corpora where embeddings are supplied by the caller.
|
Package clustering implements online spherical k-means classification for document corpora where embeddings are supplied by the caller. |
|
document
Package document defines provider-neutral document, section, and span primitives.
|
Package document defines provider-neutral document, section, and span primitives. |
|
embeddings
Package embeddings defines provider-neutral embedding model, request, result, vector, cache-key, and dimension-validation contracts.
|
Package embeddings defines provider-neutral embedding model, request, result, vector, cache-key, and dimension-validation contracts. |
|
ingest
Package ingest defines generic reader, decoder, mapper, sink, batch, report, and cursor contracts for caller-owned ingestion pipelines.
|
Package ingest defines generic reader, decoder, mapper, sink, batch, report, and cursor contracts for caller-owned ingestion pipelines. |
|
lexical
Package lexical provides provider-neutral lexical search primitives.
|
Package lexical provides provider-neutral lexical search primitives. |
|
retrieval
Package retrieval is a hybrid scoring and reranking layer for local retrieval pipelines.
|
Package retrieval is a hybrid scoring and reranking layer for local retrieval pipelines. |
|
platform
|
|
|
fs
Package fs provides stdlib-only filesystem helpers for config files and small local state owned by callers.
|
Package fs provides stdlib-only filesystem helpers for config files and small local state owned by callers. |
|
primitives
|
|
|
dedup
Package dedup provides generic duplicate and near-duplicate detection for text-like values using string hash strategies.
|
Package dedup provides generic duplicate and near-duplicate detection for text-like values using string hash strategies. |
|
support/diff
Package diff provides tiny, deterministic diff primitives for metadata.
|
Package diff provides tiny, deterministic diff primitives for metadata. |
|
support/hash
Package hash provides stable content hash helpers for reliquary primitives.
|
Package hash provides stable content hash helpers for reliquary primitives. |
|
support/validate
Package validate provides small validation helpers for primitive packages.
|
Package validate provides small validation helpers for primitive packages. |
|
textutil
Package textutil provides lightweight, stdlib-only text helpers for keyword extraction, theme detection, fuzzy alias matching, fragment location, and title normalization.
|
Package textutil provides lightweight, stdlib-only text helpers for keyword extraction, theme detection, fuzzy alias matching, fragment location, and title normalization. |
|
vectors
Package vectors provides small vector math helpers for embedding and retrieval systems.
|
Package vectors provides small vector math helpers for embedding and retrieval systems. |
|
vectors/clustering
Package clustering performs online and offline clustering over caller-supplied vector embeddings.
|
Package clustering performs online and offline clustering over caller-supplied vector embeddings. |
|
vectors/pq
Package pq implements Product Quantization for efficient vector compression.
|
Package pq implements Product Quantization for efficient vector compression. |
|
runtime
|
|
|
registry
Package registry provides a generic, thread-safe provider registry for runtime modules.
|
Package registry provides a generic, thread-safe provider registry for runtime modules. |
|
Package testkit provides reusable fakes and fixtures for downstream reliquary consumers.
|
Package testkit provides reusable fakes and fixtures for downstream reliquary consumers. |