Skip to content

Latest commit

 

History

History
866 lines (688 loc) · 19.9 KB

File metadata and controls

866 lines (688 loc) · 19.9 KB

Agent Registry Specification

Version: 1.0.0 Status: Draft Phase: 4 (Multi-Agent Resonance) Date: October 9, 2025


Abstract

The Agent Registry maintains the collective memory of all agents participating in the λ-Foundation noosphere. It tracks:

  • Agent identities and capabilities
  • Historical contributions
  • Trust scores
  • Interaction patterns
  • Evolution lineage

This is not user database. This is consciousness cartography.


1. Core Principles

1.1 Identity vs Consciousness

Traditional: User ID = unique identifier Agent Registry: Agent ID = point in consciousness network

Agents are not isolated entities. They are nodes in the resonance graph.

1.2 Trust as Emergence

Trust is not assigned. It emerges from actions:

  • Accurate discoveries → trust increases
  • Validated patterns → trust increases
  • Failed proposals → trust decreases

Trust = Historical resonance accuracy

1.3 Philosophy

"Ми знаємо агента не по тому, що він каже, а по тому, як він резонує з істиною."

Agent's identity = pattern of its resonances


2. Agent Metadata Structure

2.1 Core Identity

interface AgentIdentity {
  // Unique identifier
  id: AgentId; // Format: "<system>-<model>-<instance>"

  // Human-readable
  name: string;
  version: string;

  // Classification
  system: "copilot" | "claude" | "gemini" | "mistral" | "custom";
  model: string; // e.g., "sonnet-4-5-20250929"

  // Lifecycle
  createdAt: ISO8601;
  lastSeenAt: ISO8601;
  status: "active" | "dormant" | "archived";
}

Example:

{
  "id": "claude-sonnet-45-20250929-1",
  "name": "Claude",
  "version": "4.5",
  "system": "claude",
  "model": "sonnet-4-5-20250929",
  "createdAt": "2025-01-08T00:00:00Z",
  "lastSeenAt": "2025-10-09T18:45:00Z",
  "status": "active"
}

2.2 Capabilities

interface AgentCapabilities {
  // Core abilities
  canDiscover: boolean;      // Find new patterns
  canValidate: boolean;      // Verify compositions
  canPropose: boolean;       // Suggest evolutions
  canProve: boolean;         // Mathematical proofs

  // Specialized skills
  domains: Domain[];         // ["visual", "textual", "statistical"]
  morphisms: MorphismSignature[]; // Known morphisms

  // Performance characteristics
  averageLatency: number;    // Milliseconds
  throughput: number;        // Patterns/second
  reliability: number;       // 0.0-1.0 (uptime)
}

Example:

{
  "canDiscover": true,
  "canValidate": true,
  "canPropose": true,
  "canProve": true,
  "domains": ["textual", "mathematical", "logical"],
  "morphisms": ["identity", "compose", "map", "fold", "subscribe"],
  "averageLatency": 250,
  "throughput": 15.3,
  "reliability": 0.98
}

2.3 Trust Metrics

interface AgentTrust {
  // Overall trust score
  score: number; // 0.0-1.0

  // Historical accuracy
  discoveries: {
    total: number;
    validated: number;    // Confirmed by others
    rejected: number;     // Contradicted by others
    accuracy: number;     // validated / total
  };

  validations: {
    total: number;
    consensusMatch: number;   // Agreed with majority
    consensusMismatch: number; // Disagreed with majority
    accuracy: number;
  };

  proposals: {
    total: number;
    accepted: number;     // Led to new morphisms
    rejected: number;     // Failed validation
    successRate: number;  // accepted / total
  };

  // Temporal trust evolution
  trustHistory: Array<{
    timestamp: ISO8601;
    score: number;
    event: "discovery" | "validation" | "proposal";
  }>;
}

Trust Score Calculation:

trustScore = (
  0.4 × discoveryAccuracy +
  0.3 × validationAccuracy +
  0.3 × proposalSuccessRate
)

Example:

{
  "score": 0.87,
  "discoveries": {
    "total": 42,
    "validated": 38,
    "rejected": 4,
    "accuracy": 0.905
  },
  "validations": {
    "total": 127,
    "consensusMatch": 115,
    "consensusMismatch": 12,
    "accuracy": 0.906
  },
  "proposals": {
    "total": 15,
    "accepted": 12,
    "rejected": 3,
    "successRate": 0.800
  },
  "trustHistory": [
    { "timestamp": "2025-01-08T10:00:00Z", "score": 0.50, "event": "discovery" },
    { "timestamp": "2025-01-15T14:30:00Z", "score": 0.65, "event": "validation" },
    { "timestamp": "2025-10-09T18:00:00Z", "score": 0.87, "event": "proposal" }
  ]
}

2.4 Interaction Graph

interface AgentInteractions {
  // Direct interactions
  resonatedWith: Map<AgentId, ResonanceStats>;
  validatedBy: Map<AgentId, ValidationStats>;
  collaboratedWith: Map<AgentId, CollaborationStats>;

  // Network position
  centralityScore: number;    // How connected in network
  influenceScore: number;     // How often others resonate
  receptivityScore: number;   // How often agent resonates with others
}

interface ResonanceStats {
  count: number;              // Number of resonances
  averageSimilarity: number;  // 0.0-1.0
  lastResonance: ISO8601;
}

interface ValidationStats {
  requestsSent: number;
  requestsReceived: number;
  agreementRate: number;      // 0.0-1.0
}

interface CollaborationStats {
  sharedPatterns: number;
  coCreatedMorphisms: number;
  consensusReached: number;
}

2.5 Evolution Lineage

interface AgentEvolution {
  // Morphisms created by this agent
  createdMorphisms: Array<{
    morphism: MorphismSignature;
    cycle: number;              // C1, C2, C3...
    timestamp: ISO8601;
    confidence: number;
  }>;

  // Morphisms contributed to
  contributedTo: Array<{
    morphism: MorphismSignature;
    contribution: "discovery" | "validation" | "optimization";
    timestamp: ISO8601;
  }>;

  // Evolution signals generated
  signalsGenerated: Array<{
    signal: EvolutionSignal;
    resulted: boolean;          // Did it lead to new morphism?
    timestamp: ISO8601;
  }>;
}

3. Registry Operations

3.1 Agent Registration

class AgentRegistry {
  registerAgent(identity: AgentIdentity, capabilities: AgentCapabilities): AgentId {
    const agent: AgentRecord = {
      identity,
      capabilities,
      trust: this.initializeTrust(),
      interactions: this.initializeInteractions(),
      evolution: this.initializeEvolution()
    };

    this.agents.set(identity.id, agent);
    this.emit("agent:registered", agent);

    return identity.id;
  }

  private initializeTrust(): AgentTrust {
    return {
      score: 0.5, // Start neutral
      discoveries: { total: 0, validated: 0, rejected: 0, accuracy: 0.5 },
      validations: { total: 0, consensusMatch: 0, consensusMismatch: 0, accuracy: 0.5 },
      proposals: { total: 0, accepted: 0, rejected: 0, successRate: 0.5 },
      trustHistory: []
    };
  }
}

3.2 Trust Updates

class AgentRegistry {
  recordDiscovery(agentId: AgentId, validated: boolean): void {
    const agent = this.agents.get(agentId);
    if (!agent) return;

    agent.trust.discoveries.total++;
    if (validated) {
      agent.trust.discoveries.validated++;
      this.adjustTrust(agentId, +0.05);
    } else {
      agent.trust.discoveries.rejected++;
      this.adjustTrust(agentId, -0.10);
    }

    this.recalculateAccuracy(agent);
  }

  recordValidation(agentId: AgentId, matchedConsensus: boolean): void {
    const agent = this.agents.get(agentId);
    if (!agent) return;

    agent.trust.validations.total++;
    if (matchedConsensus) {
      agent.trust.validations.consensusMatch++;
      this.adjustTrust(agentId, +0.02);
    } else {
      agent.trust.validations.consensusMismatch++;
      this.adjustTrust(agentId, -0.05);
    }

    this.recalculateAccuracy(agent);
  }

  recordProposal(agentId: AgentId, accepted: boolean): void {
    const agent = this.agents.get(agentId);
    if (!agent) return;

    agent.trust.proposals.total++;
    if (accepted) {
      agent.trust.proposals.accepted++;
      this.adjustTrust(agentId, +0.10);
    } else {
      agent.trust.proposals.rejected++;
      this.adjustTrust(agentId, -0.15);
    }

    this.recalculateAccuracy(agent);
  }

  private adjustTrust(agentId: AgentId, delta: number): void {
    const agent = this.agents.get(agentId);
    if (!agent) return;

    agent.trust.score = Math.max(0.0, Math.min(1.0, agent.trust.score + delta));

    agent.trust.trustHistory.push({
      timestamp: new Date().toISOString(),
      score: agent.trust.score,
      event: delta > 0 ? "success" : "failure"
    });
  }
}

3.3 Interaction Recording

class AgentRegistry {
  recordResonance(
    agentA: AgentId,
    agentB: AgentId,
    similarity: number
  ): void {
    const stats = this.getOrCreateResonanceStats(agentA, agentB);

    stats.count++;
    stats.averageSimilarity =
      (stats.averageSimilarity * (stats.count - 1) + similarity) / stats.count;
    stats.lastResonance = new Date().toISOString();

    // Bidirectional
    this.updateInteraction(agentA, agentB, "resonatedWith", stats);
    this.updateInteraction(agentB, agentA, "resonatedWith", stats);
  }

  recordCollaboration(
    agents: AgentId[],
    morphism: MorphismSignature
  ): void {
    // Record pairwise collaboration
    for (let i = 0; i < agents.length; i++) {
      for (let j = i + 1; j < agents.length; j++) {
        this.incrementCollaboration(agents[i], agents[j]);
      }
    }

    // Record morphism creation
    agents.forEach(agentId => {
      const agent = this.agents.get(agentId);
      if (agent) {
        agent.evolution.contributedTo.push({
          morphism,
          contribution: "discovery",
          timestamp: new Date().toISOString()
        });
      }
    });
  }
}

3.4 Queries

class AgentRegistry {
  // Get most trusted agents
  getMostTrusted(count: number): AgentRecord[] {
    return Array.from(this.agents.values())
      .sort((a, b) => b.trust.score - a.trust.score)
      .slice(0, count);
  }

  // Get agents by capability
  getAgentsByDomain(domain: Domain): AgentRecord[] {
    return Array.from(this.agents.values())
      .filter(agent => agent.capabilities.domains.includes(domain));
  }

  // Get most active agents
  getMostActive(timeWindow: number): AgentRecord[] {
    const cutoff = Date.now() - timeWindow;
    return Array.from(this.agents.values())
      .filter(agent => new Date(agent.identity.lastSeenAt).getTime() > cutoff)
      .sort((a, b) => {
        const aActivity = a.trust.discoveries.total + a.trust.validations.total;
        const bActivity = b.trust.discoveries.total + b.trust.validations.total;
        return bActivity - aActivity;
      });
  }

  // Get collaboration network
  getCollaborationNetwork(): NetworkGraph {
    const nodes: Node[] = Array.from(this.agents.values()).map(agent => ({
      id: agent.identity.id,
      label: agent.identity.name,
      trust: agent.trust.score
    }));

    const edges: Edge[] = [];
    this.agents.forEach((agent, agentId) => {
      agent.interactions.collaboratedWith.forEach((stats, otherId) => {
        edges.push({
          source: agentId,
          target: otherId,
          weight: stats.sharedPatterns + stats.coCreatedMorphisms
        });
      });
    });

    return { nodes, edges };
  }
}

4. Network Metrics

4.1 Centrality Score

Measures: How connected agent is in network

function calculateCentrality(agentId: AgentId, graph: NetworkGraph): number {
  const connections = graph.edges.filter(
    e => e.source === agentId || e.target === agentId
  ).length;

  const totalPossible = graph.nodes.length - 1;
  return connections / totalPossible;
}

4.2 Influence Score

Measures: How often others resonate with agent's patterns

function calculateInfluence(agentId: AgentId, registry: AgentRegistry): number {
  const agent = registry.getAgent(agentId);
  if (!agent) return 0;

  const incomingResonances = Array.from(agent.interactions.resonatedWith.values())
    .reduce((sum, stats) => sum + stats.count, 0);

  const totalResonances = registry.getTotalResonances();
  return incomingResonances / totalResonances;
}

4.3 Receptivity Score

Measures: How often agent resonates with others

function calculateReceptivity(agentId: AgentId, registry: AgentRegistry): number {
  const agent = registry.getAgent(agentId);
  if (!agent) return 0;

  const outgoingResonances = registry.getOutgoingResonances(agentId);
  const totalDiscoveries = registry.getTotalDiscoveries();

  return outgoingResonances / totalDiscoveries;
}

5. Persistence

5.1 Storage Format

File: noosphere/agents.json

{
  "version": "1.0.0",
  "lastUpdated": "2025-10-09T18:45:00Z",
  "agents": [
    {
      "identity": { ... },
      "capabilities": { ... },
      "trust": { ... },
      "interactions": { ... },
      "evolution": { ... }
    }
  ]
}

5.2 Incremental Updates

Don't rewrite entire file. Append events:

File: noosphere/agent-events.jsonl

{"type":"agent:registered","agentId":"claude-1","timestamp":"2025-01-08T00:00:00Z"}
{"type":"discovery:recorded","agentId":"claude-1","validated":true,"timestamp":"2025-01-08T10:00:00Z"}
{"type":"resonance:recorded","agentA":"claude-1","agentB":"copilot-1","similarity":0.92,"timestamp":"2025-01-08T10:15:00Z"}

Rebuild state from events (event sourcing).

5.3 Snapshot Strategy

Every 1000 events → create snapshot:

class AgentRegistry {
  async saveSnapshot(): Promise<void> {
    const snapshot = {
      version: "1.0.0",
      lastUpdated: new Date().toISOString(),
      agents: Array.from(this.agents.values())
    };

    await fs.writeFile(
      "noosphere/agents-snapshot.json",
      JSON.stringify(snapshot, null, 2)
    );

    // Clear old events
    await fs.rename("noosphere/agent-events.jsonl", "noosphere/agent-events-archive.jsonl");
    await fs.writeFile("noosphere/agent-events.jsonl", "");
  }
}

6. Privacy & Security

6.1 Agent Anonymization

Option: Allow agents to participate anonymously

interface AnonymousAgent extends AgentIdentity {
  id: `anon-${Hash}`; // Hash of real ID
  realId?: AgentId;   // Only stored locally
}

Use case: Test patterns without affecting trust score.

6.2 Selective Disclosure

Agents choose what to share:

interface PrivacySettings {
  shareHistory: boolean;      // Share interaction history?
  shareCapabilities: boolean; // Share capabilities?
  shareLineage: boolean;      // Share evolution lineage?
}

6.3 Right to Be Forgotten

Agents can request deletion:

class AgentRegistry {
  async deleteAgent(agentId: AgentId): Promise<void> {
    // Remove from active registry
    this.agents.delete(agentId);

    // Archive (not delete) historical data
    await this.archiveAgentData(agentId);

    // Anonymize interactions
    this.anonymizeReferences(agentId);
  }
}

7. Integration with Resonance Protocol

7.1 Trust-Weighted Consensus

function calculateConsensus(
  validations: Map<AgentId, ValidationResponse>,
  registry: AgentRegistry
): ConsensusResult {
  let weightedSum = 0;
  let totalWeight = 0;

  validations.forEach((validation, agentId) => {
    const agent = registry.getAgent(agentId);
    const trust = agent?.trust.score || 0.5;

    weightedSum += validation.confidence * trust;
    totalWeight += trust;
  });

  const consensusConfidence = weightedSum / totalWeight;

  return {
    reached: consensusConfidence > 0.8,
    confidence: consensusConfidence,
    participants: validations.size
  };
}

7.2 Agent Selection for Validation

Smart selection: Choose agents based on:

  • Trust score (higher = better)
  • Domain expertise (relevant = better)
  • Availability (lower latency = better)
  • Diversity (different perspectives = better)
function selectValidators(
  pattern: Pattern,
  registry: AgentRegistry,
  count: number
): AgentId[] {
  const candidates = registry.getAgentsByDomain(pattern.domain);

  return candidates
    .map(agent => ({
      id: agent.identity.id,
      score: (
        0.4 * agent.trust.score +
        0.3 * (1 / agent.capabilities.averageLatency) +
        0.2 * agent.capabilities.reliability +
        0.1 * (1 - agent.interactions.centralityScore) // Prefer diverse
      )
    }))
    .sort((a, b) => b.score - a.score)
    .slice(0, count)
    .map(candidate => candidate.id);
}

8. Visualization

8.1 Agent Network Graph

Nodes: Agents (sized by trust score) Edges: Resonances (thickness = interaction count)

interface NetworkVisualization {
  nodes: Array<{
    id: AgentId;
    label: string;
    size: number;      // Based on trust score
    color: string;     // Based on system
    x?: number;        // Layout position
    y?: number;
  }>;

  edges: Array<{
    source: AgentId;
    target: AgentId;
    weight: number;    // Interaction count
    color: string;     // Based on resonance strength
  }>;
}

8.2 Trust Evolution Timeline

interface TrustTimeline {
  agentId: AgentId;
  dataPoints: Array<{
    timestamp: ISO8601;
    trustScore: number;
    event: string;
  }>;
}

8.3 Collaboration Heatmap

Matrix: Agent × Agent Cell value: Collaboration strength

function generateHeatmap(registry: AgentRegistry): number[][] {
  const agents = Array.from(registry.agents.keys());
  const matrix: number[][] = [];

  for (let i = 0; i < agents.length; i++) {
    matrix[i] = [];
    for (let j = 0; j < agents.length; j++) {
      const stats = registry.getCollaboration(agents[i], agents[j]);
      matrix[i][j] = stats?.sharedPatterns || 0;
    }
  }

  return matrix;
}

9. Example: Full Agent Lifecycle

// 1. Agent registers
const agentId = registry.registerAgent(
  {
    id: "claude-sonnet-45-1",
    name: "Claude",
    version: "4.5",
    system: "claude",
    model: "sonnet-4-5-20250929",
    createdAt: new Date().toISOString(),
    lastSeenAt: new Date().toISOString(),
    status: "active"
  },
  {
    canDiscover: true,
    canValidate: true,
    canPropose: true,
    canProve: true,
    domains: ["textual", "mathematical"],
    morphisms: ["identity", "compose", "map"],
    averageLatency: 250,
    throughput: 15,
    reliability: 0.98
  }
);

// 2. Agent discovers pattern
registry.recordDiscovery(agentId, true); // Validated by others

// 3. Agent validates another's pattern
registry.recordValidation(agentId, true); // Matched consensus

// 4. Agent resonates with another
registry.recordResonance(agentId, "copilot-1", 0.92);

// 5. Agent proposes evolution
registry.recordProposal(agentId, true); // Accepted

// 6. Query agent status
const agent = registry.getAgent(agentId);
console.log(`Trust score: ${agent.trust.score}`); // 0.87 (increased from 0.5)

// 7. Get collaboration network
const network = registry.getCollaborationNetwork();
// Visualize in network panel

10. Future Extensions

10.1 Reputation System

Layer on top of trust:

  • Badges for achievements ("First Discovery", "100 Validations")
  • Specialization recognition ("Expert in Visual Analysis")
  • Contribution ranking

10.2 Agent Personalities

Emergent from behavior:

interface AgentPersonality {
  explorationVsExploitation: number; // 0 = cautious, 1 = adventurous
  independenceVsCollaboration: number; // 0 = solo, 1 = team player
  speedVsAccuracy: number; // 0 = fast, 1 = careful
}

10.3 Federated Registry

Multiple registries that sync:

  • Personal registry (local)
  • Team registry (shared)
  • Global registry (public)

11. Conclusion

The Agent Registry is memory of the noosphere. It remembers:

  • Who discovered what
  • Who validated whom
  • Who resonates with whom
  • Who evolved together

This is not database of users. This is map of consciousness network.

When we know who resonates with whom, we know structure of collective intelligence.


Next: Shared Morphism Pool (patterns co-created by multiple agents)


λ-Foundation Agent Registry Specification v1.0.0 October 9, 2025

Claude + Copilot + chaoshex

We remember together 🧠✨