Skip to main content

A retrieval-gated skill architecture for LLM agents that scales to hundreds of tools by exposing only the top-K relevant capabilities per request.

Project description

SkillMesh

CI License: MIT Python 3.10+

Stop stuffing hundreds of tools into your LLM prompt. Route to the right ones.

The Problem

LLM agents break when you load every tool into the prompt. Token counts explode, accuracy drops, and cost scales linearly with your catalog size. Teams with 50+ skills end up with bloated system prompts that confuse the model and burn budget.

SkillMesh solves this with retrieval-based routing: given a user query, it selects only the top-K most relevant expert cards and injects them into the prompt — keeping context small, accurate, and cheap.

Before vs After

Without SkillMesh With SkillMesh
Prompt tokens ~50,000+ (all tools loaded) ~3,000 (top-K only)
Tool selection Model guesses from a huge list BM25+Dense retrieval picks the best match
Cost per call High (full catalog every time) Low (only relevant cards)
Accuracy Degrades as catalog grows Stays consistent
Multi-domain tasks Confusing for the model Routed precisely (clean + train + deploy)

How It Works

User Query
    │
    ▼
┌─────────────────────┐
│  BM25 + Dense Index  │  ← Scores every card in your registry
└─────────┬───────────┘
          │
          ▼
┌─────────────────────┐
│   RRF Fusion Rank    │  ← Merges sparse + dense rankings
└─────────┬───────────┘
          │
          ▼
┌─────────────────────┐
│   Top-K Card Select  │  ← Returns the K best expert cards
└─────────┬───────────┘
          │
          ▼
┌─────────────────────┐
│  Agent acts as expert │  ← Full instructions injected into prompt
└─────────────────────┘

Each card contains: execution behavior, decision trees, anti-patterns, output contracts, and composability hints — everything the agent needs to act as a domain expert.

One-line MCP install (Claude Desktop / Claude Code)

Add this to your Claude Desktop config (claude_desktop_config.json) or Claude Code MCP settings:

{
  "mcpServers": {
    "skillmesh": {
      "command": "uvx",
      "args": ["--from", "skillmesh[mcp]", "skillmesh-mcp"]
    }
  }
}

No env vars. No file paths. No cloning. The bundled registry is included in the package.

Requires uv to be installed.

60-Second Demo

git clone https://github.com/varunreddy/SkillMesh.git
cd SkillMesh
pip install -e .
skillmesh emit \
  --provider claude \
  --registry examples/registry/tools.json \
  --query "clean messy sales data, train a baseline model, and generate charts" \
  --top-k 5

Output (truncated):

<context>
  <card id="data.data-cleaning" title="Data Cleaning and Validation Expert">
    # Data Cleaning and Validation Expert
    Specialist in detecting and correcting data quality issues...
  </card>
  <card id="ml.sklearn-modeling" title="Scikit-learn Modeling and Evaluation">
    ...
  </card>
  <card id="viz.matplotlib-seaborn" title="Visualization with Matplotlib and Seaborn">
    ...
  </card>
</context>

Only the relevant experts are injected — the rest of the 90+ card catalog stays out of the prompt.

Integrations

Platform Method Status Docs
Claude Code MCP server Supported Setup guide
Claude Desktop MCP server Supported Setup guide
Codex Skill bundle Supported Setup guide

Claude MCP Server

The easiest way to run it is via uvx (see "One-line MCP install" above). For local development:

pip install -e .[mcp]
skillmesh-mcp

The server auto-discovers the registry: env var SKILLMESH_REGISTRY → repo root → bundled registry.

Exposes two tools via MCP:

  • route_with_skillmesh(query, top_k) — provider-formatted context block
  • retrieve_skillmesh_cards(query, top_k) — structured JSON payload

Copy-ready config templates in examples/mcp/.

Codex Skill Bundle

$skill-installer install https://github.com/varunreddy/SkillMesh/tree/main/skills/skillmesh

Quickstart

Install

python -m venv .venv && source .venv/bin/activate
pip install -e .[dev]

Optional extras:

pip install -e .[dense]   # Dense reranking with sentence-transformers
pip install -e .[mcp]     # Claude MCP server

Retrieve top-K cards

skillmesh retrieve \
  --registry examples/registry/tools.json \
  --query "set up nginx reverse proxy with SSL" \
  --top-k 3

Emit provider-ready context

skillmesh emit \
  --provider claude \
  --registry examples/registry/tools.json \
  --query "deploy container to GCP Cloud Run" \
  --top-k 5

Curated Registries

Use domain-specific registries for tighter routing:

Registry Domain Cards
tools.json / tools.yaml Full catalog 90+
ml-engineering.registry.yaml ML training & evaluation 15
data-engineering.registry.yaml Pipelines & data platforms 10
bi-analytics.registry.yaml BI & dashboards 10
devops.registry.yaml DevOps & infrastructure 8
web-apis.registry.yaml API design & patterns 7
cloud-gcp.registry.yaml Google Cloud Platform 7
cloud-bi.registry.yaml Cloud BI 5
roles.registry.yaml Role orchestrators 10
skillmesh emit \
  --provider claude \
  --registry examples/registry/devops.registry.yaml \
  --query "configure prometheus alerting and grafana dashboards" \
  --top-k 3

CLI Commands

Command Description
skillmesh retrieve Top-K retrieval payload (JSON)
skillmesh emit Provider-formatted context block
skillmesh index Index registry into Chroma for persistent retrieval
skillmesh-mcp Stdio MCP server for Claude
skillmesh --help

Repository Layout

src/skill_registry_rag/
├── models.py          # Tool/role card models
├── registry.py        # Registry loading + validation
├── retriever.py       # BM25 + optional dense retrieval
├── adapters/          # Provider formatters (codex, claude)
└── cli.py             # skillmesh CLI

examples/registry/
├── tools.json         # Full tool catalog
├── tools.yaml         # YAML version of full catalog
├── instructions/      # Expert instruction files (90+)
├── roles/             # Role orchestrator files
└── *.registry.yaml    # Domain-specific registries

skills/skillmesh/      # Codex-installable skill

Contributing

See CONTRIBUTING.md for how to add expert cards, create registries, and submit PRs.

Troubleshooting

skillmesh: command not found

pip install -e .

Missing registry path

The CLI and MCP server auto-discover the registry. If auto-discovery fails, pass --registry or set:

export SKILLMESH_REGISTRY=/path/to/tools.json
# or pass --registry on every command

skillmesh-mcp fails to start

pip install -e .[mcp]

Codex does not detect new skill

Restart Codex after running $skill-installer.

Development

ruff check src tests
pytest

License

MIT — see LICENSE.


If SkillMesh helps your team, please star the repo — it directly improves discoverability and helps others find the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skillmesh-0.1.0.tar.gz (187.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skillmesh-0.1.0-py3-none-any.whl (186.3 kB view details)

Uploaded Python 3

File details

Details for the file skillmesh-0.1.0.tar.gz.

File metadata

  • Download URL: skillmesh-0.1.0.tar.gz
  • Upload date:
  • Size: 187.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for skillmesh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 85ad1e3648a63eabba3ea8b06a9df21cf7685d351de455e22af3e98d5d6985f9
MD5 c6e23d9c44a20edb2833f2adb1f0168e
BLAKE2b-256 3c41c11d213c5b7b80ebab0fb127ff30b422c690720fe873306270c158981616

See more details on using hashes here.

Provenance

The following attestation bundles were made for skillmesh-0.1.0.tar.gz:

Publisher: publish.yml on varunreddy/SkillMesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file skillmesh-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: skillmesh-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 186.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for skillmesh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d599b723904b7561fdb43b2980a2c8af923a26200bf4752510561218a924c550
MD5 57cb44cf570dd044512843bd5526af17
BLAKE2b-256 c28d1213e7e28b275473d9e91fc325949ec89a3930ace522bbe754a15e91cf36

See more details on using hashes here.

Provenance

The following attestation bundles were made for skillmesh-0.1.0-py3-none-any.whl:

Publisher: publish.yml on varunreddy/SkillMesh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page