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):
- Create
src/myelin_sdk/integrations/<framework>/ - Add
__init__.pyand a handler module - Use
MyelinClient.capture()to record tool calls - Add an optional dependency group in
pyproject.toml - 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
379ee78b349fd7d734531ab9338933eb132831b0ddd262539a43020b72e993e8
|
|
| MD5 |
fecb0b10e1cf5656620e2166d0af513e
|
|
| BLAKE2b-256 |
737c150b6685fb48f19b9200b81470757d5f90b6cc1dfcb91bfec104fbb36369
|
Provenance
The following attestation bundles were made for myelin_sdk-0.1.5.tar.gz:
Publisher:
ci.yml on yahnyshc/myelin-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myelin_sdk-0.1.5.tar.gz -
Subject digest:
379ee78b349fd7d734531ab9338933eb132831b0ddd262539a43020b72e993e8 - Sigstore transparency entry: 1174344928
- Sigstore integration time:
-
Permalink:
yahnyshc/myelin-sdk@fa70ef5d48a6f3e0e71a0e8dab1bd5afe8b7deef -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/yahnyshc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@fa70ef5d48a6f3e0e71a0e8dab1bd5afe8b7deef -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd029ef1f87831735d6748b0a887892681a9506d514066bcd919c0e5c5072a92
|
|
| MD5 |
53d9038f1ae70b1f28669854e5e03ab7
|
|
| BLAKE2b-256 |
4d159a33134694d7c7f58520279a0ebb506cae42941fe692005d0c5dc7ece75b
|
Provenance
The following attestation bundles were made for myelin_sdk-0.1.5-py3-none-any.whl:
Publisher:
ci.yml on yahnyshc/myelin-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myelin_sdk-0.1.5-py3-none-any.whl -
Subject digest:
bd029ef1f87831735d6748b0a887892681a9506d514066bcd919c0e5c5072a92 - Sigstore transparency entry: 1174344974
- Sigstore integration time:
-
Permalink:
yahnyshc/myelin-sdk@fa70ef5d48a6f3e0e71a0e8dab1bd5afe8b7deef -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/yahnyshc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@fa70ef5d48a6f3e0e71a0e8dab1bd5afe8b7deef -
Trigger Event:
push
-
Statement type: