Partner plugin application: schemagate schema selection (nemo-agent-toolkit-schemagate)

Open Beginner friendly
#2,531 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
85/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

Locate the README and the third-party plugins doc (docs/source/extend/third-party-plugins.md). Add nemo-agent-toolkit-schemagate to the list of externally managed plugins in the README, matching the existing format. Done when the entry appears and docs build cleanly.

Written by the indexing model from the issue text.

Description

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request

Medium

Please provide a clear description of problem this feature solves

I maintain schemagate, an open-source (Apache-2.0) library for text-to-SQL agents. I'd like to apply for the provider-owned plugin path described in the third-party plugin guide, starting at the Listed tier.

A text-to-SQL agent usually puts the whole schema, or a similarity-ranked slice of it, in the prompt, and it decides that before anything checks what the caller may read. schemagate reflects the database once (structure only, never rows), and for each question selects the few tables and views it needs from the ones the caller's roles may read, adding the join tables the question never names. A restricted table is never a candidate, so it is absent from the prompt rather than ranked low. Selection runs locally and calls no model.

The package adds a function group, _type: schemagate, exposing schemagate__select (question in, compact DDL out) and schemagate__list_objects, and a native retriever, _type: schemagate, usable with nat_retriever and builder.get_retriever. The caller's principal and roles are configuration, not tool arguments, so an agent cannot grant itself a role.

Results and adoption so far:

  • Saves prompt tokens: on Spider 2.0-lite's BigQuery and Snowflake warehouses with 50+ tables, the median prompt is 91% smaller than sending the full schema (about 1,700 tokens against about 56,000), and selection itself makes no model call. Method and per-question results.
  • Accuracy: #1 on BIRD's official Mini-Dev leaderboard in all three dialects (SQLite 81.0, PostgreSQL 72.6, MySQL 72.4): https://bird-bench.github.io/
  • LangChain: langchain-schemagate is listed in LangChain's official integrations docs: https://docs.langchain.com/oss/python/integrations/retrievers
  • Listed in the Official MCP Registry (io.github.ashishsinha1602/schemagate) and the DuckDB community list; about 7,000 PyPI downloads a month for schemagate (excluding mirrors).
Describe your ideal solution

List nemo-agent-toolkit-schemagate in the NeMo Agent Toolkit third-party plugin documentation. I'm happy to open the documentation PR myself, adding schemagate to the README's list of externally managed plugins.

Submission details

Item Value
Provider schemagate (Ashish Sinha)
Package scope Function group (FunctionGroupBaseConfig, register_function_group) and retriever (RetrieverBaseConfig, register_retriever_provider, register_retriever_client, native Retriever)
License Apache-2.0
Repository https://github.com/ashishsinha1602/NeMo-Agent-Toolkit-schemagate
PyPI package nemo-agent-toolkit-schemagate 0.1.0
Import package nemo_agent_toolkit_schemagate (top-level, not under nat., following the feedback on #2333 that nat.plugins is reserved for the toolkit's own plugins)
Entry point [project.entry-points."nat.plugins"] nat_schemagate = "nemo_agent_toolkit_schemagate.register"
Registered _type schemagate (function group), schemagate (retriever provider and client)
Tool names <instance>__select, <instance>__list_objects
nvidia-nat-core range >=1.8,<2
Python 3.11, 3.12, 3.13
Support contacts issues at https://github.com/ashishsinha1602/NeMo-Agent-Toolkit-schemagate/issues; security reports per https://github.com/ashishsinha1602/schemagate/blob/main/SECURITY.md

Submission checklist

  • Repository and package names follow the naming convention (NeMo-Agent-Toolkit-schemagate, nemo-agent-toolkit-schemagate, nat_schemagate, _type: schemagate). The import package is nemo_agent_toolkit_schemagate rather than nat.plugins.schemagate, per the #2333 feedback.
  • nat.plugins entry point.
  • Public imports come only from nat.plugin_api (Builder, FunctionGroup, FunctionGroupBaseConfig, SerializableSecretStr, register_function_group, Retriever, RetrieverBaseConfig, RetrieverOutput, Document, RetrieverProviderInfo, register_retriever_provider, register_retriever_client). Tests additionally use WorkflowBuilder, the loader and nat.test.tool_test_runner.
  • nvidia-nat-core is a required dependency, bounded >=1.8,<2.
  • Apache-2.0 license.
  • README covers installation (uv and pip), configuration fields and defaults, credential handling (the database URL is a secret field), a workflow example, the registered _type values and tool names, supported versions, local test commands, and bug routing between the plugin and nvidia-nat-core.
  • Tests, with no network, database or API key (they use schemagate's bundled SQLite demo schema):
    • Unit tests for the selection logic, including that a table restricted to a role the caller lacks never reaches the prompt.
    • A loader smoke test: the entry point loads, discover_and_register_plugins registers the function group and the retriever, YAML config selects them, and WorkflowBuilder builds both.
    • Function-group tool tests through nvidia-nat-test (ToolTestRunner).
    • examples/config_ollama.yml wires the function group into a react_agent on a local OpenAI-compatible server; the tool calls work there, though a 3B local model does not always finish the answer, so the README example uses NIM.
    • Verified from the published wheel: a fresh pip install nemo-agent-toolkit-schemagate (0.1.0, with nvidia-nat-core 1.9.0) registers the function group and the retriever.
  • Compatibility CI against the last two toolkit minor releases: ci.yml runs Python 3.11 with nvidia-nat-core 1.8.0 and Python 3.13 with 1.9.0: a registry-based discovery check and the unit and loader tests, on every push and PR.

Minimal workflow

function_groups:
  schemagate:
    _type: schemagate
    database_url: demo   # schemagate's bundled SQLite schema; or any SQLAlchemy URL
    top_k: 6

llms:
  nim_llm:
    _type: nim
    model_name: meta/llama-3.3-70b-instruct

workflow:
  _type: react_agent
  llm_name: nim_llm
  tool_names: [schemagate]
pip install nemo-agent-toolkit-schemagate nvidia-nat-langchain
export NVIDIA_API_KEY=...
nat run --config_file config.yml --input "Which tables do I need for late shipments by carrier?"
Additional context
Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I have searched the open feature requests and have found no duplicates for this feature request
Dominant language
Python
Stars
2.7k
Forks
814
Avg merge
1d 10h
Merged PRs (30d)
128

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/NeMo-Agent-Toolkit

All issues in NVIDIA/NeMo-Agent-Toolkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.