rag.core.index¶
Chroma persistence helpers for the papers collection.
Exceptions¶
Raised when the Chroma collection has no documents yet. |
Functions¶
|
Open (or create) the persistent Chroma collection. |
|
Load a |
Module Contents¶
- exception rag.core.index.IndexMissingError[source]¶
Bases:
FileNotFoundErrorRaised when the Chroma collection has no documents yet.
- rag.core.index.open_chroma_collection(*, config: rag.core.config.RagConfig) Any[source]¶
Open (or create) the persistent Chroma collection.
- Parameters:
config (RagConfig) – Paths and collection name.
- Returns:
Open collection handle.
- Return type:
chromadb.Collection
- rag.core.index.load_vector_index(*, config: rag.core.config.RagConfig, embed_model: llama_index.core.embeddings.BaseEmbedding, require_nonempty: bool = True) llama_index.core.VectorStoreIndex[source]¶
Load a
VectorStoreIndexbacked by the persistent Chroma store.- Parameters:
config (RagConfig) – Index configuration.
embed_model (BaseEmbedding) – Embedding model used at query time (must match ingest).
require_nonempty (bool) – When True, raise if the collection has zero documents.
- Returns:
LlamaIndex vector index over Chroma.
- Return type:
VectorStoreIndex
- Raises:
IndexMissingError – If
require_nonemptyand the collection is empty.