Skip to main content

SynaptoRoute

A high-throughput semantic router for AI agents and LLM applications.

Python 3.10+ License: MIT PyPI Version CI Build


What is SynaptoRoute?

SynaptoRoute is an adaptive control plane designed to sit at the edge of your infrastructure. It intercepts natural language queries and deterministically routes them to predefined system actions, APIs, or workflows based on semantic meaning.

It is not a large language model (LLM). It is a highly optimized mathematical routing engine.

Instead of relying on expensive and comparatively slow LLM generations to infer user intent, SynaptoRoute calculates intent locally using dense vector embeddings. If a query matches a known workflow (e.g., billing inquiries or password resets), SynaptoRoute triggers the action immediately, bypassing the LLM entirely.

Why use SynaptoRoute?

  • Low Latency: Achieves 3.0ms P95 worst-case retrieval latency on a 1,000,000 vector index.
  • Zero-Cost Routing: Defaults to FastEmbedEncoder for zero-overhead, local vector generation on the CPU, avoiding external API token costs.
  • Dynamically Mutable: Routes can be added, updated, or deleted in memory without requiring a server restart, safely executing under heavy load.
  • Persistent Storage: All routing logic is persisted to an embedded SQLite database using Write-Ahead Logging (WAL) for robust state recovery.
  • Framework Integration: Includes native integrations for LangChain and LlamaIndex to serve as a deterministic tool-selector.

Quickstart

Installation

pip install synaptoroute

Usage Example

import asyncio
from synaptoroute import AdaptiveRouter, Route

async def main():
    # 1. Initialize the router (defaults to local FastEmbed models)
    router = AdaptiveRouter()
    
    # 2. Define workflows (routes)
    billing_route = Route(
        name="billing_inquiry",
        utterances=["how much do I owe?", "view my invoice", "payment history"],
        threshold=0.85
    )
    password_route = Route(
        name="password_reset",
        utterances=["I forgot my password", "reset password", "can't log in"],
        threshold=0.85
    )
    
    # 3. Add routes and start the engine
    router.add_route(billing_route)
    router.add_route(password_route)
    await router.start()
    
    # 4. Route incoming user queries
    match = await router.aquery("Where is my latest bill?")
    
    if match and match.name == "billing_inquiry":
        print("Triggering the billing workflow.")
    else:
        print("Falling back to standard LLM generation.")

asyncio.run(main())

Architecture Design

SynaptoRoute separates concerns across strict boundary layers to guarantee stability under concurrent load:

graph TD
    Client["Incoming Query / Mutation"] --> Router["AdaptiveRouter"]
    
    subgraph Core Engine
        Router -- "1. Vectorizes text" --> Encoder["FastEmbedEncoder"]
        Router -- "2. Semantic distance search" --> Index["FaissIndex"]
    end
    
    subgraph Data & Sync
        Router -- "3. Durable WAL persistence" --> Storage[("SQLiteStorage")]
        Router -- "4. Incremental broadcast" --> Sync["RedisSyncManager"]
        Sync -.-> Cluster["Peer Nodes"]
    end

For a detailed breakdown of subsystem ownership and failure domains, refer to the Architecture Documentation.


Engineering Integrity

SynaptoRoute bases its claims strictly on automated, reproducible telemetry located in BENCHMARK_REGISTRY.md.

  • Mathematical Honesty: During the v0.3.0 architectural transition, independent benchmark audits uncovered a telemetry unit conversion bug regarding latency claims. The prior benchmarks were formally retracted, and a strict registry was created to hold unalterable telemetry data.
  • Production Readiness: Single-node deployments utilizing local SQLite and FAISS memory boundaries are fully concurrent-safe and ready for production use.
  • Distributed Sync Limitations: Enterprise-scale deployments (>5 nodes) using Redis PubSub currently face O(N×M) network bottlenecks during cold-boot synchronization. We recommend multi-node deployments for staging only until the integration of a durable external ledger is complete.

Developer Resources

Metadata

Release files for synaptoroute 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for synaptoroute 0.4.1
File Size Uploaded Provenance
synaptoroute-0.4.1.tar.gz 12.0 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for synaptoroute 0.4.1
File Interpreter ABI Platform
synaptoroute-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 MB

Release files / synaptoroute-0.4.1.tar.gz

Download URL synaptoroute-0.4.1.tar.gz
Size 12.0 MB
Tags Source
SHA-256 checksum
How to use checksums
81db0c4021bb551a3d55592b5a3b27514600562639afa6b14c8ddfc650997d88
BLAKE2b-256 checksum
How to use checksums
487bc5e5a9e68ffe54e62469a21c2c87d76210cc2533217a491781556e39ec9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release files / synaptoroute-0.4.1-py3-none-any.whl

Download URL synaptoroute-0.4.1-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c15063903c3e120a3f1d9cc8cf250eeccc67265de93c5ef0110b2260741ac4e0
BLAKE2b-256 checksum
How to use checksums
18f36b3d96003c93fe32a4c262b7ece5890bd6cda7a9cb6953090c9fd0fbe656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Security for synaptoroute 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for synaptoroute-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page