PlanWise Router — intelligent tool routing layer for large tool catalogs
Project description
PlanWise Router
An intelligent tool-routing layer for large tool catalogs (60+ tools). Instead of showing an AI agent every tool schema — which wastes tokens and causes wrong picks between look-alike tools — PlanWise reads the user's query, writes a step-by-step plan, and hands the agent only the 3–6 tools it actually needs, in the right order.
Built for the Crest Data AI Innovation Challenge (Problem 02).
How it works (short version)
- Offline: every tool passes quality gates, gets ~8 LLM-written example user questions, and is indexed (embeddings + keywords). Twin tools are grouped; version families (v1/v2) are linked.
- Runtime: one cheap LLM call breaks the query into abstract steps (it never sees tool names, so it can't invent one). Each step finds its best tool with a 4-signal score: meaning match + keyword match + input fit + output fit (what the tool returns vs what the step needs — this is how same-input twins get told apart).
- Hand-off: the agent gets the few chosen tool schemas plus a plan hint like
Suggested plan: 1) get_revenue_report 2) generate_chart 3) send_email.
Full design: docs/HLD.md · docs/LLD.md · docs/architecture-diagram.html
Quick start
pip install -e ".[dev]" # or: pip install -e . for the minimal core
export $(grep -v '^#' .env | xargs) # if inside venv
# Route one query against the sample catalog
planwise route "Pull last quarter's revenue and email the chart to finance@corp.com"
# Run the evaluation harness (with the naive baseline to beat)
planwise eval --baseline
Works fully offline out of the box: with no gateway configured it uses a rule-based planner and lexical embeddings. For the real pipeline (LLM planner + semantic embeddings), point it at the Crest AWS Bedrock gateway (OpenAI-compatible):
pip install -e ".[llm,embeddings]"
export PLANWISE_LLM_API_KEY=sk-... # your gateway key
export PLANWISE_LLM_CERT=/path/to/apiproxy.cdsys.crt # internal-CA cert from IT
# must be on the Crest network / VPN
planwise eval --baseline
All LLM traffic goes through planwise/engine/llm.py (one place). The key and cert path come from the environment — never hardcoded or committed. Default models: Bedrock-ant-haiku-4-5-20251001-v1-0 for the planner/enrichment.
Layout
planwise/engine/— the routing engine (pure library: intake, index, planner, scorer, binder, assembler)planwise/middleware/— self-healing execution wrapper (Tier 2)planwise/server.py— HTTP gateway (Tier 1),planwise/mcp_server.py— MCP surface (Tier 3)eval/— evaluation harness, stress suites, baselinesdata/— sample catalog + ground-truth queries (replaced by the organizers' files at hackathon start)
Tests
python -m pytest tests/
Tests run deterministic and offline (hashing embeddings, rules planner) — no downloads, no API keys.
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 planwise-0.1.0.tar.gz.
File metadata
- Download URL: planwise-0.1.0.tar.gz
- Upload date:
- Size: 89.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bbc2ae4aa1e3d0fb98fe7fdbbcdde00309b6b86bb52c151a141c075b39f82fb
|
|
| MD5 |
7be4a01555f2ac4525c90a926e21a545
|
|
| BLAKE2b-256 |
e632539541c594ec3568f489368ce476108f262858dbdf7049eefd3efbfa439c
|
File details
Details for the file planwise-0.1.0-py3-none-any.whl.
File metadata
- Download URL: planwise-0.1.0-py3-none-any.whl
- Upload date:
- Size: 56.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c27c112d2fef05b588abfb735c644e79ef12a6722018a324adb7415e4626ef0b
|
|
| MD5 |
87649a692f197884c4aa2e3e77cfee0b
|
|
| BLAKE2b-256 |
2665334a655d57a15e701a639b75868c18840153e2bce6d3bc17e30de2917073
|