Changelog
What changed in each Semantic Router release.
v1.3.1
1.3.1 fixes one bug in hybrid routers that use a fitted sparse encoder (BM25Encoder, TfidfEncoder). There's nothing to change in code written for 1.3.0.
Fix: Reopening repairs a write that failed part way
- Every stored row now records which fit of the sparse encoder it was encoded with, in a reserved
sr_sparse_fitmetadata key that never appears in route metadata. If anadd()orremove()failed part way and was never retried, the next router opened on that index finds the rows that don't match and re-encodes them in place. Before, it kept their stale sparse vectors until the next write. A consistent index still opens with no writes. (#873) - Indexes written before
1.3.1have no fit marks. They open as before, with nothing re-encoded on upgrade. The first write to one marks every row. Anadd()re-encoded every row already. A change to an existing route now re-encodes the whole index once, and if rows will remain, the firstremove()marks the whole index before deleting and rewrites the surviving rows afterward. - The mark covers the encoder's class and the utterances it was fitted on, not its settings. If you change a BM25 or TF-IDF setting on an existing index without changing its utterances, rebuild the index.
v1.3.0
1.3.0 adds one decision model. There are no breaking changes, and nothing to change in code written for 1.2.0.
Feature: Nace Drex
NaceDecisionModelcalls nace.ai's Drex over the same/v1/systemoneAPI as Jev. Pass it asDecisionRouter(model=NaceDecisionModel(), routes=routes). It reads its key fromNACE_API_KEY, and router files save it astype: nace. (#825)
v1.2.0
1.2.0 adds one feature: a router can tell you which stored utterances matched a query. It's off by default: code written for 1.1.3 keeps working, and a call that doesn't ask runs no extra search. RouteChoice has a new matched_utterances field, so model_dump() and JSON output include matched_utterances: None.
Feature: Matched utterances
router(query, return_utterances=True)(andacall) fills eachRouteChoice.matched_utteranceswith the stored utterances behind it, asMatchedUtterance(text, score, route). Scores are the index's raw similarity scores, never calibrated. Use it to debug a misroute or tune a threshold. (#479)matched_utterancesisNonewhen you didn't ask, when nothing cleared the threshold, or when the router can't say (aDecisionRouter, or a custom index that doesn't return utterances). It's[]when you asked but none of the route's utterances were in the index'stop_khits.- An
IndexedRouterlists each route's matches best first.Chaingives the matches of the router that answered.Mergegives every sub-router's, router by router in the order you passed them (so not sorted across routers), each with its own router's score. - Every built-in index takes
return_utterances=Trueonqueryandaquery, and then returns(scores, routes, utterances). Without it, they return(scores, routes)as before. - A custom index whose
querydoesn't takereturn_utteranceskeeps working: the router routes as before, leavesmatched_utterancesasNone, and logs a warning once per index class. - A custom router that implements
_scoreskeeps working. To return matches from your own router, override the new_results_many(queries, return_utterances)hook, which returns aQueryResultper query.
v1.1.3
1.1.3 fixes bugs in five encoders, in hybrid routers reusing an index, in Chain and Merge, in the Pinecone and Qdrant indexes, in calibration, and in router files on Windows. It also patches locked dependencies with security advisories. Check the two Stricter changes below, and router files saved on Windows before 1.1.3 in a legacy encoding, which may need converting to UTF-8.
Fixes
OpenAIEncoderandAzureOpenAIEncodersend at most 2,048 texts per request, OpenAI's limit for one embeddings call, and return the embeddings in input order. Each request retries on its own.VoyageEncodersends at most 1,000 texts per request, Voyage's limit.GoogleEncodersends at most 250 texts per request, and one per request forgemini-embeddingmodels, which take a single text. It used to send every text in one request, which Vertex AI rejects for large route sets.OllamaEncoderandGoogleEncodernow have an asyncacall. Async routers already ran their sync methods in a worker thread, so routing behaves as before;acallcan now be called directly. Ollama keeps one async client per event loop, so repeatedasyncio.run()calls work. Google runs its sync client in a worker thread and batches as above.AzureOpenAIEncoderraises a clearValueErrorbefore any call for an empty list, an empty string, or an item that isn't a string, asOpenAIEncoderdoes since1.1.2. It used to retry, then fail with the API's error. Stricter: a bare string, outside theList[str]signature, now raises too.- A hybrid
IndexedRouter(TF-IDF or BM25) built on an index that already holds routes refits its sparse encoder and rewrites the stored rows when the new routes bring new utterances. The stored rows used to keep the old vocabulary, so queries were misrouted. Reopening an index with the routes it already holds writes nothing.add()andremove()encode every row before writing anything.add()writes over the stored rows by id.remove()deletes the removed route, then writes the remaining rows over by id. On Pinecone,add()on a hybrid router no longer deletes the whole index, with every other namespace in it. If encoding fails, the index is left as it was. (#854) Chainpasses a query on to its next router when a router returns no candidates. It used to raiseValueErrorfrommax(). If every router returns nothing, the chain returns an emptyRouteChoice().Mergeraises aValueErrorunless there is one weight per router, each finite and at least 0, adding up to more than 0. A short list used to drop the routers past its end, a long one lowered every confidence, and weights adding up to 0 raisedZeroDivisionErroron the first call.weights=Nonestill means equal weights, and changingmerge.weightsafter construction is checked on the next call. Stricter: weights that used to be silently misapplied now raise, andweights=[], which used to mean equal weights, now raises too: passNoneinstead.PineconeIndex.adelete()raises when Pinecone answers a delete with an error, as the syncdelete()does. It used to report the vectors as deleted.PineconeIndex's async paging raises when a page fails, instead of returning an empty or partial list.adelete(),aget_routes()and a hybrid router'saadd()could act on that partial list. A 404 still reads as an empty index. (#794)QdrantIndex.add()waits for its write to land before returning, so a read straight after sees it.- Calibration pools tied scores before fitting, so the same labelled scores give the same calibrator in any order. Output without ties is unchanged, and saved calibrators load as before. (#788)
- Router files are written and read as UTF-8. On Windows, saving a router with characters outside the locale's code page used to raise
UnicodeEncodeError, and loading a file written elsewhere could misread it. A file saved on Windows by an earlier version, in a legacy encoding with non-ASCII characters, may need converting to UTF-8 before it loads.
Security
- The lockfile moves litellm to 1.103.1, pyasn1 to 0.6.5, and, on Python 3.11 and later, dnspython to 2.9.2 and filelock to 4.3.0, for their advisories. On Python 3.10, filelock is 4.0.12 and dnspython stays on 2.8.0: the patched releases need Python 3.11. The package's declared dependency ranges don't change.
v1.1.2
1.1.2 fixes bugs in five encoders, in loading encoders from router files, and in calibration. Code and files written for 1.1.1 work unchanged.
Fixes
CohereEncodersends at most 96 texts per request, Cohere's limit for one embed call, and returns the embeddings in input order. A router with more than 96 utterances used to fail to encode them.BedrockEncoderwith a Cohere model returns one embedding per document. It used to return one per 20-word chunk, so it gave back more embeddings than documents. Each document is now sent whole, up to 96 per request. Embed v3 takes at most 2,048 characters per text, so a longer document is cut to fit followingtruncateinmodel_kwargs.END, the default, keeps the start;STARTkeeps the end; andNONEraises aValueErrorbefore any call. Embed v4 texts are sent uncut. (#824)OpenAIEncoderraises a clearValueErrorbefore any call for an empty list, an empty string, or an item that isn't a string. It used to retry, then fail with$.input is invalid. Whitespace-only strings are still sent. (#530)OpenAIEncoderaccepts models that tiktoken doesn't know, such asnomic-embed-texton an OpenAI-compatible server. It counts tokens withcl100k_basefor them, where it used to raiseKeyError.HFEndpointEncoderstops resending a request once it succeeds. It used to send a successful request again until its retries ran out, three times by default. When an endpoint still answers 503 after the retries, it raises aValueError; it used to return the error body as embeddings.GoogleEncoderdefaults totext-embedding-005, because Google retired the old default,textembedding-gecko@003. Both give 768-dimensional embeddings.GOOGLE_EMBEDDING_MODELstill overrides it.- An encoder block in a router file can leave out
name, and the encoder then uses its default model.AutoEncoderdoes the same when passedname=None. This used to fail validation forFastEmbedEncoder,HuggingFaceEncoder,VitEncoder,CLIPEncoder,BedrockEncoderandLocalEncoder. fitandafitraise a clearValueErrorwhen a query scores no route, as on a router with no routes. They used to fail withmax() iterable argument is empty. (#806)
v1.1.1
Security
-
LiteLLM 1.107.0 is excluded. That PyPI release contained malware (a supply-chain attack, live on PyPI on 21 October 2026 from 11:39 to 13:23 UTC), and the
litellmextra allowed it. The extra is nowlitellm>=1.84.0,!=1.107.0. PyPI has removed 1.107.0, but a private mirror may still serve it.If you installed
semantic-router[litellm]or[all]without a lockfile in that window, check without starting Python in that environment: any Python start,pipincluded, runs the malware again. Look at your lockfile or deployment records, or search the environment from a shell, for examplefind <env> -name 'litellm-1.107.0.dist-info' -o -name cook.pth -o -name sitecustomize.py.pip show litellmis safe only in an environment you know is clean, such as one you've just rebuilt.If 1.107.0 was installed, follow LiteLLM's incident guidance: isolate the host, rebuild the environment rather than reinstalling into it, and rotate every credential it could reach, from a clean machine. Finding nothing doesn't prove the environment was never exposed.
-
certifi 2026.10.19 in the lockfile. It removes the
emSign ECC Root CA - G3root, which compromised eMudhra intermediate keys chain to (advisory). semantic-router doesn't pin certifi, sopip install -U certifiupdates the bundle in an existing environment; images and vendored bundles need rebuilding. Connections to Postgres or MongoDB over TLS may use your operating system's trust store or a CA bundle you configured instead of certifi: update whichever one they use.
v1.1.0
1.1.0 adds a MongoDB Atlas index and fixes four bugs. Code and files written for 1.0.2 work unchanged, apart from the QdrantIndex.ais_ready() change below.
Feature: MongoDB Atlas Vector Search
MongoDbIndexstores routes in MongoDB and searches them with Atlas Vector Search:pip install "semantic-router[mongodb]".- The first
addcreates the collection and its vector search index, so there's nothing to set up in Atlas first. Atlas makes new records searchable a moment after they're written, soaddwaits until they are (up tosync_timeout, 30 seconds by default). - Cosine and dot product scores are the raw similarity, the same scale as the other indexes.
namespacekeeps tenants apart in one collection. - The connection string comes from
connection_uriorMONGO_CONNECTION_URI, and is never written to a file. Files save the rest, so a router on it saves and loads like any other.
Fixes
BedrockEncodernow retries a failed call (throttling, an expired session token), making up to three attempts with backoff. It used to raise on the first error.PineconeIndex.aquery()accepts a sparse vector as a dict, asquery()does.QdrantIndex.ais_ready()falls back to the sync check for an in-memory index, so it agrees withis_ready().QdrantIndex.ais_ready()now raises when the check itself fails (Qdrant unreachable), asis_ready()does. It used to log a warning and returnFalse. If you call it yourself, handle the exception where you used to treatFalseas "not ready".
v1.0.2
1.0.2 adds a decision model that runs locally. Code and files written for 1.0.1 work unchanged.
Feature: GLiNER2.5-Decide, a local decision model
GLiNER2DecisionModelruns fastino/GLiNER2.5-Decide in-process, soDecisionRouter(model=GLiNER2DecisionModel(), routes=routes)routes with no network call and no API key.- It answers
choice,noulandscorequestions like the HTTP models, batches states (batch_size, default 8) and runs off the event loop. It uses CUDA, then MPS, then CPU, unless you passdevice. classifier=takes agliner2classifier you loaded yourself, such as one with a fine-tuned adapter.- It needs the
localextra, which now includesgliner2(Python < 3.13, like the other torch-based models):pip install "semantic-router[local]". - Files save it as
model: {type: gliner2, name: fastino/GLiNER2.5-Decide}, plusdeviceandbatch_sizewhen you set them.
v1.0.1
1.0.1 makes the decision model a component you pass to DecisionRouter, the way you pass an encoder to IndexedRouter. It changes DecisionRouter's arguments, so code and files written for 1.0.0 need a small edit.
Breaking: decision models are a component
DecisionRouter(model=TypeSafeDecisionModel(), routes=routes)replacesDecisionRouter(routes=routes). The connection settings move to the model:api_key,base_url,timeout,retriesandconcurrency, andmodelbecomes the model'sname.SystemOneDecisionModel(name=..., base_url=...)talks to any/v1/systemoneserver (Laya, Von or your own) and sends a key only if you pass one.TypeSafeDecisionModelis the same with TypeSafe's defaults, and readsJEV_API_KEY.- Subclass
DecisionModeland implementaaskto route with another kind of model. choice,noulandscoremove tosemantic_router.decision_models.- Files save the model as a block,
model: {type: typesafe, name: jev-latest}. A1.0.0file, which wrotemodel: jev-latest, fails to load with an error that shows the new form.
v1.0.0
The 1.0.0 release rebuilds the routing layer. A router is now anything that scores every route; the base class turns scores into calibrated confidence, and routers compose. It's a breaking release: the migration guide covers every change, with before and after code.
Feature: Router types
IndexedRouterreplacesSemanticRouter. Passing asparse_encodermakes it hybrid, which replacesHybridRouter. The hybridalpha(the weight on the dense score) defaults to 0.7, not 0.3, and now weights the dense side onHybridLocalIndextoo.DecisionRouterroutes with a decision model over TypeSafe's/v1/systemoneAPI (Jev, Laya, Von), andaask()answers severalchoice,noulandscorequestions about one message in a single call.Chainfalls through from a fast router to a slower one when the fast one isn't confident.Mergetakes a weighted average of several routers.- Subclass
BaseRouterand implement one async method,_scores, to build your own router. DecisionRouter(concurrency=8)sets how many requests a batch keeps in flight.
Feature: Calibration
fit()learns a map from raw score to the probability that the top route is right (Platt or isotonic), and returns aFitReportwith accuracy and calibration error. It replaces the random threshold search.confidence_thresholdreplacesscore_threshold, on the router and on each route. A per-callthreshold=overrides both.RouteChoiceis nowname,confidenceandcalibrated.
Feature: The index is the source of truth
router.routesis a cached view of the index, filled on build and after the router's ownadd/remove.refresh()/arefresh()re-read it, andrefresh_intervalre-reads it during calls once it's that many seconds old. A query always searches the index itself.- An
IndexedRoutercan open an index that 0.x filled:IndexedRouter(encoder=..., index=...)with no routes reads them back.
Feature: Config files
router.to_yaml(path=),router.to_json(path=)andload_router(path=)save and load any router type, keyed onrouter_type, with the calibrator and without secrets.
Removed
- Index sync:
auto_sync,sync(),is_synced(),get_utterance_diff(), and the hash, lock and config records. The index is the single source of truth. - Dynamic routes and the
semantic_router.llmspackage,function_schemas,RouteChoice.function_callandsimilarity_score. route_filter,vector=andsimulate_static=on router calls.- The default
OpenAIEncoder(): the encoder is now required. score_thresholdon encoders, andllama-cpp-pythonfrom the[local]extra.- Default thresholds: with no
confidence_threshold, the best route always wins.
v0.1.12
The 0.1.12 release brings Pinecone v7 support and AWS Bedrock boto3 client integration, improving compatibility and expanding cloud deployment options.
Feature: Pinecone v7 Upgrade
Semantic Router now supports Pinecone Python SDK v7, providing:
- Improved data plane performance and reliability
- Enhanced async support for high-throughput applications
- Simplified API structure for better developer experience
- Better error handling and retry logic
The upgrade is backward compatible - existing code continues to work without changes. For shared index deployments, set PINECONE_INDEX_NAME to reuse existing indexes and avoid quota limits. Semantic Router automatically isolates data using namespaces.
Feature: Bedrock boto3 Client Support
Added support for custom boto3 clients in the BedrockEncoder, enabling:
- Advanced AWS credential management (IAM roles, cross-account access)
- Custom retry policies and timeout configurations
- VPC endpoint support for private deployments
- Better integration with existing AWS infrastructure
This provides greater flexibility for enterprise AWS deployments while maintaining backward compatibility with the existing credential-based approach.
Chore: Relaxed OpenAI SDK Dependency
Updated OpenAI SDK dependency constraints from <2.0.0 to <3.0.0, allowing compatibility with OpenAI SDK v2.x releases. This provides access to newer OpenAI features and improvements while maintaining stability through the v2 major version.
v0.1.11
The 0.1.11 release introduces new encoder options for local and self-hosted deployments, alongside sparse encoding improvements and CI/CD enhancements.
Feature: Local Encoder
Added LocalEncoder for fully local embedding generation using sentence-transformers:
- No API keys or internet connection required
- Automatic device selection (CUDA, MPS, CPU)
- Support for any sentence-transformers model
- Privacy-first design - all data stays on your machine
Perfect for offline deployments, privacy-sensitive applications, or development environments.
Feature: Local Sparse Encoder
Added sparse encoder support using sentence transformers with LocalSparseEncoder.
- Same offline advantages as the Local Encoder above.
- Better handling of sentence boundaries
- Improved BM25 and TF-IDF implementations
- Enhanced compatibility with
HybridRouter
Feature: Ollama Encoder
Introduced OllamaEncoder for using Ollama-hosted embedding models:
- Works with any Ollama embedding model (nomic-embed-text, mxbai-embed-large, etc.)
- Full control over model versions and hosting
- Low latency with local Ollama instances
- Both sync and async support
Ideal for organizations wanting to self-host embedding models while maintaining API-like convenience.
Feature: Dagger CI
Implemented Dagger for CI/CD pipeline, providing:
- Faster, more reliable builds
- Better caching and parallelization
- Consistent local and remote execution
- Improved developer experience
Chore: Torch Dependency Optimization
Removed torch from main dependencies to reduce installation size. PyTorch is now only installed when needed via semantic-router[local] extras, reducing default installation from ~2GB to <100MB.
v0.1.10
The 0.1.10 release was primarily focused on expanding async support for QdrantIndex, PostgresIndex, and HybridRouter, alongside many synchronization and testing improvements.
Feature: Expanded Async Support
- QdrantIndex: Async methods have been brought inline with our other indexes, ensuring consistent behavior.
- PostgresIndex: Async methods have been added to the
PostgresIndexfor improved performance in async environments. - HybridRouter: Async support for the
HybridRouteris now aligned with theSemanticRouter, providing a more consistent experience.
Fixes and Optimizations
- LocalIndex Bug Fix: Added a
metadataattribute to the local index. This fixes a bug whereLocalIndexembeddings would always be recomputed, as reported in issue #585. - Various other bug fixes and optimizations have been included in this release.
- The
urllib3library has been upgraded. - Test compatibility and synchronization have been optimized.
v0.1.9
The 0.1.9 update focuses on improving support for our local deployment options. We have standardized the PostgresIndex to bring it in line with other index options and prepare it for future feature releases. For local extras (including transformers and llama_cpp support) and postgres extras we have resolved issues making those extras unusable with Python 3.13.
Continue reading below for more detail.
Feature: Improvements to postgres Support
-
Upgrade from psycopg2 to v3 (psycopg): We've upgraded our PostgreSQL driver from psycopg2 to the newer psycopg v3, which provides better performance and modern Python compatibility.
-
Standardization of sync methods: The
PostgresIndexclass now has standardized synchronous methods that integrate seamlessly into our standard pytest test suite, ensuring better testing coverage and reliability. -
Addition of IndexType support: We've introduced
IndexTypewhich includesFLAT,IVFFLAT, andHNSWindex types. BothFLATandIVFFLATmap to theIVFFLATindex in pgvector (pgvector does not currently supportFLATand soIVFFLATis the closest approximation - but our other indexes do).FLATis now the default index type. We recommendHNSWfor high-scale use cases with many millions of utterances due to its higher memory requirements and complexity.
Feature: Configurable Logging
- Environment variable log level control: Logger now supports configurable log levels via environment variables. Set
SEMANTIC_ROUTER_LOG_LEVELorLOG_LEVELto control logging verbosity (e.g.,DEBUG,INFO,WARNING,ERROR). Defaults toINFOif not specified.
Fix: Local Installation for Python 3.13 and up
Python 3.13 and up had originally been incompatible with our local installations due to the lack of compatability with PyTorch and the (then) new version of Python. We have now added the following version support for local libraries:
local = [
"torch>=2.6.0 ; python_version >= '3.13'",
"transformers>=4.50.0 ; python_version >= '3.13'",
"tokenizer>=0.20.2 ; python_version >= '3.13'",
"llama-cpp-python>=0.3.0 ; python_version >= '3.13'",
]Fix: Consistent Index Length Behavior
- Standardized
__len__method across all index implementations: All index types now consistently return0when uninitialized, preventing potentialAttributeErrorexceptions that could occur inPineconeIndexandQdrantIndexwhen checking the length of uninitialized indexes.
Chore: Broader and More Useful Tests
We have broken our tests apart into strict unit and integration test directories. Now, when incoming PRs are raised we will no longer trigger integration tests that require API keys to successfully run. To ensure we're still covering all components of the library we have broadened our testing suite to extensively test LocalIndex, PineconeIndex (via Pinecone Local), PostgresIndex, and QdrantIndex within those unit tests.