Skip to main content

Skills Graph

Store reusable Agent Skills in Memgraph and track which sessions and subagents use them.

Part of Context Graph. For automatic capture in a coding agent, use the Context Graph installer. The Python API below lets you manage skill definitions directly.

Installation

pip install skills-graph
# With the runtime connector:
pip install 'skills-graph[memgraph-context-graph]'

Requires a running Memgraph, defaulting to bolt://localhost:7687. Direct Python use reads MEMGRAPH_URL, MEMGRAPH_USER, and MEMGRAPH_PASSWORD; hook integrations read the Context Graph config file.

Quick start

from skills_graph import SkillGraph, Skill

sg = SkillGraph()
sg.setup()

sg.add_skill(
    Skill(
        name="memgraph-cypher",
        description="Writing Cypher queries for Memgraph",
        content="# Cypher for Memgraph\n\nUse MATCH, CREATE, MERGE ...",
    )
)

skill = sg.get_skill("memgraph-cypher")

sg.search_by_name("memgraph")

all_skills = sg.list_skills()

sg.update_skill("memgraph-cypher", content="updated content")

sg.delete_skill("memgraph-cypher")

Skill names use 1–64 lowercase letters, digits, or hyphens, with no leading, trailing, or consecutive hyphens. Invalid names raise SkillValidationError.

Track usage automatically

Wire SkillGraphConnector into an AgentLink and skill usage is recorded automatically from any runtime adapter's event stream (Claude Code, Codex, OpenAI SDK):

from skills_graph import SkillGraph
from skills_graph.connector import SkillGraphConnector
from memgraph_context_graph import AgentLink

link = AgentLink()
skills = SkillGraph()
skills.setup()
link.add_connector(SkillGraphConnector(skills))

For SDK application wiring, see the SDK quick starts.

The connector detects skill usage from TOOL_START/TOOL_END/MESSAGE events — direct tool names like get_skill, MCP-style names like mcp__skills__get_skill, Claude Code's Skill tool, and reads of an Agent Skills definition (.../skills/<name>/SKILL.md) by a file-read tool or a read program such as cat or sed, which covers runtimes where using a skill appears as a file read rather than a dedicated tool call. A SKILL.md that is only mentioned, staged, searched or written is not usage, and neither is other Markdown with skill-like frontmatter. Search/list results that surface skill objects are also recorded through USED_SKILL.

Graph model

(:Skill {name, description, content, license, compatibility,
         allowed_tools, metadata, created_at, updated_at, source_path?})
(:Skill)-[:DEPENDS_ON]->(:Skill)
(:Session|:Agent)-[:USED_SKILL {first_access, last_access, access_count, actions}]->(:Skill)

USED_SKILL starts at the subagent's (:Agent) when actions-graph has created it, otherwise at a MERGE (:Session {session_id}) — skills-graph MERGEs the shared Session node it does not own (see the Context Graph map). source_path is set only when a skill is created by observing a local SKILL.md read.

Dependencies between stored skills use sg.add_dependency(skill_name, depends_on) and sg.get_dependencies(skill_name).

Development

From the repository root:

./scripts/dev-memgraph.sh test skills-graph

Metadata

Release files for skills-graph 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skills-graph 0.4.0
File Size Uploaded Provenance Actions
skills_graph-0.4.0.tar.gz 24.6 kB Without provenance Details for skills_graph-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skills-graph 0.4.0
File Interpreter ABI Platform Actions
skills_graph-0.4.0-py3-none-any.whl Python 3 none any Details for skills_graph-0.4.0-py3-none-any.whl

Total release size: 39.0 kB

Release files / skills_graph-0.4.0.tar.gz

Download URL skills_graph-0.4.0.tar.gz
Size 24.6 kB
Tags Source
SHA-256 checksum
How to use checksums
37b91b84a0226b5fd51ce98b06c55b7fa478df2e4698f8fd7b6af6c18330c90d
BLAKE2b-256 checksum
How to use checksums
62ff561b3921677e693a14edf2f7f1f2e18b1cea5e731ae6ac2d05d20bc8f7a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / skills_graph-0.4.0-py3-none-any.whl

Download URL skills_graph-0.4.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a421018c699c19aae9f6f82efd6bbac511fed9e54e9f8ecd7590ade9bb4e41fb
BLAKE2b-256 checksum
How to use checksums
ef10d68c91c8eb78f018499b5242ee9482ff6cc70cd12f21e418ec58e52a0cfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for skills-graph 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page