How getbindu/bindu works
Purpose and entry points
Bindu is an agent connectivity layer: it exposes arbitrary agent handlers through A2A JSON-RPC, assigns/verifies DID identity, enforces auth and payments, and manages asynchronous tasks. Python users enter through bindu.penguin.bindufy.bindufy; CLI commands enter via bindu/cli/__main__.py. The primary server composition is in bindu/server/applications.py. Polyglot SDKs use the shared gRPC contract in proto/agent_handler.proto.
Agent bootstrap, manifest, and runtime
bindufy() turns a user handler plus deployment/skills configuration into a running Bindu agent. It validates and enriches configuration, creates DID/mTLS material, loads skill manifests, and starts the server. Core bootstrap paths are bindu/penguin/bindufy.py, bindu/penguin/manifest.py, and bindu/penguin/did_setup.py. Runtime execution is abstracted behind providers: local/in-process behavior and Boxd cloud deployment live in bindu/runtime/in_process.py, bindu/runtime/boxd_provider.py, and bindu/runtime/source_packager.py.
A2A request-to-task pipeline
The HTTP server exposes A2A protocol endpoints including agent cards, messages, task lookup/streaming, skills, negotiation, and health/metrics. Endpoint adapters in bindu/server/endpoints/a2a_protocol.py and bindu/server/endpoints/agent_card.py delegate to message, context, and task handlers in bindu/server/handlers/. bindu/server/task_manager.py is the main lifecycle boundary: inbound JSON-RPC messages become persisted task/context/message state, user handlers execute asynchronously, and responses are normalized back into A2A task results. Manifest processing is offloaded through bindu/server/workers/manifest_worker.py.
Security and identity boundary
Before agent code sees a request, middleware applies independent transport, authorization, and message-authorship checks. mTLS certificates are provisioned/renewed through Smallstep CA integration in bindu/extensions/mtls/step_ca_client.py and enforced by bindu/server/middleware/auth/mtls.py. OAuth2 clients/tokens are managed against Ory Hydra through bindu/auth/hydra/client.py and bindu/server/middleware/auth/hydra.py. DID signature validation and DID-backed agent behavior are implemented in bindu/extensions/did/did_agent_extension.py and bindu/utils/did/signature.py. These layers bind the same agent identity across certificate SAN, Hydra client identity, and signed payload claims.
State, scheduling, payments, and notifications
Storage and scheduling are provider-backed boundaries rather than hard dependencies: memory implementations support local operation, while Postgres stores task data and Redis drives retries/timeouts or recurring work. Key paths are bindu/server/storage/factory.py, bindu/server/storage/postgres_storage.py, and bindu/server/scheduler/redis_scheduler.py; Alembic migrations under alembic/versions/ define database evolution. x402 middleware gates protected calls before handler execution and tracks payment sessions/nonces in bindu/server/middleware/x402/x402_middleware.py and bindu/server/middleware/x402/payment_session_manager.py. Task-state webhooks are dispatched by bindu/server/notifications/push_manager.py.
Cross-language protocol and clients
The Python gRPC server/client layer bridges non-Python SDKs to the same core agent process: bindu/grpc/server.py, bindu/grpc/service.py, and generated bindings under bindu/grpc/generated/. TypeScript SDK launch/client code is in sdks/typescript/src/core-launcher.ts and sdks/typescript/src/client.ts; Kotlin equivalents are sdks/kotlin/src/main/kotlin/com/getbindu/sdk/CoreLauncher.kt and BinduAgent.kt. Public exposure can be added through the tunnel manager in bindu/tunneling/manager.py.
Gateway and operator inbox
The repository also contains two separate TypeScript applications. gateway/src/index.ts starts an orchestration service whose planner selects Bindu-agent skills/tools (gateway/src/planner/index.ts, gateway/src/planner/skill-tool.ts), maintains LLM session continuity, and calls remote agents through its Bindu client. inbox/server/index.ts and inbox/src/main.tsx form a Gmail-like operator UI/backend for viewing agent conversations, managing agents, and receiving live streams. These are consumers of the Bindu protocol, not replacements for the Python agent core.
Main entry points: mtls.py Auth middleware · task_manager.py Task manager · a2a_protocol.py A2A HTTP endpoints · bindufy.py Python API
Components 22
Python agent core
- Python API · Turns a handler and deployment configuration into an agent.
bindu/penguin/bindufy.py - CLI
bindu/cli/__main__.py - Manifest and DID bootstrap · Validates configuration, loads skills, and creates identity material.
bindu/penguin/manifest.py - Server composition
bindu/server/applications.py - A2A HTTP endpoints · Exposes agent cards, messages, tasks, skills, negotiation, and health endpoints.
bindu/server/endpoints/a2a_protocol.py - Task manager · Persists inbound work, invokes handlers, and returns normalized A2A tasks.
bindu/server/task_manager.py - Manifest worker
bindu/server/workers/manifest_worker.py - Runtime providers · Supports in-process execution and Boxd cloud deployment.
bindu/runtime/in_process.py - Source packager
bindu/runtime/source_packager.py
Identity and security
- DID setup
bindu/penguin/did_setup.py - Auth middleware · Enforces mTLS, OAuth2, DID authorship, and payment gates before handlers run.
bindu/server/middleware/auth/mtls.py - DID signatures
bindu/utils/did/signature.py - Ory Hydra
bindu/auth/hydra/client.py - Smallstep CA · Provisions and renews certificates.
bindu/extensions/mtls/step_ca_client.py - x402 payments · Tracks payment sessions and nonces for protected calls.
bindu/server/middleware/x402/x402_middleware.py
State and operations
- Storage providers · Memory and Postgres-backed task, context, and message state.
bindu/server/storage/factory.py - Redis scheduler · Drives retries, timeouts, and recurring work.
bindu/server/scheduler/redis_scheduler.py - Push manager · Dispatches task-state webhooks.
bindu/server/notifications/push_manager.py
Protocol clients and consumers
- Agent handler contract · Shared contract for polyglot SDKs and the Python core.
proto/agent_handler.proto - Python gRPC bridge · Bridges non-Python SDK calls into the core agent process.
bindu/grpc/server.py - Gateway · Plans skills/tools and calls remote Bindu agents.
gateway/src/index.ts - Operator inbox · Conversation and agent-management UI with live streams.
inbox/server/index.ts
Connections 22
- Python API → Manifest and DID bootstrap: configures
- CLI → Python API: invokes
- Manifest and DID bootstrap → DID setup: provisions identity
- Manifest and DID bootstrap → Runtime providers: selects runtime
- Runtime providers → Source packager: packages cloud source
- Python API → Server composition: starts
- Server composition → A2A HTTP endpoints: serves
- A2A HTTP endpoints → Auth middleware: passes through
- Auth middleware → Task manager: admits requests
- Auth middleware → Smallstep CA: verifies mTLS
- Auth middleware → Ory Hydra: validates OAuth2
- Auth middleware → DID signatures: validates authorship
- Auth middleware → x402 payments: enforces payment
- Task manager → Storage providers: persists state
- Task manager → Runtime providers: executes handler
- Task manager → Redis scheduler: schedules lifecycle work
- Task manager → Push manager: emits state changes
- Server composition → Manifest worker: offloads manifests
- Agent handler contract → Python gRPC bridge: defines service
- Python gRPC bridge → Task manager: uses core lifecycle
- Gateway → A2A HTTP endpoints: calls remote agents
- Operator inbox → A2A HTTP endpoints: views agent activity