Instructions to use sauravsingla08/AgentWeave-Router-MiniLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use sauravsingla08/AgentWeave-Router-MiniLM with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("sauravsingla08/AgentWeave-Router-MiniLM") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
AgentWeave Router MiniLM π§
Route before you reason.
A lightweight, CPU-first semantic capability router for AgentWeave. It uses sentence-transformers/all-MiniLM-L6-v2 as a frozen embedding encoder and ranks route prototypes with cosine similarity before downstream model inference.
This repository is intentionally small: it publishes the AgentWeave routing configuration, route prototypes, and executable router code while reusing the upstream MiniLM encoder at runtime instead of copying its weights.
Why this exists
Tool-rich agents can expose large action spaces to a language model. AgentWeave explores a complementary systems strategy: reduce the candidate action space before model reasoning. This model repository provides an experimental semantic routing companion to AgentWeave's default deterministic routing path.
Route families
- π
research - π
retrieval - π§
analysis - π»
coding - πΊοΈ
planning - β
verification - π
summarization - π
data_analysis
Architecture
Task / user request
β
βΌ
all-MiniLM-L6-v2
384-d embedding
β
ββββββββββββββββ
βΌ βΌ
query vector route prototypes
β β
βββββ cosine βββ
β
βΌ
ranked route set
β
βΌ
downstream AgentWeave
No fine-tuning is claimed. This is a prototype-based semantic router built on a frozen MiniLM encoder. Similarity scores are ranking signals, not calibrated probabilities.
Quick start
pip install -r requirements.txt
python router.py "research the latest protocol changes, verify the sources, and summarize the findings"
Example output shape:
[
{"route": "research", "score": 0.0},
{"route": "verification", "score": 0.0},
{"route": "summarization", "score": 0.0}
]
The numeric values above are placeholders showing the response schema; actual scores are computed locally from MiniLM embeddings.
Python usage
from router import AgentWeaveSemanticRouter
router = AgentWeaveSemanticRouter()
routes = router.route(
"inspect this code, identify correctness risks, and propose a fix",
top_k=3,
)
print(routes)
CPU-first design
The router is designed for lightweight local execution:
- frozen MiniLM encoder
- no text generation
- no external inference API required
- normalized embeddings + cosine ranking
- small route-prototype file
The first run downloads the upstream MiniLM encoder. Subsequent runs can use the local Hugging Face cache.
Relationship to AgentWeave
AgentWeave's documented default BYOM routing path is deterministic and provider-neutral. This MiniLM router is an experimental semantic companion, not a replacement for the default router and not the source of AgentWeave's published deterministic-router benchmark claims.
Relevance routing also does not grant permission to execute a tool. Policy filtering, scope controls, and authorization remain separate boundaries in AgentWeave.
Files
| File | Purpose |
|---|---|
router.py |
CPU semantic router implementation |
route_prototypes.json |
Human-readable capability prototypes |
config.json |
Base model and routing configuration |
requirements.txt |
Minimal runtime dependencies |
Intended use
Good fits:
- pre-inference capability routing
- agent/tool candidate reduction experiments
- CPU routing demos
- semantic route exploration
- research comparisons with deterministic routing
Not intended as:
- a calibrated confidence model
- an authorization engine
- a safety classifier
- a replacement for downstream function-calling evaluation
Limitations
- English-focused route prototypes
- prototype wording influences ranking
- route scores are cosine similarities, not probabilities
- the route taxonomy is intentionally compact
- domain-specific tools may need custom prototypes
Source
AgentWeave source code and research artifacts are maintained at:
https://github.com/sauravsingla/AgentWeave
The Hugging Face Space provides an interactive companion experience under the same project name.
License
Apache-2.0. The upstream sentence-transformers/all-MiniLM-L6-v2 model is loaded separately at runtime and remains subject to its own model card and license terms.
- Downloads last month
- -
Model tree for sauravsingla08/AgentWeave-Router-MiniLM
Base model
nreimers/MiniLM-L6-H384-uncased