Release 0.12.0 - #131
Merged
Merged
Conversation
- Flesh out the 0.12.0 changelog with vector-store, evaluator, search-space, and dependency changes; drop the Unreleased heading - Update README examples: prepare package import path and the rag_pattern removal from EvaluationResult - Document build_aggregate_metric in the evaluator API reference - Note the optional RAGAS evaluator and overall score in the evaluation guide; fix Metrics.ANSWER_CORRECTNESS reference - Mark event_handler as required in provider-agnostic examples - Correct search-space defaults (Chroma retrieval_method / window_size) and the Real-parameter enumeration note Signed-off-by: Jakub Walaszczyk <jwalaszc@redhat.com> Assisted-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v0.12.0
Summary
This release makes ai4rag genuinely provider-agnostic. Model access is now built on a plain OpenAI-compatible client — the shipped integration targets OpenShift AI Models-as-a-Service (MaaS), which serves listing, chat, and embeddings from a single endpoint — replacing the OGX-specific stack entirely. The vector-store layer is rebuilt on direct backend clients for Chroma, Milvus, and PostgreSQL/pgvector, configured through typed config dataclasses and with proper connection lifecycle and concurrency handling. Evaluation gains an optional RAGAS evaluator alongside the existing LLM-as-a-Judge path, selectable per optimization run.
Changes
Added
ChromaVectorStore,MilvusVectorStore,PGVectorStore), each selected via a typed, frozen config dataclass (ChromaConfig,MilvusConfig,PGVectorConfig) passed as a singlevector_store_config.rerankermodule implementing RRF and weighted fusion for hybrid search.BaseVectorStorenow supportsclose()and the context-manager protocol; each optimization trial scopes its store in awithblock, so connections and pools are no longer leaked per trial.psycopg_pool.ConnectionPoolwith a configurablePGVectorConfig.pool_max_size(default 10);AI4RAGExperimentsizes the pool frominference_max_threadsso it tracks real query concurrency.RagasEvaluator(with RAGAS adapter classesAI4RAGRagasLLM/AI4RAGRagasEmbeddings) enabling RAGAS-based metrics;ragasis now a regular dependency.llm_judge_modeselector (base/ragas/all/none) onrun_rag_optimization()to choose which LLM-as-a-Judge evaluators run.build_aggregate_metric()shared helper onBaseEvaluatorfor constructing aggregate metric payloads.build_search_space_report()andserialize_model()inai4rag.search_space.prepare, co-locating the model↔spec round-trip (serialize_model()is the write mirror of the model restore path).create_maas_client()and shared model discovery/restore helpersget_foundation_models()/get_embedding_models()inai4rag.search_space.prepare.models, accepting either bare model ids (discovery) or serialized report specs (restore).get_vector_store_config()/get_vector_store_env_vars()factories that build a backend config from a provider discriminator and expose each backend's required environment variables for documentation.openaias the model-access SDK (replacingogx-client), pluschromadb,pymilvus,pgvector, andpsycopg[binary,pool]for the direct vector-store clients.Changed
get_vector_store()andAI4RAGExperimentnow take a singlevector_store_configand dispatch onconfig.provider, replacing thevector_store_typestring plus the OGXvector_ioprovider id.BaseVectorStore, enforcing a mandatoryai4ragprefix as the cross-backend isolation guard.impact_factor→k.vector_store_typechanged fromogxtomilvus; the default Chroma search space no longer includes thewindowretrieval method.prepare_search_space_with_ogxtoprepare_search_space_with_maas, now accepting anopenai.OpenAIclient. Because MaaSmodels.list()carries no metadata (model type, embedding dimension, context length), the payload must declare foundation and embedding model IDs explicitly; embedding dimension and context length are auto-detected at construction time.models.list()reports them (including any/characters); there is no more model-specific URL derivation or id stripping.create_ogx_clientwithcreate_maas_client, a single client that serves listing, chat, and embeddings for every model at the one MaaS endpoint.ogx_{indexing,inference}templates tomaas_{indexing,inference}, each building a singleOpenAIclient fromMAAS_BASE_URL/MAAS_API_KEYand reusing it for every model; the inference notebook now also rebuilds the pattern's detected generation language and passes it toOpenAIFoundationModel, so answers keep the benchmark's language.metricsandoptimization_metricnow requireRAGMetricinstances selected fromMetricsand reject bare metric-name strings, which are ambiguous now that a name (e.g.faithfulness) is shared across the unitxt and RAGAS evaluators.ai4rag.search_space.prepare.models, removing the components↔search_space coupling.ModelsPreSelectorstep;SearchSpaceReportslimmed to the search-space dict and no longer carriesselected_modelsor a per-modelbase_url, andpattern.jsonno longer carriesbase_url.ragas_faithfulness), so colliding metric names each get their own column instead of overwriting one another.Fixed
consistency_level="Strong"on vector/hybrid search so a query immediately following anadd_documents()upsert can no longer race Milvus's default bounded-staleness read and return zero hits against a collection that does contain matching data.inner_productscoring: the<#>operator returns the negative inner product, so the score is now derived by negation (cosine/l2/l1 keep1/dist), fixing an inverted ranking.UniqueViolationfallback) so concurrent search threads no longer race onCREATE INDEX.Nonemean) is now recorded as a failed — not fatal — iteration; a genuinely absent metric still raises aRAGExperimentErrorwith an evaluator-qualified message.vector_db_secret_nameto the indexing pipeline params.ensure_ascii=Falsewhen JSON-dumping documents that may reach the end user, preserving non-ASCII characters.BenchmarkDatarecords with zero correct answers, preventing a downstream unitxtTokenOverlapcrash onmax()of an empty iterable.Removed
ogx-clientdependency,OGXFoundationModel,OGXEmbeddingModel,OGXVectorStore,OGXModelParameters,OGXEmbeddingParams,create_ogx_client, theogx_utilsmodule, theogx_inference_base_urlhelper, and theOGX_CLIENT_BASE_URL/OGX_CLIENT_API_KEYenvironment variables (replaced byMAAS_BASE_URL/MAAS_API_KEY).pattern_builderandprompt_filtersmodules and thebuild_pattern_jsonexport; indexing-spec enrichment is now inlined.prepare_search_space_report()and thesearch_space_preparationmodule removed fromai4rag.components.optimization; build a search space withprepare_search_space_with_maas(), then callbuild_search_space_report()fromai4rag.search_space.prepare.EvaluationResultno longer carries arag_patternfield; a trial's vector store is closed once the trial finishes, so readpattern_name/scoresfromEvaluationResultinstead of calling.generate()on a previously returned pattern.langchain-chroma; Chroma is now used directly viachromadb.samples/run_ai4rag.ipynbnotebook.Migration notes
This is a breaking release. Upgrading from
0.11.xrequires the following changes:OGX_CLIENT_BASE_URL/OGX_CLIENT_API_KEYwithMAAS_BASE_URL/MAAS_API_KEY.MAAS_BASE_URLmust be the full OpenAI-compatible endpoint, used verbatim (e.g.https://<host>/v1).create_ogx_client(...)withcreate_maas_client(base_url, api_key). All OGX model classes (OGXFoundationModel,OGXEmbeddingModel, and their parameter types) are gone; useOpenAIFoundationModel/OpenAIEmbeddingModel. Model ids are now used verbatim as reported bymodels.list()— do not strip path segments.prepare_search_space_with_ogx(...)withprepare_search_space_with_maas(...), passing anopenai.OpenAIclient and explicit foundation and embedding model IDs (MaaSmodels.list()returns no metadata). To produce a report, callbuild_search_space_report()fromai4rag.search_space.prepare—prepare_search_space_report()no longer exists inai4rag.components.optimization. Model pre-selection is now a separateModelsPreSelectorstep, andSearchSpaceReportno longer carriesselected_models.vector_store_typestring (and any OGXvector_ioprovider id /clientargument) with a singlevector_store_configbuilt fromChromaConfig,MilvusConfig, orPGVectorConfig. Theogxvector-store backend is removed and the default is nowmilvus. If you tune hybrid search, rename the reranking parameterimpact_factor→k.EvaluationResultno longer exposesrag_pattern. Readpattern_nameandscoresfromEvaluationResultinstead of calling.generate()on a previously returned pattern; the trial's vector store is closed once the trial finishes.RAGMetricinstances selected fromMetricstometrics/optimization_metric; bare metric-name strings are no longer accepted, because a name such asfaithfulnessis now shared across the unitxt and RAGAS evaluators.ogx-clientandlangchain-chromaare removed. The new runtime dependencies (openai,chromadb,pymilvus,pgvector,psycopg[binary,pool],ragas) are installed automatically; re-sync your environment (uv sync).Checklist
__version__inai4rag/__init__.pyupdated to0.12.0docs/about/changelog.mdupdatedpytest)