Find your next open-source project

Search by name, purpose, or keyword, or paste a GitHub URL. Start with / to search agent skills (e.g. /pdf)

JayLZhou/nano-ontology

AI EngineeringAgent frameworks

A YAML-defined ontology and action layer that enforces rules, approvals and read permissions for AI agents over MCP.

160
16
Python
MIT
8 days old

What it does

nano-onto is a Python engine that puts a governance layer between an AI agent and business data. You describe the domain in one YAML file: object types, links, typed actions, rules, approval requirements and read permissions. The engine executes each action as a single transaction — role gate, parameter checks, rules, approvals, effects and audit — instead of trusting the model's prompt to follow policy.

It is aimed at teams building agents that touch real business records (orders, suppliers, approvals) and need deterministic enforcement plus an audit trail. The same engine serves MCP over stdio and HTTP, a CLI, a Python API and a browser console, for agents such as Claude Desktop, Claude Code, Cursor or custom MCP clients.

Quick start

Requirements: Python 3.10 or newer; the only runtime dependency is PyYAML. Clone and install:

git clone https://github.com/JayLZhou/nano-ontology.git
cd nano-ontology
python -m pip install -e .

Run the bundled procurement demo, then initialize a database from the example ontology and try an action that exceeds a rule threshold:

export NANO_ONTO_SCHEMA=examples/procurement/ontology.yaml NANO_ONTO_DB=shop.db
nano-onto init --seed examples/procurement/seed.json
nano-onto run submit_purchase_order -p title=Servers -p amount=60000 -p supplier=S-002 --actor alice --role employee

The order is held as a pending request needing both the department manager and CFO, rather than created directly. To expose it to an agent, run nano-onto serve-mcp --actor alice --role employee or point Claude Desktop, Claude Code or Cursor at it using the configuration in Connect an agent. A full end-to-end flow, including approvals, permissions and audit, is available via bash examples/walkthrough.sh (walkthrough).

Constraints and limits

  • SQLite is the default store; PostgreSQL and DuckDB are optional extras installed with pip install -e ".[postgres]" or ".[duckdb]".
  • The actor identity is fixed when the MCP server starts; for multi-user HTTP serving you issue per-user tokens, and the token rather than the model decides who acts.
  • Rules use a small whitelisted expression language parsed with ast and are never eval'd; the whole ontology file is validated at load time.
  • The HTTP transport currently lacks OAuth and server-sent events; these are listed as roadmap items.
  • The reported benchmark is one small model on one small domain (81 episodes per arm) and is described by the project as a direction, not a leaderboard; an English-wording rerun is still pending.
  • Read-through onto existing tables and row filters pushed down to SQL are partial: SQL push-down and composite keys remain on the roadmap.

HotRepo's take

The project appeared on the new Python list on 2026-12-01, gaining 5 stars in roughly an hour between the tracked window start and observation, reaching 105 stars and 14 forks. No overall-language daily rank was recorded, so there is no broader ranking evidence yet. What stands out technically is the design choice to enforce policy outside the model and log refused attempts alongside successful ones, which is a concrete answer to prompt-only policy failure rather than a general agent framework. The self-reported benchmark direction (43% vs 0% rule violations) should be read with the project's own caveats about model and sample size.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

You might also like

  1. NVIDIA/auto-ontologyBuilds a certified semantic ontology from database metadata so text-to-SQL agents answer business questions with validated, explainable SQL.Python14,931
  2. gogoymh/auto-ontology-mcpAn MCP server that builds a semantic layer over databases and a notes knowledge base, answering questions with validated SQL.Python105
  3. openbkn-ai/bkn-foundryA backend foundation that models business semantics as ontologies and serves them to AI agents as governed context and executable actions.Go1,398
  4. docker/docker-agentDefine multi-agent setups in YAML, wire in MCP tools and any model provider, then run or share them via Docker.Go4,609
  5. andrewyng/openworkerA local-first desktop AI coworker with an SDK for building agentic apps, bringing your own models and approval-gated tools.Python19,160