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

pip 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": "python3 -m myelin_sdk.claude_code"
          }
        ]
      }
    ]
  }
}

4. Update .gitignore

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

The hook captures every tool call automatically. Use memory.recall and memory.finish MCP tools to start and end sessions.

Python SDK / LangChain

Explicit integration for LangChain and LangGraph agents.

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

async with MyelinSession.start("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.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: myelin_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 103.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for myelin_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4dcf38a44befa7d71794c046a9ade29fbcfc35971ce7dff7dbfadcb7fc1437db
MD5 01343f3fb1e84c9123ed7e8cf85f391e
BLAKE2b-256 ce5e0711f3da104fb27f42681530cc63a216e2df5f322505e7784eb955a54496

See more details on using hashes here.

File details

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

File metadata

  • Download URL: myelin_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for myelin_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9519ac76edb90f10a52199878323fc6e7ebc7c33ee9eef0288206e9a0ba1122
MD5 513a1a701507239a55d88665264a877f
BLAKE2b-256 0cfe3ff81cc1a6038eb44b24fa26c9151937a53747e38a75a4d0bb212efaf88b

See more details on using hashes here.

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