Catalog PyPI
Back to packageRELEASE DETAILS

0.1.0

PyPI

agentic-router

Agentic LLM router for classification and decision making.

Published11 Mar 2026
Direct dependencies2
Transitive dependenciesNot calculated

README

Version 0.1.0 documentation

Agentic Router

Agentic Router is a domain-agnostic, zero-shot classification and routing engine designed for modern LLM applications.

Instead of writing rigid if/else statements or hardcoding API logic, Agentic Router allows you to define complex routing topologies and classification guardrails using simple Python dictionaries and arrays. It dynamically compiles these into robust framework-agnostic prompts to intelligently route user queries to the correct database or pipeline.

Features

  • 🛣️ Dynamic Topologies: Route natural language queries across various workflows (e.g., Vector DB vs Graph DB vs SQL) by passing a simple dictionary of rules.
  • 🛡️ Custom Classification: Inject arbitrary categories and guardrails (e.g., PII detection, Sentiment Analysis) into the agent's decision-making pipeline on the fly.
  • 🔌 Model Agnostic: Built on top of LlamaIndex. Inject an OpenAI, Gemini, or even a local Ollama model directly into the constructor.

Installation

pip install agentic-router

Quick Start

1. Dynamic Query Routing

Define your project's unique routing rules, and the Agent will dynamically strictly enforce them:

from agentic_router import AgenticRouter
from llama_index.llms.openai import OpenAI

llm = OpenAI(model="gpt-4o")
router = AgenticRouter(llm=llm)

# A Customer Support topology
support_topology = {
    "Tech_Support": "User is asking about a software bug or failure.",
    "Billing": "User is asking about refunds or credit cards."
}

route = router.route_query(
    query="I was charged twice on my visa.", 
    topology=support_topology, 
    fallback="Tech_Support"
)
print(route)  # Output: Billing

2. Custom Classification & Guardrails

Classify inputs on the fly strictly adhering to your defined arrays:

# A tabletop RPG setting
rpg_vibes = ["Ominous", "Peaceful", "Combat", "Tavern"]
query = "The floorboards creak as three figures step out of the shadows with drawn daggers."

vibe = router.classify_vibe(query=query, valid_vibes=rpg_vibes)
print(vibe)  # Output: Ominous

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
llama-index-core
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
llama-index-core>=0.11.0runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.11",
  "evaluation": "NOT_EVALUATED"
}
pytest; extra == "dev"runtime

Distribution files

2 collected
agentic_router-0.1.0-py3-none-any.whl

bdist_wheel · 4.28 KB · Python py3

Source file
agentic_router-0.1.0.tar.gz

sdist · 4.57 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:21 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:781fe4f473876577844eb47b9b2e5c752003175ee05d8874d2a8d4ce235a37dd

Other collected versions

View all collected versions →