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

Uploaded Python 3

File details

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

File metadata

  • Download URL: myelin_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 106.2 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.3.tar.gz
Algorithm Hash digest
SHA256 d20a447282f6d463822f02e50b7364db192e111093b059291eba0db8c79f49c2
MD5 32bfd4a05cc0dc02ed16b4ef6dbc16d0
BLAKE2b-256 8e4a6d96fcaa5b6bac481a73f880e2e9146a2aa972dec261b8f4d872337cf124

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: myelin_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 23.2 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 27759668e22d4ee51be201e3c55c23711c2742db7f7796395e2d7e6d35298608
MD5 2bac92d4575c2b86ab9af95889b9bfdb
BLAKE2b-256 ef39f681fe61d200dc9ed045e07e53628f5567b9c74705c21f19b04f39c44832

See more details on using hashes here.

Provenance

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