Scoria.Knowledge (scoria v0.1.3)

Copy Markdown View Source

Scoria.Knowledge is the optional knowledge base capability for retrieval, citations, and grounding inside a Phoenix app.

Start with the default runtime first; the default runtime does not require knowledge setup, pgvector bootstrap, retrieval, or grounding. Add this module when your product intentionally needs host-selected source content to support answers and reviewer-visible evidence.

The host app owns the corpus, tenant membership, source truth, and product meaning of retrieved material. Scoria owns tenant-scoped ingestion, retrieval-run evidence, citations, and deterministic grounding checks inside the embedded boundary.

See guides/capabilities/default-runtime.md for the default-first adoption path and guides/reviewer-verification.md for the optional knowledge base verification suite.

Summary

Functions

append_retrieval_results(run_id, results)

build_citations(chunks, opts \\ [])

create_citation(attrs \\ %{}, opts \\ [])

create_grounding_score(attrs \\ %{})

create_retrieval_run(attrs \\ %{})

create_source(attrs \\ %{}, opts \\ [])

ingest_source(source_or_attrs, opts \\ [])

list_retrieval_results(run_id)

list_source_chunks(source_or_id, opts \\ [])

reembed_source(source, opts \\ [])

reindex_source(source, opts \\ [])

retrieve(query_text, opts \\ [])

score_grounding(payload, opts \\ [])