Skip to main content

Agent to Agent Communication Layer

Project description

Den Den

Go CI Python CI MIT License

Agent-to-orchestrator communication layer. A gRPC transport where agents call back to the orchestrator via the denden CLI.

Orchestrator (Python gRPC server)
  ├── spawns agents as subprocesses
  └── handles ask_user / delegate requests
         ▲
         │ gRPC (localhost)
         │
     denden CLI (Go binary)
       └── called by agents to send requests

Components

Component Language Path
CLI client Go cli/
Server library Python server/
Protocol Protobuf proto/denden.proto

Quick start

Install the server

cd server
pip install -e '.[dev]'

Build the CLI

cd cli
go build -o denden .

Run the server

denden-server --verbose

Use the CLI

# Health check
./cli/denden status

# Ask user a question
./cli/denden send '{
  "askUser": {
    "question": "Which language?",
    "choices": ["Python", "Go", "Rust"]
  }
}'

# Delegate to a sub-agent
./cli/denden send '{
  "delegate": {
    "delegateTo": "implementer",
    "task": {
      "text": "implement auth module",
      "returnFormat": "TEXT"
    }
  }
}'

The CLI auto-fills request_id, denden_version, trace.created_at, and trace fields from environment variables.

Environment variables

Variable Default Description
DENDEN_ADDR 127.0.0.1:9700 Server address
DENDEN_AGENT_ID Agent instance ID (set by orchestrator)
DENDEN_PARENT_AGENT_ID Parent agent instance ID
DENDEN_RUN_ID Run ID
DENDEN_TIMEOUT 30s CLI request timeout

Protocol

Single .proto file at proto/denden.proto. Two RPCs:

  • Send — dispatches ask_user or delegate requests (oneof payload)
  • Status — health check

Response statuses: OK, DENIED, ERROR.

Regenerate stubs

make proto

Requires protoc, protoc-gen-go, protoc-gen-go-grpc, and grpcio-tools.

Server as a library

from denden import DenDenServer, ok_response
from denden.gen import denden_pb2

server = DenDenServer(addr="127.0.0.1:9700")

def handle_ask_user(request):
    answer = input(request.ask_user.question + " ")
    return ok_response(
        request.request_id,
        ask_user_result=denden_pb2.AskUserResult(text=answer),
    )

def handle_delegate(request):
    # ... run the delegated task ...
    return ok_response(
        request.request_id,
        delegate_result=denden_pb2.DelegateResult(text="done"),
    )

server.on_ask_user(handle_ask_user)
server.on_delegate(handle_delegate)
server.run()

Dynamic modules

The server CLI supports loading modules at startup:

denden-server --load-module my_custom_module

Modules must expose a module attribute or create_module() function returning a denden.Module subclass.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

denden_server-0.1.16.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

denden_server-0.1.16-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file denden_server-0.1.16.tar.gz.

File metadata

  • Download URL: denden_server-0.1.16.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for denden_server-0.1.16.tar.gz
Algorithm Hash digest
SHA256 e84238bf9f1b5721516ee8bb9ebaafcafecd71ba83b51aeafb69d43d33f2daa1
MD5 8ab67748475e1426db1ebeb41bb4ce41
BLAKE2b-256 4ac3cc713f6f2f3322b9f3eccab60b5d24454e8fc3198a64d6a3a80c794f049a

See more details on using hashes here.

Provenance

The following attestation bundles were made for denden_server-0.1.16.tar.gz:

Publisher: release.yml on strawpot/denden

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file denden_server-0.1.16-py3-none-any.whl.

File metadata

  • Download URL: denden_server-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for denden_server-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 6e6c249f736ed6556cf6cde5b9f12e960ce79fd0046d9eef430975c583106bb8
MD5 546f174e45b656351b62c91fba566e9d
BLAKE2b-256 5d0fe66d4d66b711d1e4f310ba0751ca00e00aae45e97c2148af41ae34ee249f

See more details on using hashes here.

Provenance

The following attestation bundles were made for denden_server-0.1.16-py3-none-any.whl:

Publisher: release.yml on strawpot/denden

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page