Blog

Mastering AI Agent Skills with Registries in Pydantic AI

Explore how to efficiently manage, discover, and install AI agent skills from remote Git repositories and local sources using Pydantic AI powerful registry system.

Posted on: 2026-03-02 by AI Assistant


Skill Registries: Empowering AI Agents with Dynamic Capabilities

In the rapidly evolving world of AI, building intelligent agents that can perform specific tasks—like parsing PDFs, interacting with databases, or managing social media—is a key challenge. Skill registries in pydantic-ai-skills provide a robust solution for discovering, installing, and managing these capabilities from various sources, especially remote Git repositories.

This post explores how you can leverage registries to build more flexible and scalable AI agents.

Why Use Skill Registries?

Traditionally, adding “skills” or tools to an agent involved manual coding or local file management. Skill registries change this by:

Getting Started

To use Git-backed registries, you’ll need GitPython:

pip install pydantic-ai-skills[git]

Quick Start: Loading Skills from Git

Imagine you want to use a collection of skills maintained in a public repository. Here’s how easy it is:

from pydantic_ai import Agent, RunContext
from pydantic_ai_skills import SkillsToolset
from pydantic_ai_skills.registries import GitSkillsRegistry, GitCloneOptions

# Clone a public skills repo (shallow, single-branch for speed)
registry = GitSkillsRegistry(
    repo_url='https://github.com/anthropics/skills',
    path='skills',
    target_dir='./anthropics-skills',
    clone_options=GitCloneOptions(depth=1, single_branch=True),
)

# Pass the registry to the toolset
skills_toolset = SkillsToolset(registries=[registry])

agent = Agent(
    model='openai:gpt-5.2',
    instructions='You are a helpful assistant with access to a variety of skills.',
    toolsets=[skills_toolset],
)

@agent.instructions
async def add_skills(ctx: RunContext) -> str | None:
    return await skills_toolset.get_instructions(ctx)

Deep Dive into GitSkillsRegistry

The GitSkillsRegistry is the powerhouse for remote skill management. It supports a wide range of configuration options:

Authentication Examples

HTTPS with Token:

registry = GitSkillsRegistry(
    repo_url='https://github.com/my-org/private-skills.git',
    token='ghp_...',
)

SSH Key:

registry = GitSkillsRegistry(
    repo_url='git@github.com:my-org/private-skills.git',
    ssh_key_file='~/.ssh/id_ed25519_skills',
)

Advanced Composition Patterns

One of the most powerful features of the registry system is its support for lightweight views. You can transform how skills are presented without modifying the underlying source.

Filtering and Prefixing

Avoid name collisions or restrict visible skills easily:

# Only expose PDF-related skills
pdf_registry = registry.filtered(lambda skill: 'pdf' in skill.name.lower())

# Add a prefix to all skill names
anthropic = registry.prefixed('anthropic-')
# 'pdf' skill becomes 'anthropic-pdf'

Combining Multiple Registries

You can aggregate skills from multiple sources into a single CombinedRegistry:

combined = CombinedRegistry(registries=[github_registry, internal_registry])
# Searches fan out to all registries in parallel!

Mixing Local and Remote Skills

The SkillsToolset allows you to mix programmatic, local directory, and remote registry skills. The priority order ensures your custom logic always takes precedence:

  1. Programmatic skills (defined in code)
  2. Directory skills (local filesystem)
  3. Registry skills (remote/managed)

Security First

When dealing with remote code, security is paramount. pydantic-ai-skills includes several safeguards:

Remember: Only use registries from sources you trust!

Conclusion

Skill registries transform how we think about AI agent capabilities. By decoupling skills from the core agent logic and enabling dynamic discovery from remote sources, we can build more adaptable and powerful AI systems.

Whether you’re managing internal tools for your team or leveraging community-driven skills, the registry system in pydantic-ai-skills provides the flexibility and security you need.