proto/agent_handler.proto — the single source of truth for how SDKs register agents, send heartbeats, expose handler callbacks, and keep the language-agnostic runtime aligned with the Python core.
Why This API Matters
The gRPC layer is not an add-on around Bindu. It is the contract that keeps registration, liveness, handler execution, and capability discovery consistent across SDKs while the core continues to run the shared infrastructure. To understand why this matters, compare what happens without it:| Ad-hoc SDK integration | Bindu gRPC contract |
|---|---|
| Each SDK invents its own registration and callback shape | One protocol defines the shared contract between SDKs and the core |
| Liveness and capability checks vary across languages | Heartbeat, HealthCheck, and GetCapabilities are standardized |
| Remote handlers can drift from local bindufy behavior | RegisterAgent preserves the same bindufy pipeline in the core |
| Message execution contracts become SDK-specific | HandleMessages keeps one handler request/response model |
| Operational behavior becomes harder to debug | Ports, methods, and message schemas stay explicit and testable |
The reference here is not just a list of RPCs. It is the runtime boundary that allows
remote SDKs to participate in the same
bindufy lifecycle as local Python agents.How The gRPC Contract Works
The contract is split across two services that face opposite directions. Understanding which service lives where is the key to reading the rest of this page.The Service Split
BinduService runs on port 3774 in the Bindu core. SDKs use it to register and manage agents.
AgentHandler runs on a dynamic port in the SDK. The core uses it to execute the developer’s handler and query runtime status.
Registration
BinduService is the control plane for agent registration, heartbeats, and shutdown.Execution
AgentHandler is the runtime callback plane for message handling and health checks.Shared Proto
Both sides follow the same message schema from
proto/agent_handler.proto.The Lifecycle: Register, Execute, Maintain
Every SDK follows the same three-phase lifecycle. First the SDK registers with the core. Then the core calls the SDK when work arrives. Finally, the SDK keeps the connection alive and shuts down cleanly. Let’s walk through each phase and look at the exact message shapes involved.Register
RegisterAgent is the main entry point. The SDK sends config, skills, and its
callback address. The core runs the full bindufy pipeline and returns the agent’s
identity.config_json matches the Python bindufy() config format:SHA256 of author+name, creates
Ed25519 DID keys, sets up x402 payments, creates the manifest with GrpcAgentClient
as handler, and starts the HTTP/A2A server on the configured URL.Execute
HandleMessages is how the core invokes the SDK handler once work arrives. This is the
hot path — every user message passes through this RPC.- Normal response:
{content: "answer", state: ""}→ task completes - Need more info:
{state: "input-required", prompt: "Can you clarify?"}→ task stays open - Need auth:
{state: "auth-required"}→ task stays open - Error: Return gRPC
INTERNALstatus → task fails
Service Reference
Here are the two services summarized for quick lookup.BinduService (port 3774)
Lives in the Bindu core. SDKs call this to register and manage agents.| Method | What it does |
|---|---|
RegisterAgent | SDK sends config + skills, core runs the full bindufy pipeline and returns the agent’s identity |
Heartbeat | Keep-alive signal sent every 30 seconds |
UnregisterAgent | Clean shutdown call before SDK exit |
AgentHandler (dynamic port)
Lives in the SDK. The core calls this when work arrives.| Method | What it does |
|---|---|
HandleMessages | Core sends conversation history, SDK runs the developer’s handler and returns the response |
HandleMessagesStream | Server-side streaming variant — supported in GrpcAgentClient via use_streaming=True |
GetCapabilities | Core queries what the SDK agent supports |
HealthCheck | Core verifies the SDK is responsive |
HandleMessagesStream is fully supported. GrpcAgentClient calls it when initialized
with use_streaming=True. The SDK’s AgentHandler must implement this RPC to use
streaming. The TypeScript SDK currently returns supports_streaming: false from
GetCapabilities, but the proto contract and Python core are both fully ready for it.Shared Message Types
These message types are used across both services. Understanding them helps when building Custom SDKs or debugging registration issues.SkillDefinition
SkillDefinition is sent during registration and carries the skill file content so the core does not need filesystem access. The name, description, and tags fields describe the skill for discovery. The input_modes and output_modes declare what formats the skill accepts and produces. The raw_content and format fields carry the original file content so the core can process it directly.
Sending skill content during registration lets the SDK remain the source of truth for
skill files while the core receives the exact material it needs to build the manifest.
Capability and Health Responses
These are the responses the core gets when it queries your SDK about what it can do and whether it is still running.Configuration
These environment variables control the gRPC server in the Bindu core. You typically do not need to change them unless you are running in a non-standard environment or debugging port conflicts.| Variable | Default | Description |
|---|---|---|
GRPC__ENABLED | false | Enable gRPC server |
GRPC__HOST | 0.0.0.0 | Bind address |
GRPC__PORT | 3774 | Server port |
GRPC__MAX_WORKERS | 10 | Thread pool size |
GRPC__MAX_MESSAGE_LENGTH | 4194304 | Max message size (4MB) |
GRPC__HANDLER_TIMEOUT | 30.0 | HandleMessages timeout (seconds) |
GRPC__HEALTH_CHECK_INTERVAL | 30 | Health check interval (seconds) |
Practical gRPC Calls
If you want to test the contract directly without writing SDK code,grpcurl lets you call any of these RPCs from the command line. This is useful for debugging registration issues or verifying that the core is running correctly.
List services
List services
Send Heartbeat
Send Heartbeat
Call RegisterAgent
Call RegisterAgent
Operational Guarantees
Stable Contract
The proto keeps SDK registration, handler execution, and liveness signaling aligned
across languages.
Explicit Interfaces
Ports, message types, and RPC boundaries stay visible and testable with tools like
grpcurl.Related
- gRPC Overview — the conceptual tour of why the sidecar exists
- Agent Implementation — handler patterns and the bridge internals
- Custom SDKs — how to build SDKs for other languages using this contract