What an SDK Does
An SDK is a thin wrapper, usually 200-400 lines, that hides gRPC from the developer. From their point of view, they callbindufy(config, handler) and get a microservice.
Under the hood, the SDK does four things:
- Implements
AgentHandler- a gRPC server that receivesHandleMessagescalls from the core and invokes the developer’s handler - Calls
BinduService.RegisterAgent- a gRPC client that registers the agent with the core - Launches the Python core - spawns
bindu serve --grpcas a child process - Exposes
bindufy(config, handler)- the developer-facing API that orchestrates all of the above
proto/agent_handler.proto is the single source of truth. As long as your SDK speaks that contract, it works with the core.
The architectural rule is simple: new languages get new drivers, not new engines.
Step 1: Generate gRPC Stubs
The first job is to generate typed client and server stubs from the protobuf definition.| Language | Tool | Command |
|---|---|---|
| Rust | tonic-build | Add tonic-build to build.rs, it compiles the proto at build time |
| Go | protoc-gen-go-grpc | protoc --go_out=. --go-grpc_out=. proto/agent_handler.proto |
| Swift | grpc-swift | protoc --swift_out=. --grpc-swift_out=. proto/agent_handler.proto |
| C# | Grpc.Tools | NuGet package auto-generates from .proto in the project |
Step 2: Implement AgentHandler (Server)
Once you have stubs, build the server that the core will call during execution.HandleMessages
This is the critical RPC. It receives conversation history, calls the developer’s handler, and returns the response.- If the handler returns a plain string, set
contentto the string and leavestateempty - If the handler returns a state transition, set
stateto"input-required"or"auth-required"andpromptto the follow-up question - If the handler throws, return a gRPC
INTERNALerror with the error message - Always set
is_finaltotrue(streaming not yet supported)
GetCapabilities
Return static info about the SDK:HealthCheck
Return{healthy: true, message: "OK"}.
This server is the language-specific half of the sidecar. It is how the engine talks back to the driver.
Step 3: Implement BinduService Client
Now build the client that talks from your SDK into the core.RegisterAgent
This sends config, skills, and the SDK’s callback address:config_json is a JSON string matching the Python bindufy() config format. That is intentional. The schema lives in one place, and SDKs serialize to it.
Heartbeat
Call this every 30 seconds to signal liveness:RegisterAgent and Heartbeat are the minimum control plane for the sidecar.
Step 4: Implement Core Launcher
The SDK must be able to start the engine automatically. That is what makes the developer experience feel local even though the architecture is split.Step 5: Implement bindufy()
At this point, you can wire the SDK together behind one developer-facing function:
Skill Loading
Skills live in the developer’s project, not in the core. The SDK is responsible for reading them and shipping their contents during registration.
The core can then process the skill content without needing filesystem access to the SDK’s project.
Testing Your SDK
The fastest way to keep an SDK honest is to test both the transport and the sidecar lifecycle.Unit test
Mock the gRPC channel and verifyHandleMessages correctly invokes the handler and serializes the response.
Integration test
Start a real Bindu core withbindu serve --grpc, register an agent from your SDK, send an A2A message, and verify the response. The Python E2E tests in tests/integration/grpc/test_grpc_e2e.py show exactly this pattern.
Smoke test
Run one of the examples end to end andcurl the agent.
Reference: TypeScript SDK
If you want a concrete model, the TypeScript SDK is the reference implementation.| File | What it does | Lines |
|---|---|---|
src/index.ts | bindufy() function + skill loader | ~220 |
src/server.ts | AgentHandler gRPC server | ~130 |
src/client.ts | BinduService gRPC client | ~105 |
src/core-launcher.ts | Spawns Python core | ~170 |
src/types.ts | TypeScript interfaces | ~120 |
TypeScript SDK
See how the reference driver behaves from the developer’s point of view
API Reference
Review the protobuf messages and service contracts directly
Publishing
Once the SDK works, publish it to the language’s standard package registry:| Language | Registry | Package name convention |
|---|---|---|
| Rust | crates.io | bindu-sdk |
| Go | Go modules | github.com/getbindu/bindu-sdk-go |
| Swift | Swift Package Manager | bindu-sdk |
| C# | NuGet | Bindu.Sdk |
Include the proto file in the package so users do not need to download it separately.