babylon.rag.exceptions

Custom exceptions for the RAG system.

Defines RAG-specific exceptions that integrate with the main Babylon error hierarchy. All RAG errors inherit from ObserverError, making them non-fatal to the simulation.

Error Code Ranges: - RAG_001 to RAG_099: General RAG system errors - RAG_100 to RAG_199: Lifecycle management errors - RAG_200 to RAG_299: Embedding errors - RAG_300 to RAG_399: Query/retrieval errors - RAG_400 to RAG_499: Pre-embeddings errors - RAG_500 to RAG_599: Context window errors

Exceptions

CacheError

alias of RagError

ChunkingError

alias of RagError

CorruptStateError

alias of RagError

InvalidObjectError

alias of RagError

LifecycleError

alias of RagError

PreEmbeddingError

alias of RagError

PreprocessingError

alias of RagError

RagError(message[, error_code, details])

Unified exception class for all RAG system errors.

StateTransitionError

alias of RagError

exception babylon.rag.exceptions.RagError(message, error_code='RAG_001', details=None)[source]

Bases: ObserverError

Unified exception class for all RAG system errors.

Use error_code to distinguish between different error types: - RAG_001-099: General errors - RAG_1XX: Lifecycle errors (invalid objects, state transitions) - RAG_2XX: Embedding errors (API failures, batch errors) - RAG_3XX: Query/retrieval errors - RAG_4XX: Pre-embedding errors (chunking, preprocessing) - RAG_5XX: Context window errors (capacity, optimization)

Parameters:
Return type:

None

__init__(message, error_code='RAG_001', details=None)[source]
Parameters:
Return type:

None

babylon.rag.exceptions.LifecycleError

alias of RagError

babylon.rag.exceptions.InvalidObjectError

alias of RagError

babylon.rag.exceptions.StateTransitionError

alias of RagError

babylon.rag.exceptions.CorruptStateError

alias of RagError

babylon.rag.exceptions.PreEmbeddingError

alias of RagError

babylon.rag.exceptions.PreprocessingError

alias of RagError

babylon.rag.exceptions.ChunkingError

alias of RagError

babylon.rag.exceptions.CacheError

alias of RagError