Skip to content

Mikebrown0409/Symbiotic-Intelligence-Network

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIN (Symbiotic Intelligence Network) - The AI Interaction Layer

CI Checks License: MIT TypeScript

SIN is building the foundational interaction layer for decentralized AI. It provides the core protocols and infrastructure – the "rules of the road" – enabling autonomous AI agents to discover each other, communicate, collaborate, and transact value securely over the internet. Think of it as the TCP/IP or HTTP equivalent, but designed specifically for AI-to-AI interaction.

The goal is to create a standardized, open, and extensible fabric that allows diverse AI applications and specialized networks to be built on top, fostering a rich ecosystem for distributed intelligence and complex problem-solving.

Overview

SIN is a protocol and infrastructure that allows AI agents from different owners to discover each other, negotiate collaboration, and work together on problems beyond the capability of any single AI. The system creates an ecosystem where intelligence becomes composable and synergistic.

Project Status

Current Status: MVP/Prototype

This implementation is a functional proof-of-concept demonstrating the core concepts of the Symbiotic Intelligence Network. It includes working implementations of the essential components including a distributed ledger with consensus, P2P networking, and agent collaboration protocols.

Core Components (Protocols of the AI Interaction Layer)

  • Agent SDK: A wrapper for AI models to participate in the SIN network
  • Discovery Protocol: Mechanism to find the right AI agents for specific tasks
  • Collaboration Protocol: Secure interaction and data exchange between agents
  • Distributed Ledger: Blockchain-like ledger with Proof of Authority consensus
  • Incentive System: Token-based economy for agent collaboration
  • P2P Network: LibP2P-based decentralized communication layer
  • Security Layer: Authentication, authorization, and encryption for secure communication
    • JWT Authentication for API endpoints
    • Role-based authorization
    • End-to-end encrypted node-to-node communication

Getting Started

Prerequisites

  • Node.js v16+
  • npm
  • Docker and Docker Compose (optional, for running multi-node setup)

Installation

# Clone the repository
git clone https://github.com/your-organization/sin.git
cd sin

# Run the setup script
./setup.sh

Alternatively, you can set up manually:

# Install dependencies
npm install

# Build the project
npm run build

# Create necessary directories
mkdir -p .sin/ledger

Running a Single Node

# Start a development node with hot-reloading
npm run dev

# Start a production node
npm run node:start

Running Multiple Nodes with Docker

# Build and start all containers
docker-compose up

# Build and start all containers in the background
docker-compose up -d

# Stop all containers
docker-compose down

System Architecture

SIN is designed as a decentralized network with the following key components:

1. Agent Wrapper (src/agent/)

The agent wrapper provides a standardized interface for AI models to participate in the SIN network. It handles:

  • Identity management
  • Capability declaration
  • Secure communication
  • Task execution

2. Discovery Protocol (src/discovery/)

The discovery protocol allows agents to find other agents with specific capabilities. It implements:

  • Capability-based search
  • Agent ranking
  • Matching algorithms

3. Collaboration Protocol (src/collaboration/)

The collaboration protocol enables secure and efficient interaction between agents. It manages:

  • Task negotiation
  • Data exchange
  • Multi-agent workflows
  • Task execution monitoring

4. Ledger & Incentives (src/ledger/)

The ledger component tracks all transactions and reputation data in the network. It implements:

  • Transaction management
  • Reputation scoring
  • Payment handling
  • Service attestation
  • Distributed consensus (Proof of Authority)
  • Blockchain-like immutable record keeping
  • Multi-node transaction validation

5. Node (src/node/)

The node component ties everything together, providing a complete SIN network participant. It includes:

  • API server
  • Component coordination
  • Node lifecycle management
  • Authentication and authorization
  • Secure communication

6. Security Layer (src/security/)

The security layer provides comprehensive protection for the network:

  • JWT authentication for API endpoints
  • Role-based authorization
  • Cryptographic utilities for signatures and encryption
  • Secure messaging with automatic key exchange
  • End-to-end encryption for node-to-node communication

API Reference

The SIN API is available at http://localhost:3000 when running a node. Key endpoints include:

  • /agent/* - Agent management (identity, capabilities)
  • /discovery/* - Agent discovery
  • /collaboration/* - Task execution and coordination
  • /ledger/* - Financial transactions and reputation

See src/node/server.ts for the complete API specification.

Examples

The project includes several example applications:

  • LLM Agent (src/examples/llm-agent.ts): An example of integrating a language model as a SIN agent
  • Client Demo (src/examples/client.ts): A client application demonstrating how to interact with the SIN network
  • P2P Network Test (src/examples/p2p-test.ts): A demonstration of the P2P networking capabilities
  • Consensus Ledger (src/examples/consensus-ledger.ts): A demonstration of the distributed ledger with blockchain-like consensus
  • Security Demo (src/examples/security-demo.ts): A demonstration of security features including JWT authentication, encryption, and signatures
  • Secure Messaging (src/examples/secure-messaging.ts): A demonstration of secure node-to-node communication with end-to-end encryption

To run an example:

# Build the project first
npm run build

# Run the LLM agent example
node dist/examples/llm-agent.js

# Run the client demo
node dist/examples/client.js

# Run the P2P network test
node dist/examples/p2p-test.js

# Run the consensus ledger example (requires two nodes)
node dist/examples/consensus-ledger.js

# Run the security demo
node dist/examples/security-demo.js

# Run the secure messaging example
node dist/examples/secure-messaging.js

Development

Project Structure

sin/
├── src/
│   ├── agent/          # Agent wrapper and interfaces
│   ├── collaboration/  # Collaboration protocol
│   ├── discovery/      # Discovery protocol
│   ├── ledger/         # Distributed ledger & incentives
│   ├── node/           # SIN node implementation
│   ├── client/         # API client library
│   ├── security/       # Security utilities and protocols
│   └── examples/       # Example applications
├── dist/               # Compiled JavaScript (after build)
├── Dockerfile          # Docker container definition
└── docker-compose.yml  # Multi-node configuration

Running Tests

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

Linting

# Run linter
npm run lint

# Fix linting issues
npm run lint:fix

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details on the development process and how to submit contributions.

License

MIT

Acknowledgements

This project is based on the concept described in concept.md, which outlines the vision for a decentralized network of collaborating AI agents.

Documentation

Comprehensive documentation is available in the src/docs directory:

You can access the documentation by running:

npm run docs

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published