AI routing based on Selector Complexity theory
Project description
SC-Router
AI routing based on Selector Complexity theory.
"What is the minimum cost of choosing the right strategy?"
SC-Router classifies queries by the difficulty of the routing decision itself — not just the query content. Based on the mathematical framework of Selector Complexity (IPS proof complexity), it determines whether a query needs direct dispatch, pipeline decomposition, combinatorial search, or full agent delegation.
Install
pip install sc-router
Quick Start
from sc_router import ToolCatalog, Tool, route
catalog = ToolCatalog()
catalog.register(Tool(
name="weather",
description="Get weather forecast",
input_types={"location"},
output_types={"weather_data"},
capability_tags={"weather", "forecast", "temperature"}
))
catalog.register(Tool(
name="calculator",
description="Perform arithmetic calculations",
input_types={"expression"},
output_types={"number"},
capability_tags={"math", "calculate", "arithmetic"}
))
result = route("What's the weather in Madrid?", catalog)
print(result.sc_level) # 0
print(result.strategy) # 'direct'
print(result.tool_assignments) # [ToolAssignment(tool='weather', ...)]
SC Levels
| SC | Query Type | Routing Action | Example |
|---|---|---|---|
| SC(0) | 1 tool, obvious | Direct dispatch | "What's the weather in Madrid?" |
| SC(1) | Decomposable | Pipeline/parallel | "Search flights to Paris, book the cheapest" |
| SC(2) | Ambiguous/complex | Search combinations | "Plan trip: flights+hotel+restaurants, budget $2000" |
| SC(3) | Globally entangled | Full agent | "Analyze market trends, cross with social sentiment, build predictive model" |
How It Works
SC-Router extracts 17 structural features from each query (analogous to the 17 features in IPS proof complexity), then classifies the routing difficulty using a threshold-based decision tree — no ML required.
The classification runs in <50ms and adds minimal overhead to any routing pipeline.
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sc_router-0.2.0.tar.gz.
File metadata
- Download URL: sc_router-0.2.0.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6bb1aa7c91adabddf9ecfd80bb9a2c9a5e8cb2cba00669b4285ba4ad97625b1
|
|
| MD5 |
9b4566428928438c1c8dac214c137b69
|
|
| BLAKE2b-256 |
142f7ba9c2370f8ab6d1fce619d6d52a9cf0aaa68888f73e822aada5a2803692
|
File details
Details for the file sc_router-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sc_router-0.2.0-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e818bc465809d7bdef88c4aecf80fc73f030f4af31930050bdd370c75fa638b
|
|
| MD5 |
5b209f76881d48ee1adff0d94866bda7
|
|
| BLAKE2b-256 |
8446643f31b0a65d5ec074992b1ad4e64a8f8fa65e47cc0682a4fc2a8b4bb6aa
|