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

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.

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.7.tar.gz (114.9 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.7-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: myelin_sdk-0.1.7.tar.gz
  • Upload date:
  • Size: 114.9 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.7.tar.gz
Algorithm Hash digest
SHA256 9a0dc48ceadd25e817fe0ab6aa05fa7ac83743a4bd253998008b2204c51bb91d
MD5 375a04a5b23efa397c458ba3721ae856
BLAKE2b-256 390e162feabd39a20a4fb5d040cb5e96e44afed430f02a2c1c9dd7dfb01f5fb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for myelin_sdk-0.1.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: myelin_sdk-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 28.7 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 82976cf131b5e4cb98ae1bb7bb7c007c3f30f730d74ab5f04d27afdc18c4b1bc
MD5 b8b17a5c0f7a0e064ce852d168a4e542
BLAKE2b-256 1f0af0198e2ffe3cf0c7baa3ba4c13f2f5f64298a5486e289c6c637377c2c560

See more details on using hashes here.

Provenance

The following attestation bundles were made for myelin_sdk-0.1.7-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