Govern AI skill growth through intelligent merging of similar capabilities — no blocking, only consolidation. Built for LangChain, CrewAI, and custom agent systems.
Project description
AI Skill Governance
Govern AI skill growth through intelligent merging — not blocking.
Prevent skill bloat in AI agents by automatically detecting and merging similar capabilities while preserving functionality.
Support
If this project is useful to you, consider supporting development:
Why AI Skill Governance?
Modern AI agents can accumulate dozens or hundreds of skills. This leads to:
- Context dilution
- Slower reasoning
- Conflicting behaviors
- Maintenance nightmare
AI Skill Governance solves this by intelligently merging similar skills instead of arbitrarily limiting them.
Before / After
A support agent accumulates 12 skills over a few iterations. Many overlap.
| Cluster | Before | After |
|---|---|---|
| Greetings | greet, welcome, say_hi, hello_user |
greet |
| Refunds | refund, return_payment, issue_refund |
refund |
| Lookups | find_order, search_orders, get_order_by_id |
find_order |
| One-offs | escalate, close_ticket |
escalate, close_ticket |
| Total | 12 skills · ~840 tool-list tokens* | 5 skills · ~350 tokens |
→ 58% fewer skills. ~58% smaller tool-list prompt. Same coverage, faster tool selection, fewer conflicting behaviors.
*Illustrative. Tool-list tokens depend on serialization format (OpenAI function-calling schema, Anthropic tool blocks, etc.). The skill-count reduction is deterministic; token savings scale roughly with it.
Installation
pip install ai-skill-governance
For faster fuzzy matching:
pip install "ai-skill-governance[fuzzy]"
Quick Start
from ai_skill_governance import SkillRegistry
registry = SkillRegistry(default_threshold=0.75)
@registry.register(description="Sends a warm greeting")
def greet(name: str):
return f"Hello, {name}!"
@registry.register(description="Welcomes the user warmly")
def welcome(name: str):
return f"Welcome, {name}!"
# Check for suggested merges
print(registry.suggest_merges())
# Perform merge (v0.1.1: includes signature compatibility check)
merged = registry.perform_merge("greet", "welcome")
print(merged)
# Persistence (new in v0.1.1)
registry.save("my_skills.json")
registry.load("my_skills.json")
Advanced Merging
The merger creates a smart combined function that:
- Preserves the primary behavior
- Augments with secondary skill when signatures match
- Intelligently combines string/dict results
- Maintains full traceability
CLI
# Show status
skill-gov status --threshold 0.8
# Analyze and suggest merges
skill-gov merge --threshold 0.75
# Auto-merge similar skills
skill-gov merge --auto
Configuration
default_threshold: Similarity cutoff (0.0–1.0). Default: 0.75merge_mode:"suggest"(default) or"auto"
v0.3.0 New Features
Skill Graph Visualization
from ai_skill_governance import SkillRegistry, SkillGraph
reg = SkillRegistry()
# ... register skills ...
graph = SkillGraph(reg)
print(graph.to_ascii()) # Simple text view
dot = graph.to_dot("skills.dot") # Graphviz format
data = graph.to_json("graph.json") # For web dashboards
Semantic Merging (Major Upgrade)
pip install "ai-skill-governance[semantic]"
from ai_skill_governance import SkillRegistry
reg = SkillRegistry()
suggestions = reg.suggest_merges(method="semantic") # Uses embeddings when available
LangChain Integration
from ai_skill_governance.integrations.langchain import LangChainSkillGovernor
governor = LangChainSkillGovernor()
# Use @governor.register_tool on your LangChain @tool functions
CrewAI Integration
from ai_skill_governance.integrations.crewai import CrewAISkillGovernor
PyPI Release Notes
This package is fully prepared for PyPI publication with:
- Modern
pyproject.toml - Proper metadata and classifiers
- Optional dependencies (
fuzzyfor rapidfuzz) - Comprehensive documentation
- MIT License
Contributing
We welcome contributions that improve merging intelligence, add new similarity methods, or enhance the governance dashboard.
License
MIT License — see LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_skill_governance-0.3.0.tar.gz.
File metadata
- Download URL: ai_skill_governance-0.3.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e20aab692eaf4c8457df0a184afa38fabefe7ab7722ca13c05981aecdcf0b7
|
|
| MD5 |
0841cd880a3e08f8679c69ab77bcb8aa
|
|
| BLAKE2b-256 |
0f4cf75f6056cc508d5a8c916891a237156a508d1e7ee64d2ce7cfb01ffb78f1
|
File details
Details for the file ai_skill_governance-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ai_skill_governance-0.3.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cda1803984ec949affee4c2520dce170a66fa8c37db9e307d2f8eb87d857327
|
|
| MD5 |
10db3958a7c235006f3767edcfe2b7d6
|
|
| BLAKE2b-256 |
32e2fbcbac373b0b93a534e26fe80cc4fe009d1be56476cf499211e41b14d81c
|