ofa_private_rag

Ingest a user’s own data into a per-user private RAG store.

Backs ofa --add-private / --list-private / --forget-private.

The private store is a ChromaDB instance under $OFA_SCRATCH — separate from the shared corpora in $OFA_VECTORDB — so a user can index their own data and have it retrieved alongside the built-in collections without any write access to the shared install. See retrieve_private_context in ofa_main.py for the read side.

Chunking / embedding reuse rebuild_indices.py so the private store is byte-for-byte compatible with what the shared pipeline produces.

Functions

add_private(directory[, collection_label, ocr])

Index every supported file under directory into the private store.

forget_private(target)

Delete one private collection, or everything with all.

list_private()

ofa_private_rag.add_private(directory, collection_label=None, ocr='auto')[source]

Index every supported file under directory into the private store.

Re-running with the same collection upserts (stable chunk IDs), so an edited corpus can be refreshed by pointing at the same directory again.

ocr (“auto” | “force” | “off”) controls vision-OCR of PDF pages. Default “auto” self-heals degraded pages (garbled equations / scans); it downgrades to “off” with one notice if the active model has no vision head, rather than emitting a per-page skip.

Parameters:
  • directory (str)

  • collection_label (str | None)

  • ocr (str)

Return type:

int

ofa_private_rag.list_private()[source]
Return type:

int

ofa_private_rag.forget_private(target)[source]

Delete one private collection, or everything with all.

Parameters:

target (str)

Return type:

int