Skip to content

Example and demo gallery

Use this page to choose the shortest runnable SchemaRouter path for the stack you already have. Examples are either offline deterministic or explicitly marked as live/pinned provider evidence.

SchemaRouter field-first, route-second scenario

Start from your existing stack

You have Example What it demonstrates
Provider name provider-first guide provider identity -> safe usable access methods
Python function typed callable typed local discovery + execution
SDK/client object SDK-bound demo explicit contract around opaque trusted runtime state
Many tools context reduction full catalog versus bounded Top-K retrieval
Multiple providers mixed-provider demo complementary semantic-field coverage
MCP stdio stdio quickstart real MCP subprocess discovery and execution
MCP Streamable HTTP reference smoke real SDK HTTP transport against a pinned server
OpenAPI URL live OpenAPI quickstart public provider discovery and execution
LangChain LangChain quickstart StructuredTool bridge
LangGraph LangGraph quickstart SchemaRouter as a graph node
LlamaIndex LlamaIndex quickstart FunctionTool bridge
Persisted registry/traces inspection dashboard live inspection + static HTML dashboard
Changing provider schema schema drift demo conservative compatibility classification
Typed execution state state-aware retrieval fixed Top-K filtering vs eligible Top-K corrective backfill
Large capability registry graph scalability guide indexed/incremental graph construction + benchmark
Portable graph files artifacts and snapshots inspect, validate, migrate versioned capability files
Decision observability decision trace guide privacy-safe candidate/exclusion/fallback explanation

The repository-level examples README contains the exact commands, optional extras, expected-output shapes, and evidence classification.

Real-provider paths

The user-facing quickstart uses APIs.guru because it is public, read-only, and needs no key:

python examples/live_openapi_quickstart.py

Provider-first acceptance additionally exercises Materials Project, Crossref, and Tavily:

python scripts/live_materials_project_provider_smoke.py
python scripts/live_crossref_provider_smoke.py
python scripts/live_tavily_provider_smoke.py

The Materials Project and Crossref paths execute real read-only provider queries. Tavily validates the auth contract without a secret and executes a real search when TAVILY_API_KEY is configured.

Additional public compatibility examples cover other protocol surfaces:

python scripts/live_graphql_smoke.py
python scripts/live_odata_smoke.py

The GraphQL example uses the Rick and Morty API; the OData example uses the OData.org V4 reference service. Materials-specific live evidence is available through COD OPTIMADE:

python scripts/live_optimade_smoke.py

Public-provider uptime is external state, so these paths are scheduled/manual compatibility evidence, not mandatory PR gates.

Pinned protocol references

When no stable unauthenticated public provider is appropriate, the repository uses a local reference implementation rather than pretending a fixture is live public evidence.

For MCP stdio:

pip install "schemarouter[mcp]"
python examples/mcp_stdio_quickstart.py

For MCP Streamable HTTP:

python scripts/live_reference_mcp_smoke.py

For OpenRPC / JSON-RPC:

python scripts/live_reference_openrpc_smoke.py

Before and after: avoid dumping every schema

Run:

python examples/context_reduction_demo.py

The example constructs a 40-tool registry and reports the serialized size of:

  • the complete registered tool catalog;
  • a bounded Top-3 CapabilityRetrieval result.

The bounded payload must be smaller, and the weather route must rank first for a weather query. This is a product demonstration, not a token benchmark: actual model-token measurements remain in the research benchmark suite.

Mixed-provider field-first planning

Run:

python examples/mixed_provider_demo.py

One provider declares band_gap; another declares document_abstract. The request asks for both and allows two calls. SchemaRouter compiles the semantic field need first and then selects complementary executable routes.

That is the same architecture used when one logical answer requires evidence from heterogeneous providers.

Schema drift and operational inspection

Run the offline drift classifier:

python examples/schema_drift_demo.py

Then use schema drift and compatibility for remote refresh/watch, pending review, explicit accept/reject, and fingerprint behavior.

For runtime observability:

python examples/inspection_dashboard.py

The example writes a static HTML dashboard from a real registry and trace store. The Capability Explorer provides the protocol-neutral Swagger-style view of registered capabilities.

CI and reproducibility

Mandatory CI runs deterministic examples with installed wheel/sdist artifacts. Optional integration jobs execute framework and MCP examples with the relevant extras. Live public providers stay in the separate compatibility workflow so external outages do not block a release.

Post-0.14 infrastructure checks

Provider-first acceptance, state-conditioned retrieval, graph scalability, versioned artifact/snapshot migration, and decision traces are additive infrastructure around the stable execution boundary.

Useful commands:

python scripts/live_materials_project_provider_smoke.py
python scripts/live_crossref_provider_smoke.py
python scripts/live_tavily_provider_smoke.py
python scripts/benchmark_capability_graph.py --sizes 1000,10000,50000

For persisted portable files:

schemarouter artifact inspect graph.json --json
schemarouter artifact migrate graph.json --json
schemarouter snapshot inspect snapshot.json --json
schemarouter snapshot migrate snapshot.json --json

Decision traces and typed-state retrieval are covered by focused guides rather than a second workflow runtime: state-aware retrieval · decision traces.