Skip to main content

Myelin SDK

Procedural memory for AI agents. Agents that have done a task 100 times shouldn't fumble on attempt 101.

Claude Code

Zero-code integration via PostToolUse hooks.

1. Install the SDK

uv tool install myelin-sdk

2. Add the MCP server

claude mcp add --scope project --transport http myelin https://myelin.fly.dev/mcp \
  -H "Authorization: Bearer YOUR_API_KEY"

3. Add the PostToolUse hook

Add this to .claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "myelin-capture"
          }
        ]
      }
    ],
    "PostToolUseFailure": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "myelin-capture"
          }
        ]
      }
    ]
  }
}

Tip: If myelin-capture is not on your PATH, use python -m myelin_sdk.claude_code as the command instead.

4. Update .gitignore

Add .mcp.json to your .gitignore (it contains your API key).

The hook captures every tool call automatically. Use search to find workflows, record to begin a session, and finish to end it.

Python SDK / LangChain

Explicit integration for LangChain and LangGraph agents.

pip install myelin-sdk[langchain]
from myelin_sdk import MyelinSession

async with MyelinSession.create("handle support ticket", api_key="my_...") as session:
    handler = session.langchain_handler()

    # Pass handler to your LangChain agent
    result = await agent.ainvoke(
        {"messages": [{"role": "user", "content": "..."}]},
        config={"callbacks": [handler]},
    )
# session.finish() called automatically on exit

Adding an Integration

The integrations/langchain/ directory is the template for new integrations. To add support for another framework (e.g., CrewAI, AutoGen):

  1. Create src/myelin_sdk/integrations/<framework>/
  2. Add __init__.py and a handler module
  3. Use MyelinClient.capture() to record tool calls
  4. Add an optional dependency group in pyproject.toml
  5. Add a convenience method on MyelinSession

See integrations/langchain/handler.py for a complete reference implementation.

Syncing Local Procedures

Sync markdown procedure files from your repo to Myelin:

pip install myelin-sdk

# Sync all procedures from default directory (.claude/procedures/*.md)
myelin-sync

# Sync from a custom directory
myelin-sync --dir ./runbooks

# Sync specific files
myelin-sync deploy.md hotfix.md

Requires MYELIN_API_KEY, MYELIN_BASE_URL, and MYELIN_PROJECT_ID environment variables (or reads from .mcp.json).

Sync is idempotent — running twice with unchanged files produces no updates. Deleting a local file does not remove the server copy.

Release files for myelin-sdk 0.1.7

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

Source distribution (sdist)

Source distribution for myelin-sdk 0.1.7
File Size Uploaded
myelin_sdk-0.1.7.tar.gz 114.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for myelin-sdk 0.1.7
File Interpreter ABI Platform
myelin_sdk-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 143.6 kB

Release files / myelin_sdk-0.1.7.tar.gz

Download URL myelin_sdk-0.1.7.tar.gz
Size 114.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9a0dc48ceadd25e817fe0ab6aa05fa7ac83743a4bd253998008b2204c51bb91d
BLAKE2b-256 checksum
How to use checksums
390e162feabd39a20a4fb5d040cb5e96e44afed430f02a2c1c9dd7dfb01f5fb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

Release files / myelin_sdk-0.1.7-py3-none-any.whl

Download URL myelin_sdk-0.1.7-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82976cf131b5e4cb98ae1bb7bb7c007c3f30f730d74ab5f04d27afdc18c4b1bc
BLAKE2b-256 checksum
How to use checksums
1f0af0198e2ffe3cf0c7baa3ba4c13f2f5f64298a5486e289c6c637377c2c560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

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