Skip to main content

route66 Python SDK

Project description

route66

Team Information

Project Overview

route66 is an intelligent tool router for LLM agents. Given a query and a large tool catalog, it returns only the relevant tools — deduplicated, in an ordered execution plan, with policy-aware defaults (deprecation preference, out-of-scope refusal, clarify-on-vague- destructive). It is catalog-in and pure compute: it never opens a network connection, authenticates, or executes a tool. The caller keeps their own agent loop and credentials; route66 just picks which tools belong in the next prompt.

Built against the router-testkit grading contract: single-tool routing, ordered multi-tool plans, near-duplicate resolution, capability-based fallback widening, deprecation policy, out-of-scope refusal, and clarify-on-vague-destructive.

The pipeline is a Facade over pluggable strategies (retriever, fuser, reranker, vector store, planner, capability provider, policy chain) — each injectable, each independently testable, each swappable via a constructor argument or an environment variable.

Demo Video

Route66 Demo Link

One Pager Link

route66-router.vercel.app

Technical Design / Architecture Decision Record

Inline summary

Query → grammar-driven plan split (rule-based, LLM optional) → for each step: dense (via a pluggable VectorStore) + BM25 + learned-association retrievers → reciprocal rank fusion → optional cross-encoder rerank (Bedrock Cohere or local sentence-transformers) → runtime near-duplicate resolution → cluster-hint reorder → capability filter → policy chain (PreferCurrent, NoToolOnOOS, ClarifyOnDestructiveVague) → pick.

Tech Stack

  • Language: Python ≥ 3.14 (pinned in .python-version, managed by uv)
  • Core: standard library only for the pipeline
  • Embedding backends: built-in HashingEmbedder (zero-dep default), SentenceTransformerEmbedder (opt-in, --extra semantic), BedrockEmbedder (via internal gateway; TR_EMBEDDER=bedrock)
  • Rerank backends: local CrossEncoderReranker (sentence- transformers) or BedrockReranker (Cohere rerank via gateway; TR_RERANKER=bedrock)
  • Vector store: in-memory exact-cosine default; optional Chroma DB backend (--extra chroma, TR_VECTOR_STORE=chroma)
  • Planner: rule-based RuleChainPlanner by default; optional LLMChainPlanner (Bedrock chat, fail-open) via TR_PLANNER=bedrock
  • Catalog sync (opt-in): MCP client via the official mcp SDK (--extra mcp)
  • Grading harness: router-testkit — standard-library only
  • Tooling: Ruff (lint + format), pytest, pre-commit

Setup & Run Instructions

# 1. Clone and install (uv-managed).
git clone <this repo>
cd route66
uv sync                       # base install, zero extras

# Optional extras:
uv sync --extra semantic      # local sentence-transformers embedder
uv sync --extra chroma        # Chroma DB vector store
uv sync --extra mcp           # MCP client for live tool sync
uv sync --extra dev           # ruff + pytest + pre-commit

# 2. Score the reference baseline (sanity check).
cd router-testkit/harness
python run_benchmark.py --verbose

# 3. Score this project's router against the default suite.
python run_benchmark.py --router testkit_adapter:MyRouter --verbose

# 4. Score every suite in parallel and save per-suite logs to results/.
cd ../..
python results/run_all.py

Optional environment variables

Variable Values Effect
TR_EMBEDDER bedrock | semantic | hashing Which embedder to load (default: semantic → hashing fallback).
TR_RERANKER bedrock | cross-encoder | unset Enable a cross-encoder rerank stage (off by default).
TR_VECTOR_STORE chroma | memory Dense-retrieval backend (default: memory).
TR_PLANNER bedrock | rule Chain planner backend (default: rule).
TR_FORCE_HASHING any value Force HashingEmbedder even when semantic is installed.
TR_LOG debug | info | warning | error route66 logger level (default: WARNING).
TR_TRACE any value Print one line per routed query and bump logging to INFO.
BEDROCK_API_KEY value Required for any Bedrock backend.
BEDROCK_CA_CERT path Required for any Bedrock backend.

Dev commands

uv run ruff check .           # lint
uv run ruff format .          # format
uv run pytest                 # full test suite (Bedrock-live tests skip when credentials absent)

CI / release pipeline

route66 ships with a GitLab CI pipeline that runs on every push and publishes releases to PyPI:

  • .gitlab-ci.yml — lint → test → build on every non-master branch and MR. Same checks run locally via pre-commit.
  • ci/release.gitlab-ci.yml — a manually-triggered child pipeline on master. It bumps src/route66/_version.py, builds wheel + sdist, publishes to PyPI, tags the commit, and appends to release/CHANGELOG.md.

See release/README.md for the full release knobs (BUMP, VERSION, RELEASE_NOTES).

Additional Links / Resources

Repository Layout

route66/
├── src/route66/          # The library (facade + retrievers + policy + vector store + MCP sync)
├── testkit_adapter.py    # Bridges route66 to the harness contract
├── demo.py               # Toy 60-tool catalog demo
├── metrics.py            # Recall / precision / token-savings eval
├── router-testkit/       # Grading kit (catalog + test cases + harness)
├── bench/                # Additional benchmarks
├── specs/                # Spec-driven implementation plan
├── docs/                 # PRDs, architecture docs, feature guides
├── results/              # Per-suite benchmark logs + run_all.py driver
└── tests/                # Unit tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

route66-3.0.0.tar.gz (68.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

route66-3.0.0-py3-none-any.whl (85.5 kB view details)

Uploaded Python 3

File details

Details for the file route66-3.0.0.tar.gz.

File metadata

  • Download URL: route66-3.0.0.tar.gz
  • Upload date:
  • Size: 68.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for route66-3.0.0.tar.gz
Algorithm Hash digest
SHA256 364488233142f2b96e98df784f1d8eed8888c3d9547744dd3dfbdbdd53e07a64
MD5 9e7fc60413558695f5ae2563f9eb1e35
BLAKE2b-256 d09bf6ae5cf433f97af165a8c011d0ecd619692bbe7bd3a600550d40bfb5115d

See more details on using hashes here.

File details

Details for the file route66-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: route66-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 85.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for route66-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2b4e90bda7fc29517464062bf83779ea2fa9461157fd510f7966b0e90f0f56c
MD5 deef22a5f91c2435405cb5b9ddbcecbf
BLAKE2b-256 a8748e0a951879b5be747b86a601104f289ae6990f281a0efefb2e5ec262d126

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page