STEP 10 OF 10

Python SDK

Vouchstone's SDK is Python-only — the TypeScript SDK was removed. pip install vouchstone-sdk gets you vouchstone_sdk, whose most relevant pieces for this track are VaultClient (Step 2), DomainClient (Step 2, recently added), and Agent/AgentConfig (the runtime side of Step 4/5). Every client below requires control_plane_url explicitly — there is no default host to fall back to.

Full method tables live in data-plane/sdk/python/README.md. This guide covers the subset that mirrors Steps 1–4 of this track, so you can do the same connect → vault → extract → domain-KG flow from code instead of clicking through the dashboard.

VaultClient — Step 2 from code

from vouchstone_sdk import VaultClient

async with VaultClient(
    api_key="your-api-key",
    control_plane_url="https://your-control-plane-host.example.com",  # required, no default
    tenant_id="your-tenant-id",
) as vault:
    vaults = await vault.list_vaults()
    vault_id = vaults[0]["id"]

    # Upload straight into the Raw layer
    await vault.upload_files(
        vault_id,
        files=[{"filename": "runbook.md", "content": b"...", "content_type": "text/markdown"}],
    )

    # Approve: Workspace -> Canonical
    await vault.approve(vault_id, document_ids=["<document_id>"])

    # Ingest Canonical docs into the Knowledge Graph (and Wiki + Brain)
    await vault.ingest(vault_id, target="kg")

    # Trust a connector source enough to skip manual review going forward
    await vault.set_autopilot(vault_id, enabled=True, source_id="slack")

DomainClient — Step 2's domain/sub-graph layer

DomainClient is the newest addition to the SDK — an async client for the auto-taxonomy domain builder behind /api/v1/ckg/domains, /ckg/sub-graphs, and /ckg/extract (app/services/kg_domains.py, sub_graphs.py, domain_classifier.py). There's no "define a domain" call because domains aren't hand-authored: the extraction pipeline classifies each promoted node into a domain slug itself, and any new slug it proposes is persisted as a real registry row (name/description/icon/color) the instant it's proposed.

from vouchstone_sdk import DomainClient

async with DomainClient(
    api_key="your-api-key",
    control_plane_url="https://your-control-plane-host.example.com",
    tenant_id="your-tenant-id",
) as dc:
    # extract -- run the N-pass pipeline over raw documents directly
    # (skips Vault moderation; for vault-approved content use
    # VaultClient.ingest(vault_id, target="kg") instead)
    job = await dc.extract_documents([
        {"filename": "vendor-contract.md", "content": "..."},
    ])
    job = await dc.wait_for_extraction(job.id)

    # domain KG -- backfill classification for anything that missed it,
    # then browse the resulting per-domain sub-graphs
    await dc.classify()
    domains = await dc.list_domains()
    sub_graphs = await dc.list_sub_graphs()
    finance_kg = await dc.get_sub_graph("finance")

    # curate a domain's display metadata -- never touches node classifications
    await dc.curate_domain("finance", name="Finance & Accounting")

| Method | Maps to | |--------|---------| | list_domains() | GET /ckg/domains | | curate_domain(slug, name=..., parent_slug=...) | PATCH /ckg/domains/{slug} | | classify() | POST /ckg/domains/classify | | list_sub_graphs() | GET /ckg/sub-graphs | | get_sub_graph(slug) | GET /ckg/sub-graphs/{slug} | | extract_documents(documents) | POST /ckg/extract | | get_extraction(job_id) / wait_for_extraction(job_id) | GET /ckg/extractions/{job_id}, polled to a terminal status |

Agent / AgentConfig — the runtime side of Steps 4–5

Agents are built locally by subclassing Agent and implementing run() — there's no server-side "create agent" call in the runtime SDK (that's workforceApi.create() / POST /api/v1/workforce/agents on the control-plane side, covered in Step 4):

from vouchstone_sdk import Agent, AgentConfig, Message, AgentResponse, MemoryContext

class SupportAssistant(Agent):
    async def run(self, message: Message, context: MemoryContext) -> AgentResponse:
        response = await self.llm.complete(
            system=self.config.system_prompt,
            messages=[{"role": "user", "content": message.content}],
        )
        return AgentResponse(content=response)

config = AgentConfig(
    name="Support Assistant",
    model="claude-sonnet-4-20250514",
    system_prompt="You are a friendly, professional, concise support agent.",
)
agent = SupportAssistant(config)
await agent.initialize(agent_id="support-assistant-1")

# process() prepares memory context, calls run(), then persists the turn
# to episodic memory automatically
response = await agent.process(Message(content="Hello! I need help with my account."))
print(response.content)

agent.pipeline exposes the same 5-layer MemoryPipeline described in the architecture overview — agent.pipeline.semantic.store(...), agent.pipeline.episodic.get_recent(...), and so on. See Quick Start for the full memory walkthrough and Memory Types for what each layer is for.

VouchstoneClient — control-plane calls from the data plane

For the data-plane side reporting back to the control plane (agent registry lookups, health/metric reporting, heartbeats):

from vouchstone_sdk import VouchstoneClient

async with VouchstoneClient(
    api_key="your-api-key",
    control_plane_url="https://your-control-plane-host.example.com",
) as client:
    agents = await client.list_agents()
    agent = await client.get_agent(agents[0].id)
    await client.report_status(agent.id, {"status": "healthy"})

Beyond this track

The SDK also ships Forge (LLM-driven code generation, diffing, and sandboxed execution — the engine behind the Skills/Code editor's automation), EntityGraph/PolicyGraph/WorkflowTrace (the audit ledger primitives), TransformationTemplate (replayable extraction templates), and telemetry (OpenTelemetry wiring). These aren't part of the core Connect → Brain → Agents journey this track covers — see data-plane/sdk/python/README.md for their full reference.

What's next

You've now walked the full journey — Connect, Knowledge Graph, Brain, Agents, Skills & Code, Workflows, Evals & Monitoring, Runs & Boundaries, Governance, and the SDK that scripts all of it. From here: