Version 4.5.1#

Released: August 11th, 2026

This release expands LLM provider coverage with nine new provider classes and a native Anthropic integration, adds hybrid retrieval to the RAG engine, and introduces a decorator syntax for state bodies.

New Features#

Multi-family LLM support#

A new LLMOpenAICompatible intermediate base class holds a single shared implementation of predict, chat, predict_with_tools, and intent classification for every provider that exposes an OpenAI-compatible chat-completions endpoint. LLMOpenAI is refactored on top of it.

Nine thin provider subclasses are introduced — each requires only a model name and the corresponding API key in the agent configuration:

LLMAnthropic is also added using the native anthropic SDK. It handles system-prompt placement, the required max_tokens parameter, and tool-schema conversion automatically. Ten new baf.nlp Property constants are provided for all new providers.

Hybrid RAG#

HybridRAG is a new subclass of RAG that combines BM25 keyword search with vector similarity search through LangChain’s EnsembleRetriever. BM25 catches exact keyword matches — version numbers, class names, domain-specific identifiers — that semantic search misses due to embedding distance, reducing answer drift on large corpora.

The bm25_weight parameter (default 0.6) controls the blend between keyword and vector results. The BM25 index is rebuilt automatically whenever documents are added at runtime via add_file() or add_text().

State body decorator#

body() can now be used as a decorator to register the body function of a state, as a more ergonomic alternative to calling set_body() explicitly:

@state.body
def my_body(session: Session):
    ...