Skip to main content

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

sc_router-0.1.0.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

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

sc_router-0.1.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file sc_router-0.1.0.tar.gz.

File metadata

  • Download URL: sc_router-0.1.0.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sc_router-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c05f797d8623b9df8ebdf7df5b0bd28b6b131f19c32b2379b9d4ee802e73f565
MD5 289c6508b8f63ac017d90291cf24b69b
BLAKE2b-256 1426bcc4be91f83ab86ec66820fa65976333afe64eaca7eedd1ebf0c7e16c4ba

See more details on using hashes here.

File details

Details for the file sc_router-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sc_router-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sc_router-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa5968f2f2263de1fcdd36c5aa2565486be98adb442e08691cacfdece8e71151
MD5 696d005ab406afae3700be05e0ff6279
BLAKE2b-256 fae8f8ff78af355afff7adfcd34e4678d2685a79a55b2cc542451c6b15e515eb

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