Python SDK
The pip package: sync and async clients, the tool decorator, and the framework helpers for LangChain, CrewAI, OpenAI and Pydantic AI in Python.
Python SDK
The official Python SDK provides sync and async clients with the same capabilities as the TypeScript SDK.
# Core SDK (requires Python 3.10+)
pip install vorim
# With framework integrations (quote the extras so zsh doesn't expand the brackets)
pip install "vorim[langchain]" # LangChain / LangGraph
pip install "vorim[crewai]" # CrewAI
pip install "vorim[openai]" # OpenAI Agents SDK
pip install "vorim[anthropic]" # Anthropic / Claude
pip install "vorim[all]" # All integrationsbashQuick Start
from vorim import Vorim
vorim = Vorim(api_key="agid_sk_live_...")
# Register an agent
result = vorim.register(
name="invoice-processor",
capabilities=["read_documents", "extract_data"],
scopes=["agent:read", "agent:execute"],
)
# Check permissions (<5ms via Redis)
check = vorim.check(result.agent.agent_id, "agent:execute")
if check.allowed:
# Emit audit event
vorim.emit(
agent_id=result.agent.agent_id,
event_type="tool_call",
action="process_invoice",
result="success",
latency_ms=142,
)
# Verify any agent's trust (public, no auth required)
trust = vorim.verify(result.agent.agent_id)
print(f"Trust score: {trust.trust_score}/100")pythonAsync Client
import asyncio
from vorim import AsyncVorim
async def main():
async with AsyncVorim(api_key="agid_sk_live_...") as vorim:
result = await vorim.register(
name="async-agent",
capabilities=["search"],
scopes=["agent:read"],
)
print(result.agent.agent_id)
asyncio.run(main())pythonLangChain Integration
from vorim import Vorim
from vorim.integrations.langchain import vorim_tool, VorimCallbackHandler
vorim = Vorim(api_key="agid_sk_live_...")
@vorim_tool(vorim, agent_id="agid_acme_...", permission="agent:execute")
def search(query: str) -> str:
"""Search documents."""
return f"Results for {query}"
# search() is now a standard LangChain tool with Vorim permission checks + auditpythonCrewAI Integration
from vorim import Vorim
from vorim.integrations.crewai import register_crew
vorim = Vorim(api_key="agid_sk_live_...")
crew = register_crew(vorim, {
"crew_name": "content-pipeline",
"members": [
{
"role": "researcher",
"name": "crew-researcher",
"capabilities": ["web_search"],
"scopes": ["agent:read", "agent:execute"],
},
],
})pythonOpenAI Integration
from openai import OpenAI
from vorim import Vorim
from vorim.integrations.openai_agents import VorimToolRegistry
vorim = Vorim(api_key="agid_sk_live_...")
client = OpenAI()
registry = VorimToolRegistry(vorim=vorim, agent_id="agid_acme_...")
registry.add(
name="search",
description="Search documents",
parameters={"type": "object", "properties": {"query": {"type": "string"}}},
execute=lambda args: f"Results for {args['query']}",
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Search for AI papers"}],
tools=registry.to_openai_tools(),
)
tool_messages = registry.execute_tool_calls(
response.choices[0].message.tool_calls or []
)pythonNeed Help?
Book a demo for a walkthrough, or contact us for support. For enterprise needs, reach out at sales@vorim.ai.