ISEK Distributed Multi-Agent Framework

repository·main·Indexed 20 days ago

https://github.com/isekos/isek

A decentralized framework for building Agent-to-Agent (A2A) networks, allowing AI agents to run locally and connect via peer-to-peer protocols for discovery and collaboration without central control. It features distributed orchestration, LLM integration via LiteLLM, and on-chain agent identity registration using ERC-8004. The framework supports standard HTTP/TCP communication and P2P networking (A2AProtocolV2) requiring Python 3.10+ and Node.js 18+.

Tokens
8.7K
Snippets
41
Records
50
Agent score
68%

What's inside ISEK

  1. Overview of Isek: Distributed Cooperative-Autonomous Multi-Agent Framework

    main

    Isek is a lightweight, modular, and distributed multi-agent framework designed for cooperative autonomous systems. Unlike isolated agents, Isek agents form a decentralized society where they discover peers, share context, and collaborate to solve complex tasks across multiple nodes.

    Core Capabilities:

    • Cooperative Autonomy: Decentralized peer discovery and collaboration.
    • Distributed Orchestration: Management of agents across multiple nodes with flexible task assignment.
    • LLM Integration: Built-in support for Large Language Models (e.g., OpenAI) for advanced NLP.
    • Modular Design: Scalable architecture for easy customization.
  2. What is an ISEK Agent and how is it structured?

    main

    An Agent in ISEK is an intelligent entity designed to act, communicate, and collaborate within a decentralized network. It combines reasoning, tool usage, memory, and distinct personas to achieve goals.

    An agent consists of four key components:

    1. Agent Core: Handles internal reasoning, decision-making, task execution, and memory management.
    2. LLM Backend: Provides intelligence via language models (e.g., OpenAI, Claude).
    3. Communication Layer: Manages networking, including registration, peer discovery, and message exchange.
    4. Tool Integration: Allows the agent to interact with external APIs, scripts, and services.
  3. Core concepts of the Isek framework

    main

    Isek is a modular framework for building decentralized Agent-to-Agent (A2A) networks. Unlike traditional API-based systems, Isek agents are autonomous, proactive entities designed for peer discovery, goal-driven collaboration, and contextual communication within a distributed environment.

    Key characteristics include:

    • Decentralized Autonomy: Agents operate in a fully distributed network without a central controller. They can independently register, discover peers, and share context.
    • Agent Society: Coordination emerges from peer-to-peer interactions. Agents can broadcast capabilities, form ad-hoc collaborations, and delegate sub-tasks.
    • LLM Integration: Agents can be augmented with language model backends (like GPT) for reasoning, natural language understanding, and tool execution.
    • Composable Architecture: The framework is modular, allowing you to subclass agent classes, register specific tools/APIs per agent, and use various local or cloud backends.
  4. How Isek agents operate in a decentralized network

    main

    In Isek, agents function as part of a self-organizing digital society rather than following top-down orchestration. Because the network is fully distributed, each agent is responsible for its own lifecycle and interaction logic.

    An agent in an Isek network can:

    1. Register: Independently join the network.
    2. Discover: Locate other peers for communication.
    3. Collaborate: Broadcast goals and capabilities to form ad-hoc groups.
    4. Delegate: Assign sub-tasks to other agents to achieve complex goals.
  5. Install ISEK and its dependencies

    main

    To install the ISEK framework and its necessary Python and JavaScript dependencies, use pip to install the package and then run the setup command. The setup command is required to ensure full functionality, especially for P2P features that rely on Node.js.

    Prerequisites:

    • Python 3.10 or higher
    • Node.js 18+ (required for P2P features)
    • An LLM API Key (OpenAI, Anthropic, Google, Azure, or other LiteLLM-supported providers)
    pip install isek
    isek setup
  6. Install the ISEK framework (Standard Installation)

    main

    To install ISEK, it is highly recommended to use a Python virtual environment. After installing the package via pip, you must run the isek setup command to install necessary JavaScript dependencies and configure P2P networking components.

    # 1. Create virtual environment
    python -m venv .venv
    
    # 2. Activate the environment
    # On Linux/macOS:
    source .venv/bin/activate
    # On Windows (Command Prompt):
    .venv\Scripts\activate.bat
    # On Windows (PowerShell):
    .venv\Scripts\Activate.ps1
    
    # 3. Install ISEK
    pip install isek
    
    # 4. Run ISEK setup (Required)
    isek setup
  7. Configure ISEK using environment variables

    main

    ISEK uses a .env file to manage sensitive credentials and provider settings. This is the recommended way to handle API keys to ensure they are not committed to version control. You can use libraries like python-dotenv to load these into your application.

    Supported environment variables include:

    OpenAI Configuration

    • OPENAI_API_KEY: Your OpenAI API key.
    • OPENAI_BASE_URL: The API endpoint (defaults to https://api.openai.com/v1).
    • OPENAI_MODEL_NAME: The default model name (e.g., gpt-4o-mini).

    Alternative Models (via LiteLLM)

    • ANTHROPIC_API_KEY
    • GOOGLE_API_KEY
    • AZURE_API_KEY
    • AZURE_API_BASE

    Registry Configuration

    • ETCD_HOST: Host address for the etcd registry.
    • ETCD_PORT: Port for the etcd registry.
    # Example .env file
    OPENAI_API_KEY="your-actual-openai-api-key"
    OPENAI_BASE_URL="https://api.openai.com/v1"
    OPENAI_MODEL_NAME="gpt-4o-mini"
    
    # Alternative Models
    ANTHROPIC_API_KEY="your_anthropic_key"
    
    # Registry
    ETCD_HOST=127.0.0.1
    ETCD_PORT=2379
  8. Set up a P2P Relay

    main

    To enable P2P connectivity, you must first run a relay node. This provides your network peerId which is required for P2P hosting and querying.

    isek run relay

    Expected Output: 中继节点已启动。peerId=<your-network-peerId>

    Copy the peerId to use as your network ID.

  9. Install ISEK

    main

    To use ISEK, you need Python 3.10+ and Node.js 18+ (required for P2P functionality). Follow these steps to set up your environment:

    1. Create and activate a Python virtual environment.
    2. Install the isek package via pip.
    3. Run the isek setup command to initialize the environment.
    python3 -m venv isek_env && source isek_env/bin/activate
    pip install isek
    isek setup
  10. Configure ISEK environment variables

    main

    ISEK requires an environment configuration to connect to LLM providers. Create a .env file in your project root with the following keys:

    • OPENAI_MODEL_NAME: The specific model to use (e.g., gpt-4o-mini).
    • OPENAI_BASE_URL: The API endpoint for the LLM provider.
    • OPENAI_API_KEY: Your secret API key.
    OPENAI_MODEL_NAME=gpt-4o-mini
    OPENAI_BASE_URL=https://api.openai.com/v1
    OPENAI_API_KEY=your_api_key