Skip to main content

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

Project description

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"
          }
        ]
      }
    ]
  }
}

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.

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

myelin_sdk-0.1.5.tar.gz (114.4 kB view details)

Uploaded Source

Built Distribution

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

myelin_sdk-0.1.5-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file myelin_sdk-0.1.5.tar.gz.

File metadata

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

File hashes

Hashes for myelin_sdk-0.1.5.tar.gz
Algorithm Hash digest
SHA256 379ee78b349fd7d734531ab9338933eb132831b0ddd262539a43020b72e993e8
MD5 fecb0b10e1cf5656620e2166d0af513e
BLAKE2b-256 737c150b6685fb48f19b9200b81470757d5f90b6cc1dfcb91bfec104fbb36369

See more details on using hashes here.

Provenance

The following attestation bundles were made for myelin_sdk-0.1.5.tar.gz:

Publisher: ci.yml on yahnyshc/myelin-sdk

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

File details

Details for the file myelin_sdk-0.1.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for myelin_sdk-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bd029ef1f87831735d6748b0a887892681a9506d514066bcd919c0e5c5072a92
MD5 53d9038f1ae70b1f28669854e5e03ab7
BLAKE2b-256 4d159a33134694d7c7f58520279a0ebb506cae42941fe692005d0c5dc7ece75b

See more details on using hashes here.

Provenance

The following attestation bundles were made for myelin_sdk-0.1.5-py3-none-any.whl:

Publisher: ci.yml on yahnyshc/myelin-sdk

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