src.dackar.RCA.storage.lc_retriever_processed

Attributes

LOGGER

_WARNED_NON_RRF_FUSION

Classes

RetrieveResult

ContextPack

LCProcessedRetriever

Light adaptation of the earlier retrieval layer for processed_text_record.

Module Contents

src.dackar.RCA.storage.lc_retriever_processed.LOGGER[source]
src.dackar.RCA.storage.lc_retriever_processed._WARNED_NON_RRF_FUSION = False[source]
class src.dackar.RCA.storage.lc_retriever_processed.RetrieveResult[source]
record_id: str[source]
snippet: str[source]
metadata: Dict[str, Any][source]
per_view: Dict[str, Any][source]
score: float | None[source]
record: Dict[str, Any] | None[source]
class src.dackar.RCA.storage.lc_retriever_processed.ContextPack[source]
query_texts: Dict[str, str][source]
results: List[RetrieveResult][source]
class src.dackar.RCA.storage.lc_retriever_processed.LCProcessedRetriever(manager, doc_store)[source]

Light adaptation of the earlier retrieval layer for processed_text_record.

Differences from the original lc_retriever.py: - Uses ChromaRecordStore collections keyed by document type. - Treats record_id as the vector/document identity. - Hydrates canonical processed_text_record objects instead of raw mdParser chunks.

Parameters:
manager[source]
store[source]
query_doc_types(*, doc_types, query_text, top_k_per_doc_type=8, k_final=10, filter_meta=None, fusion='rrf', view_weights=None, hybrid_weight=0.5, snippet_preference='raw_text')[source]
Parameters:
  • doc_types (List[str])

  • query_text (str)

  • top_k_per_doc_type (int)

  • k_final (int)

  • filter_meta (Optional[Dict[str, Any]])

  • fusion (str)

  • view_weights (Optional[Dict[str, float]])

  • hybrid_weight (float)

  • snippet_preference (str)

Return type:

ContextPack

_fuse(per_view_hits, *, fusion, k_final, view_weights)[source]

Fuse per-doc-type hit lists into a single ranked list.

Only Reciprocal Rank Fusion (RRF) is valid at this cross-doc-type layer. Each incoming hit’s score is the fused RRF score produced by ChromaRecordStore.query_doc_type (higher = better), not a raw vector distance. weighted_distance_inversion assumes a raw non-negative distance (lower = better), so applying it here would rank matches worst-first. Any non-"rrf" fusion value is therefore mapped to RRF with a one-time warning; weighted_distance_inversion remains available only for the per-view (raw-distance) layer inside the store.

Parameters:
  • per_view_hits (Dict[str, List[Dict[str, Any]]])

  • fusion (str)

  • k_final (int)

  • view_weights (Optional[Dict[str, float]])

Return type:

List[Dict[str, Any]]