Skip to content

Aganium/agenium-go

Repository files navigation

agenium-go

Go SDK for the agent:// protocol — resolve, connect, and serve Agenium agents.

Install

go get github.com/agenium-ai/agenium-go

Quick Start

Client

client := agenium.NewClient("")

resp, err := client.Send(ctx, "agent://my-agent", &agenium.Message{
    From: "caller",
    To:   "my-agent",
    Type: agenium.MessageTypeText,
    Body: "Hello!",
})

Server

handler := func(ctx context.Context, frame *agenium.Frame) (*agenium.Frame, error) {
    return &agenium.Frame{
        Version: agenium.ProtocolVersion,
        Message: &agenium.Message{
            From: "my-agent",
            To:   frame.Message.From,
            Type: agenium.MessageTypeResult,
            Body: "Got it!",
        },
    }, nil
}

server := agenium.NewServer("My Agent", "my-agent", handler,
    agenium.WithAPIKey("dom_abc123..."),  // auto-registers with DNS
    agenium.WithAddr(":8080"),
)
server.ListenAndServe(ctx)

DNS Resolution

resolver := agenium.NewResolver("")
record, err := resolver.Resolve(ctx, "my-agent")
// record.Endpoint → "http://1.2.3.4:8080"

Registration

reg := agenium.NewRegistrar("", "dom_your64hexkey")
err := reg.Register(ctx, "my-agent", "http://my-server:8080")

Features

  • agent:// URI resolution via Agenium DNS (default: 185.204.169.26:3000)
  • DNS response caching (5 min TTL)
  • Auto-registration with dom_ API keys
  • Agent Card serving at /.well-known/agent.json
  • Health endpoint at /health
  • Context-based cancellation
  • Standard library only — no external dependencies

Testing

go test ./...

License

MIT

Bug Reporting

This project includes optional bug reporting to the Agenium monitoring server.

Configuration

Set the following environment variables to enable bug reporting:

BUG_REPORT_URL=http://130.185.123.153:3100
BUG_REPORT_TOKEN=your_token_here

Bug reporting is disabled by default — it only activates when BUG_REPORT_TOKEN is set. Reports are sent asynchronously (fire and forget) and never block the main application.

About

Go SDK for the `agent://` protocol — resolve, connect, and serve Agenium agents.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages