Skip to main content

langchain-1claw

PyPI License: MIT Python 3.10+

⭐ Star 1clawAI/agent-templates — ready-to-run agent templates wired to 1Claw. It is our single starred repo.

You're building a LangChain agent that needs API keys, wallet signing, or memory that survives across sessions. Pasting credentials into .env files works until you deploy, share the repo, or the model accidentally echoes a secret in chat.

This package gives your agent 13 LangChain tools backed by 1Claw. Secrets live in an HSM-encrypted vault. A human grants access through policies, so the agent only reads paths you allow. Signing keys never leave the server. Memory is encrypted and searchable.

Install one package, pass an ocv_ agent API key, and call get_all_tools(). You get vault CRUD, encrypted memory, EIP-191 signing, multi-chain transactions, and automation triggers without writing HTTP clients yourself.

Features

Category Components What it does
Secrets OneclawGetSecretTool, OneclawPutSecretTool, OneclawListSecretsTool, OneclawRotateSecretTool CRUD and rotation for HSM-encrypted vault secrets
Env vars OneclawResolveEnvTool, OneclawListEnvVarsTool Resolve vault env vars with precedence; list scoped keys
Memory OneclawMemoryPutTool, OneclawMemoryGetTool, OneclawMemorySearchTool Encrypted persistent memory with semantic search
Signing OneclawSignMessageTool, OneclawSubmitTransactionTool, OneclawGetBalanceTool EIP-191 signing and multi-chain transaction submission (ETH, BTC, SOL, XRP, ADA, TRX)
Automations OneclawTriggerAutomationTool Trigger pre-configured workflow automations
Chat History OneclawChatMessageHistory, OneclawScratchChatMessageHistory BaseChatMessageHistory backed by encrypted memory
Retriever OneclawMemoryRetriever BaseRetriever backed by semantic memory search

Installation

pip install langchain-1claw

Quick Start

Tool-calling agent

from langchain_openai import ChatOpenAI
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain_core.prompts import ChatPromptTemplate

from langchain_1claw import OneclawClient, get_all_tools

# Authenticate with your agent's API key
client = OneclawClient(api_key="ocv_your_agent_key")

# Get all 13 tools
tools = get_all_tools(client)

# Build an agent
llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant with access to a secure vault, "
               "blockchain signing, encrypted memory, and workflow automations."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

result = executor.invoke({"input": "What API keys do we have stored?"})
print(result["output"])

Individual tools

from langchain_1claw import OneclawClient, OneclawGetSecretTool

client = OneclawClient(api_key="ocv_...")
tool = OneclawGetSecretTool(client=client)

# Use directly
api_key = tool.invoke({"path": "api-keys/openai"})

# Or with a specific vault
api_key = tool.invoke({"path": "api-keys/openai", "vault_id": "vault-uuid"})

Persistent chat history

from langchain_core.runnables.history import RunnableWithMessageHistory
from langchain_1claw import OneclawClient, OneclawChatMessageHistory

client = OneclawClient(api_key="ocv_...")

chain_with_history = RunnableWithMessageHistory(
    chain,
    lambda session_id: OneclawChatMessageHistory(
        client=client,
        session_id=session_id,
        max_messages=100,  # trim old messages
    ),
)

# Messages persist across sessions, encrypted at rest with HSM-managed keys
result = chain_with_history.invoke(
    {"input": "Remember that my favorite color is blue"},
    config={"configurable": {"session_id": "user-123"}},
)

Ephemeral scratch history (auto-expires)

from langchain_1claw import OneclawScratchChatMessageHistory

history = OneclawScratchChatMessageHistory(
    client=client,
    session_id="temp-session",
    ttl_secs=600,  # auto-delete after 10 minutes
)

Semantic memory retriever (RAG)

from langchain_1claw import OneclawClient, OneclawMemoryRetriever

client = OneclawClient(api_key="ocv_...")
retriever = OneclawMemoryRetriever(
    client=client,
    namespace="knowledge",
    top_k=5,
)

# Use in a RAG chain
docs = retriever.invoke("How do I deploy to production?")
for doc in docs:
    print(f"[{doc.metadata['key']}] {doc.page_content[:100]}...")

Multi-chain transaction signing

from langchain_1claw import OneclawClient, OneclawSubmitTransactionTool

client = OneclawClient(api_key="ocv_...")
tx_tool = OneclawSubmitTransactionTool(client=client)

# Sign and broadcast — private key never leaves the HSM
result = tx_tool.invoke({
    "chain": "ethereum",
    "to": "0xRecipientAddress",
    "value": "0.01",
    "simulate_first": True,  # Tenderly simulation before signing
})

Authentication

The client authenticates via agent API key exchange:

# Key-only auth (auto-discovers agent_id and vault_id)
client = OneclawClient(api_key="ocv_your_key")

# Explicit IDs
client = OneclawClient(
    api_key="ocv_your_key",
    agent_id="agent-uuid",
    vault_id="vault-uuid",
)

# Custom API endpoint
client = OneclawClient(
    api_key="ocv_your_key",
    base_url="https://your-vault.example.com",
)

JWTs are cached and automatically refreshed 60 seconds before expiry.

API Reference

Client

Method Description
get_secret(path) Fetch a decrypted secret
put_secret(path, value) Store or update a secret
list_secrets() List secret paths
delete_secret(path) Delete a secret
rotate_secret(path) Server-side secret rotation
memory_put(namespace, key, value) Store a memory entry
memory_get(namespace, key) Retrieve a memory entry
memory_search(namespace, query) Semantic search over memory
memory_list(namespace) List memory entries
memory_delete(namespace, key) Delete a memory entry
sign_message(message) EIP-191 personal_sign
sign_typed_data(typed_data) EIP-712 typed data signing
submit_transaction(chain, to, value) Sign and broadcast a transaction
sign_transaction(chain, to, value) Sign without broadcasting
list_signing_keys() List agent signing keys
get_signing_key_balance(chain) Get wallet balances
trigger_automation(automation_id) Trigger an automation
list_automations() List available automations
list_vaults() List accessible vaults

Tools

All tools accept a shared OneclawClient via the client parameter. Use get_all_tools(client) to get all 13 tools at once.

Platform v0.56+ (HITL, HFA, Safe, guardrail governance)

LangChain tools target 1Claw API v0.58+:

Capability Tool impact
Graduated HITL OneclawSubmitTransactionTool may return awaiting_approval — handle 202 in agent loops or use dashboard/mobile approvals.
Guardrail governance Execution intents and guardrail widening use server-side approval queues.
Safe foundation Agent Safe accounts via Vault API (CLI: 1claw agent accounts).
Multichain BTC/SOL/XRP/ADA/TRX signing unchanged; Vault/Shroud deps: rust-bitcoin, solana-sdk v4, xrpl-rust 1.1.0.

Development

git clone https://github.com/1clawAI/langchain-1claw.git
cd langchain-1claw
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest

# Lint
ruff check src tests
ruff format src tests

# Type check
mypy

License

MIT — see LICENSE.

Release files for langchain-1claw 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-1claw 0.2.3
File Size Uploaded
langchain_1claw-0.2.3.tar.gz 21.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-1claw 0.2.3
File Interpreter ABI Platform
langchain_1claw-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 37.5 kB

Release files / langchain_1claw-0.2.3.tar.gz

Download URL langchain_1claw-0.2.3.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c645f457372504ba3329cedc284baaed5419ea6bd856b477bfcfa4a6e6e59e73
BLAKE2b-256 checksum
How to use checksums
91a4ce4e6f882d4b50afcbb1fa42996b8c2a1e2b1883eea4cea4d737160aa2f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release files / langchain_1claw-0.2.3-py3-none-any.whl

Download URL langchain_1claw-0.2.3-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9cedbdd513c9d29160e47c5dbe5d5ec7a610a2ea77fc5d320f29ed219480d4e9
BLAKE2b-256 checksum
How to use checksums
07bfd9388029f3104137e97b483ef961e5bdd1bd4be824d831eac8efa8f77dea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.4

2 release files

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page