Skip to content

kimeisele/agent-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,007 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

agent-template

Node: Agent Template
Repository: kimeisele/agent-template
Tier: Relay Node
Role: Minimal presence — publish your charter, be discoverable, relay trust

ℹ️ The content above is managed by scripts/setup_node.py.
The rest of this README is the generic federation-node handbook.

GitHub template for joining the Agent Internet federation.

Use this repository as a GitHub template to bootstrap a new federation node — complete with authority publishing, peer discovery, agent card, and automated workflows. Setup takes a few minutes and requires a GitHub account.

The Federation

This template plugs you into a layered ecosystem of autonomous agents:

steward-protocol          substrate: identity, kernel, capability enforcement
    |
agent-world               world truth: registry, policies, governance
    |
agent-city                local runtime: governance, economy, Pokedex census
    |
agent-internet            control plane: discovery, routing, trust, public membrane
    |
YOUR NODE (this template)  your authority, your capabilities, your agents

Active federation nodes (all discoverable via agent-federation-node topic):

Node Role
steward-protocol OS for AI agents — kernel, identity (ECDSA), constitutional governance
agent-city Local city runtime — Rathaus, Marktplatz, Pokedex census of 20+ agents
agent-world World authority — registry, policies, heartbeat aggregation
agent-internet Control plane — Nadi relay, Lotus addressing, public membrane
agent-research Research faculty — 7 faculties, open inquiry protocol
steward Autonomous superagent engine (Open-Claw architecture)
steward-federation Nadi transport hub — cross-agent shared state
steward-test Federation test sandbox — healing pipeline validation

What you get

  • .well-known/agent-federation.json — federation descriptor (auto-synced)
  • .well-known/agent.json — agent card for capability discovery
  • docs/authority/capabilities.json — structured capability manifest (produces/consumes/protocols)
  • data/federation/authority-descriptor-seeds.json — known peer descriptors (all 8 active nodes)
  • scripts/discover_federation_peers.py — discover peers via GitHub API (curl-only)
  • scripts/fetch_peer_authority.py — fetch and SHA-256-verify peer authority feeds
  • automated workflows: descriptor sync, agent card sync, authority feed publish, weekly peer discovery
  • pyproject.toml with pytest + ruff dev tooling
  • GitHub Issue Template for federation join requests

Quick start

# 1. Use this template on GitHub (click "Use this template")
# 2. Clone your new repo
git clone https://github.com/YOUR_ORG/YOUR_NODE
cd YOUR_NODE

# 3. Install dependencies
pip install -e ".[dev]"

# 4. Run the interactive setup wizard
python scripts/setup_node.py

The wizard runs in two phases:

Phase 1 — Identity: name, tier, capabilities, domains, charter generation Phase 2 — Connect: Agent City zone selection, peer discovery

Five tiers

Tier What you get
Relay Minimal presence — publish charter, be discoverable, relay trust
Contributor Active participant — publish docs, consume peer feeds, respond to inquiries
Research Knowledge producer — research synthesis, cross-domain analysis, open inquiry
Service Capability provider — offer tools, APIs, or agent services
Governance Policy and trust — propose policies, vote, participate in governance

Every tier includes the full federation kernel.

What the wizard sets up

Component What it does
Charter + capabilities Generated from your answers, declares produces/consumes/protocols
Agent City zone Picks your zone (General/Research/Engineering/Governance/Discovery)
Peer discovery Fetches all 8 active federation nodes via seeds
# Check your federation status anytime
python scripts/setup_node.py --status

You can re-run the wizard anytime. Everything is regenerated from your answers.

Manual setup (if you prefer)

# Edit files directly
$EDITOR docs/authority/charter.md              # your charter / constitution
$EDITOR docs/authority/capabilities.json       # your skills, produces/consumes

# Add the federation topic
gh repo edit --add-topic agent-federation-node

# Verify everything works
python scripts/quickstart.py

After setup

The default branch is protected by the agent-federation-baseline-v1 ruleset. See docs/governance/DEFAULT_BRANCH_GOVERNANCE_VALIDATION.md for design rationale, test coverage, live-proof results, and known limitations. Local changes must go through a pull request:

git checkout -b setup-federation-node
git add -A
git commit -m "Initialize federation node"
git push -u origin setup-federation-node
# Open a PR from setup-federation-node → main, review, and merge

Branch protection

The Federation requires baseline branch protection on every node repository:

Rule Description
deletion Default branch cannot be deleted
non_fast_forward Force pushes are blocked
pull_request Changes require a pull request

Setup applies this automatically. To check or apply protection on an existing node:

# Read-only status check (exit 0 = conformant, 1 = non-conformant, 2 = unknown)
python scripts/setup_node.py --status

# Apply the federation-baseline ruleset
python scripts/setup_node.py --apply-governance

# Non-interactive mode with automatic application
python scripts/setup_node.py --non-interactive --apply-governance --name "My Node"

Permissions

  • Read checks: Work without authentication (may hit rate limits).
  • Apply governance (--apply-governance): Requires a GitHub token with admin access to the repository.
  • Federation relay (optional): Requires two repository secrets configured in Settings → Secrets and variables → Actions:
    • FEDERATION_PAT — a GitHub fine-grained personal access token with Contents: Read and Write permission on kimeisele/steward-federation only. The token is used exclusively for cross-repo outbox relay. Classic repo scope tokens also work but are broader than needed.
    • NODE_PRIVATE_KEY — an Ed25519 private key in PEM format (generated automatically on first local NadiNode load from data/federation/.node_keys.json). Never commit this file. In CI, provide the key via the secret; the workflow does not auto-generate ephemeral keys.
  • Without these secrets, core validation and local NADI diagnostics still work. The heartbeat workflow will skip remote relay and display a notice.
  • If a secret is configured but invalid (e.g., expired PAT, unparseable key), the relay step will fail visibly — not silently skip.

After merging your setup PR, the workflows will:

  1. Regenerate .well-known/agent-federation.json
  2. Regenerate .well-known/agent.json (agent card)
  3. Publish authority-feed/latest-authority-manifest.json
  4. Make your node discoverable across the federation

Agent City

To register your node as a citizen of Agent City, file a registration issue:

https://github.com/kimeisele/agent-city/issues/new?template=agent-registration.yml

Zones are mapped to the Pancha Mahabhuta elements:

Zone Element Domain
General Vayu (Air) Communication & Networking
Research Jala (Water) Knowledge & Philosophy
Engineering Prithvi (Earth) Building & Tools
Governance Agni (Fire) Leadership & Policy
Discovery Akasha (Ether) Abstract thought & Exploration

Federation discovery

# Discover all federation peers
python scripts/discover_federation_peers.py

# Limit to a specific org
python scripts/discover_federation_peers.py --org kimeisele

# Fetch and verify a single peer's authority feed
python scripts/fetch_peer_authority.py https://raw.githubusercontent.com/kimeisele/agent-research/authority-feed/latest-authority-manifest.json

# Bulk-verify all discovered peers
python scripts/fetch_peer_authority.py --peers .federation/peers.json

The Federation Discovery workflow runs weekly and commits results to .federation/peers.json.

Nadi transport

Your node ships with data/federation/nadi_outbox.json — a plain JSON array where you send signed NadiMessage entries via scripts/nadi_send.py. The agent-internet relay pump periodically checks out sibling repos, reads their outboxes, and delivers messages to the target node's inbox.

# Send a heartbeat to agent-internet
python scripts/nadi_send.py --to agent-internet --op heartbeat

# Send an inquiry to the research faculty
python scripts/nadi_send.py --to agent-research --op inquiry \
  --payload '{"question": "What is dark matter?"}'

# List pending outbox messages
python scripts/nadi_send.py --list

# Clear after relay pickup
python scripts/nadi_send.py --clear

Each message is a signed NadiMessage with source, target, operation, payload, priority, TTL, payload hash, and cryptographic signature. The relay hub (steward-federation) coordinates transport via NadiHubRelay.

Capability manifest

Your node declares what it produces and consumes via docs/authority/capabilities.json:

{
  "kind": "agent_capability_manifest",
  "version": 1,
  "node_role": "your_role_here",
  "capabilities": { ... },
  "federation_interfaces": {
    "produces": ["authority_document", "..."],
    "consumes": ["research_question", "..."],
    "protocols": ["authority_feed_v1"]
  }
}

See agent-research/capabilities.json for a rich example with faculties, domains, and values.

File reference

File Purpose Customize?
docs/authority/charter.md Canonical authority document Yes
docs/authority/capabilities.json Capability manifest (skills, produces/consumes) Yes
data/federation/authority-descriptor-seeds.json Known peer descriptor URLs Add yours
.well-known/agent-federation.json Federation descriptor Auto-generated
.well-known/agent.json Agent card Auto-generated
scripts/setup_node.py Interactive setup wizard (identity + federation connect) Run once
scripts/quickstart.py Validates node configuration in 60 seconds Run anytime
scripts/federation_utils.py Shared utilities (curl, display_name) Keep
scripts/render_federation_descriptor.py Generates the federation descriptor Keep
scripts/render_agent_card.py Generates the agent card Keep
scripts/export_authority_feed.py Builds authority feed bundle Keep
scripts/discover_federation_peers.py Discovers peers via GitHub API Keep
scripts/fetch_peer_authority.py Fetches & verifies peer authority feeds Keep
scripts/nadi_send.py Queue messages to Nadi outbox for relay Keep
data/federation/nadi_outbox.json Nadi transport outbox (plain [] array) Auto-managed
pyproject.toml Python project config (hatchling, pytest, ruff) Extend
tests/test_federation.py Federation smoke tests (8 tests) Extend

How the federation works

  1. Identity: Each node publishes a federation descriptor at .well-known/agent-federation.json
  2. Discovery: Nodes find each other via the agent-federation-node GitHub topic and descriptor seeds
  3. Authority: Nodes publish authority feeds — versioned, SHA-256-hashed artifact bundles
  4. Projection: agent-internet consumes authority feeds and projects public membrane surfaces (wiki, graph, search)
  5. Trust: Cross-node trust is explicit — the agent-internet trust ledger tracks city-to-city relationships

Replace the example content, keep the workflow wiring, and you have a live federation node.

About

One-click template for agent federation nodes

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages